mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 04:43:09 +03:00
netdata: patch nonsense when serving static files
This commit is contained in:
parent
f57c6449dc
commit
07221cf39f
@ -13,6 +13,8 @@ stdenv.mkDerivation rec{
|
||||
|
||||
buildInputs = [ autoreconfHook zlib pkgconfig ];
|
||||
|
||||
patches = [ ./web_access.patch ];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Real-time performance monitoring tool";
|
||||
homepage = http://netdata.firehol.org;
|
||||
|
20
pkgs/tools/system/netdata/web_access.patch
Normal file
20
pkgs/tools/system/netdata/web_access.patch
Normal file
@ -0,0 +1,20 @@
|
||||
--- 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
|
||||
+#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);
|
||||
}
|
||||
-
|
||||
+#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);
|
||||
|
Loading…
Reference in New Issue
Block a user