summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 13b2b80)
raw | patch | inline | side by side (parent: 13b2b80)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Thu, 11 Aug 2005 19:18:36 +0000 (19:18 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Thu, 11 Aug 2005 19:18:36 +0000 (19:18 +0000) |
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@672 a5681a0c-68f1-0310-ab6d-d61299d08faa
src/rrd_tool.c | patch | blob | history |
diff --git a/src/rrd_tool.c b/src/rrd_tool.c
index ecd88f975b1e18a1a26be9059b995696ad740f6b..fba0fa04ff551fe76a57351f0d5e53993d2be871 100644 (file)
--- a/src/rrd_tool.c
+++ b/src/rrd_tool.c
gettimeofday(&starttime,&tz);
#endif
RemoteMode=1;
-#ifdef HAVE_CHROOT
if ((argc == 3) && strcmp("",argv[2])){
if (getuid()==0){
+#ifdef HAVE_CHROOT
chroot(argv[2]);
if (errno!=0){
fprintf(stderr,"ERROR: can't change root to '%s' errno=%d\n",
}
ChangeRoot=1;
firstdir="/";
- }
- else{
+#else
+ fprintf(stderr,"ERROR: change root is not supported by your OS "
+ "or at least by this copy of rrdtool\n");
+ exit(1);
+#endif
+ } else {
firstdir=argv[2];
}
}
exit(errno);
}
}
-#else
- fprintf(stderr,"ERROR: change root is not supported by your OS "
- "or at least by this copy of rrdtool\n");
- exit(1);
-#endif
while (fgets(aLine, sizeof(aLine)-1, stdin)){
if ((argc = CountArgs(aLine)) == 0) {