tangled
alpha
login
or
join now
tjh.dev
/
nixpkgs
Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
0
fork
atom
overview
issues
pulls
pipelines
netdata: patch nonsense when serving static files
Luca Bruno
9 years ago
07221cf3
f57c6449
+22
2 changed files
expand all
collapse all
unified
split
pkgs
tools
system
netdata
default.nix
web_access.patch
+2
pkgs/tools/system/netdata/default.nix
···
13
13
14
14
buildInputs = [ autoreconfHook zlib pkgconfig ];
15
15
16
16
+
patches = [ ./web_access.patch ];
17
17
+
16
18
meta = with stdenv.lib; {
17
19
description = "Real-time performance monitoring tool";
18
20
homepage = http://netdata.firehol.org;
+20
pkgs/tools/system/netdata/web_access.patch
···
1
1
+
--- a/src/web_client.c.orig 2016-04-15 19:00:49.912539101 +0200
2
2
+
+++ b/src/web_client.c 2016-04-15 19:01:19.379960970 +0200
3
3
+
@@ -293,6 +293,7 @@
4
4
+
}
5
5
+
6
6
+
// check if the file is owned by us
7
7
+
+#if 0
8
8
+
if(stat.st_uid != web_files_uid()) {
9
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
10
+
buffer_sprintf(w->response.data, "Access to file '%s' is not permitted.", filename);
11
11
+
@@ -303,7 +304,7 @@
12
12
+
snprintf(webfilename, FILENAME_MAX+1, "%s/index.html", filename);
13
13
+
return mysendfile(w, webfilename);
14
14
+
}
15
15
+
-
16
16
+
+#endif
17
17
+
if((stat.st_mode & S_IFMT) != S_IFREG) {
18
18
+
error("%llu: File '%s' is not a regular file. Access Denied.", w->id, webfilename);
19
19
+
buffer_sprintf(w->response.data, "Access to file '%s' is not permitted.", filename);
20
20
+