Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

netdata: patch nonsense when serving static files

+22
+2
pkgs/tools/system/netdata/default.nix
··· 13 14 buildInputs = [ autoreconfHook zlib pkgconfig ]; 15 16 meta = with stdenv.lib; { 17 description = "Real-time performance monitoring tool"; 18 homepage = http://netdata.firehol.org;
··· 13 14 buildInputs = [ autoreconfHook zlib pkgconfig ]; 15 16 + patches = [ ./web_access.patch ]; 17 + 18 meta = with stdenv.lib; { 19 description = "Real-time performance monitoring tool"; 20 homepage = http://netdata.firehol.org;
+20
pkgs/tools/system/netdata/web_access.patch
···
··· 1 + --- a/src/web_client.c.orig 2016-04-15 19:00:49.912539101 +0200 2 + +++ b/src/web_client.c 2016-04-15 19:01:19.379960970 +0200 3 + @@ -293,6 +293,7 @@ 4 + } 5 + 6 + // check if the file is owned by us 7 + +#if 0 8 + if(stat.st_uid != web_files_uid()) { 9 + error("%llu: File '%s' is owned by user %d (I run as user %d). Access Denied.", w->id, webfilename, stat.st_uid, getuid()); 10 + buffer_sprintf(w->response.data, "Access to file '%s' is not permitted.", filename); 11 + @@ -303,7 +304,7 @@ 12 + snprintf(webfilename, FILENAME_MAX+1, "%s/index.html", filename); 13 + return mysendfile(w, webfilename); 14 + } 15 + - 16 + +#endif 17 + if((stat.st_mode & S_IFMT) != S_IFREG) { 18 + error("%llu: File '%s' is not a regular file. Access Denied.", w->id, webfilename); 19 + buffer_sprintf(w->response.data, "Access to file '%s' is not permitted.", filename); 20 +