X-Git-Url: https://git.octo.it/?p=rrdtool.git;a=blobdiff_plain;f=src%2Frrd_daemon.c;h=7406325ce6e4ec6b95f1c7dbd2ef435bd32b4f85;hp=fa7dc41bac4cf62837d2517f3a66f707ad5ff44b;hb=1f55de123f58e5ec37b6f36c8d2b4716f009a0ef;hpb=faf5ffaa9e488e6cf185a64a51fd6e9fd35a3267 diff --git a/src/rrd_daemon.c b/src/rrd_daemon.c index fa7dc41..7406325 100644 --- a/src/rrd_daemon.c +++ b/src/rrd_daemon.c @@ -2918,16 +2918,6 @@ static int read_options (int argc, char **argv) /* {{{ */ "%s\n", config_base_dir, rrd_strerror(errno)); return 5; } - else if (strncmp(config_base_dir, - base_realpath, sizeof(base_realpath)) != 0) - { - fprintf(stderr, - "Base directory (-b) resolved via file system links!\n" - "Please consult rrdcached '-b' documentation!\n" - "Consider specifying the real directory (%s)\n", - base_realpath); - return 5; - } len = strlen (config_base_dir); while ((len > 0) && (config_base_dir[len - 1] == '/')) @@ -2943,6 +2933,24 @@ static int read_options (int argc, char **argv) /* {{{ */ } _config_base_dir_len = len; + + len = strlen (base_realpath); + while ((len > 0) && (base_realpath[len - 1] == '/')) + { + base_realpath[len - 1] = '\0'; + len--; + } + + if (strncmp(config_base_dir, + base_realpath, sizeof(base_realpath)) != 0) + { + fprintf(stderr, + "Base directory (-b) resolved via file system links!\n" + "Please consult rrdcached '-b' documentation!\n" + "Consider specifying the real directory (%s)\n", + base_realpath); + return 5; + } } break;