X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_tool.c;h=3f26a701e0c0d20cf805546e2dd075a30e197784;hb=6d3241b67db4ecf44be1611d49badea07d74feac;hp=65e411e1202d5ba218e1b705108bf294c2a7b5c5;hpb=20aaecbc4681668a37325c7804f58fc22660cc7c;p=rrdtool.git diff --git a/src/rrd_tool.c b/src/rrd_tool.c index 65e411e..3f26a70 100644 --- a/src/rrd_tool.c +++ b/src/rrd_tool.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.2.10 Copyright by Tobi Oetiker, 1997-2005 + * RRDtool 1.2.11 Copyright by Tobi Oetiker, 1997-2005 ***************************************************************************** * rrd_tool.c Startup wrapper *****************************************************************************/ @@ -23,11 +23,7 @@ void PrintUsage(char *cmd) char help_main[] = "RRDtool " PACKAGE_VERSION " Copyright 1997-2005 by Tobias Oetiker \n" -#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) " Compiled " __DATE__ " " __TIME__ "\n\n" -#else - " Compiled " MAKE_TIMESTAMP "\n\n" -#endif "Usage: rrdtool [options] command command_options\n\n"; char help_list[] = @@ -303,9 +299,7 @@ int main(int argc, char *argv[]) { char **myargv; char aLine[MAX_LENGTH]; -#ifdef HAVE_CHROOT char *firstdir=""; -#endif #ifdef MUST_DISABLE_SIGFPE signal(SIGFPE,SIG_IGN); #endif @@ -331,9 +325,9 @@ int main(int argc, char *argv[]) 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", @@ -342,8 +336,12 @@ int main(int argc, char *argv[]) } 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]; } } @@ -354,11 +352,6 @@ int main(int argc, char *argv[]) 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) {