/*****************************************************************************
- * RRDtool 1.2.11 Copyright by Tobi Oetiker, 1997-2005
+ * RRDtool 1.2.12 Copyright by Tobi Oetiker, 1997-2005
*****************************************************************************
* rrd_tool.c Startup wrapper
*****************************************************************************/
char help_main[] =
"RRDtool " PACKAGE_VERSION " Copyright 1997-2005 by Tobias Oetiker <tobi@oetiker.ch>\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[] =
{
char **myargv;
char aLine[MAX_LENGTH];
-#ifdef HAVE_CHROOT
char *firstdir="";
-#endif
#ifdef MUST_DISABLE_SIGFPE
signal(SIGFPE,SIG_IGN);
#endif
#endif
RemoteMode=1;
if ((argc == 3) && strcmp("",argv[2])){
- if (getuid()==0){
+
+ if (
+#ifdef HAVE_GETUID
+ getuid()
+#else
+ 1
+#endif
+ == 0 ){
+
#ifdef HAVE_CHROOT
chroot(argv[2]);
if (errno!=0){
#if ! defined(HAVE_CHROOT) || ! defined(HAVE_GETUID)
if (getuid()==0 && ! ChangeRoot){
printf("ERROR: chdir security problem - rrdtool is running as "
- "root an no chroot!\n");
+ "root but not chroot!\n");
return(1);
}
#endif
#if ! defined(HAVE_CHROOT) || ! defined(HAVE_GETUID)
if (getuid()==0 && ! ChangeRoot){
printf("ERROR: mkdir security problem - rrdtool is running as "
- "root an no chroot!\n");
+ "root but not chroot!\n");
return(1);
}
#endif