Skip to content

Instantly share code, notes, and snippets.

@irsl
Created March 15, 2018 11:50
Show Gist options
  • Save irsl/bc9b2a602625e9df45004d891a4c17e5 to your computer and use it in GitHub Desktop.
Save irsl/bc9b2a602625e9df45004d891a4c17e5 to your computer and use it in GitHub Desktop.
*** contrib/mod_proxy/mod_proxy.c.orig Thu Mar 15 11:17:32 2018
--- contrib/mod_proxy/mod_proxy.c Thu Mar 15 11:18:52 2018
*************** static int proxy_rmpath(pool *p, const c
*** 409,414 ****
--- 409,423 ----
"error removing directory '%s': %s", file, strerror(errno));
}
+ // removing directories here, as the top-level dir (specifed by ProxyTables) shall remain intact
+ res = rmdir(file);
+ if (res < 0) {
+ xerrno = errno;
+ pr_trace_msg(trace_channel, 9,
+ "error removing directory '%s': %s", file, strerror(xerrno));
+ errno = xerrno;
+ }
+
} else {
res = unlink(file);
if (res < 0) {
*************** static int proxy_rmpath(pool *p, const c
*** 420,433 ****
closedir(dirh);
- res = rmdir(path);
- if (res < 0) {
- xerrno = errno;
- pr_trace_msg(trace_channel, 9,
- "error removing directory '%s': %s", path, strerror(xerrno));
- errno = xerrno;
- }
-
return res;
}
#endif /* PR_SHARED_MODULE */
--- 429,434 ----
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment