diff options
author | Luca Bruno <lethalman88@gmail.com> | 2016-04-17 11:36:23 +0200 |
---|---|---|
committer | Luca Bruno <lethalman88@gmail.com> | 2016-04-17 11:36:33 +0200 |
commit | 627b7185b988b1477e442737ed858c67de53bcc3 (patch) | |
tree | 6427f44a96cbb19e2d86d1ea79e0419a4479e241 /pkgs/tools/system/netdata | |
parent | 6db84ed559499cddd907bdb85d3375948702a6eb (diff) | |
download | nixpkgs-627b7185b988b1477e442737ed858c67de53bcc3.tar nixpkgs-627b7185b988b1477e442737ed858c67de53bcc3.tar.gz nixpkgs-627b7185b988b1477e442737ed858c67de53bcc3.tar.bz2 nixpkgs-627b7185b988b1477e442737ed858c67de53bcc3.tar.lz nixpkgs-627b7185b988b1477e442737ed858c67de53bcc3.tar.xz nixpkgs-627b7185b988b1477e442737ed858c67de53bcc3.tar.zst nixpkgs-627b7185b988b1477e442737ed858c67de53bcc3.zip |
netdata: fix patch
Diffstat (limited to 'pkgs/tools/system/netdata')
-rw-r--r-- | pkgs/tools/system/netdata/web_access.patch | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/pkgs/tools/system/netdata/web_access.patch b/pkgs/tools/system/netdata/web_access.patch index e4177af51db..3c0fbf7507d 100644 --- a/pkgs/tools/system/netdata/web_access.patch +++ b/pkgs/tools/system/netdata/web_access.patch @@ -1,20 +1,19 @@ ---- a/src/web_client.c.orig 2016-04-15 19:00:49.912539101 +0200 -+++ b/src/web_client.c 2016-04-15 19:01:19.379960970 +0200 -@@ -293,6 +293,7 @@ - } - - // check if the file is owned by us +--- a/src/web_client.c.orig 2016-04-17 11:34:20.044455323 +0200 ++++ b/src/web_client.c 2016-04-17 11:34:47.432897957 +0200 +@@ -291,14 +291,14 @@ + buffer_sprintf(w->response.data, "File '%s' does not exist, or is not accessible.", filename); + return 404; + } +- +#if 0 - if(stat.st_uid != web_files_uid()) { - error("%llu: File '%s' is owned by user %d (I run as user %d). Access Denied.", w->id, webfilename, stat.st_uid, getuid()); - buffer_sprintf(w->response.data, "Access to file '%s' is not permitted.", filename); -@@ -303,7 +304,7 @@ - snprintf(webfilename, FILENAME_MAX+1, "%s/index.html", filename); - return mysendfile(w, webfilename); - } + // check if the file is owned by us + if(stat.st_uid != web_files_uid()) { + error("%llu: File '%s' is owned by user %d (I run as user %d). Access Denied.", w->id, webfilename, stat.st_uid, getuid()); + buffer_sprintf(w->response.data, "Access to file '%s' is not permitted.", filename); + return 403; + } - +#endif - if((stat.st_mode & S_IFMT) != S_IFREG) { - error("%llu: File '%s' is not a regular file. Access Denied.", w->id, webfilename); - buffer_sprintf(w->response.data, "Access to file '%s' is not permitted.", filename); - + if((stat.st_mode & S_IFMT) == S_IFDIR) { + snprintf(webfilename, FILENAME_MAX+1, "%s/index.html", filename); + return mysendfile(w, webfilename); |