X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_cgi.c;h=83a481f8ffc3e8d3078e922e189e958a1f2ecfae;hb=0cdbc46c70b605d795a1ac3342d1ddddef0d307e;hp=0c4f6de7be3ee91dc9ec9f330acbc8198f08410d;hpb=285da1fa16e80919db972b1d7021c0b4705bedb1;p=rrdtool.git diff --git a/src/rrd_cgi.c b/src/rrd_cgi.c index 0c4f6de..83a481f 100644 --- a/src/rrd_cgi.c +++ b/src/rrd_cgi.c @@ -128,9 +128,9 @@ int main(int argc, char *argv[]) { server_url = getenv("SERVER_URL"); } - if (optind != argc-1) { - fprintf(stderr, "ERROR: expected a filename\n"); - exit(1); + if ( (optind != argc-2 && strstr(getenv("SERVER_SOFTWARE"),"Apache/2") != NULL) && optind != argc-1) { + fprintf(stderr, "ERROR: expected a filename\n"); + exit(1); } else { length = readfile(argv[optind], &buffer, 1); } @@ -253,6 +253,7 @@ char* includefile(long argc, char **args){ } } +static char* rrdstrip(char *buf){ char *start; if (buf == NULL) return NULL; @@ -442,6 +443,7 @@ char* printtimenow(long argc, char **args) { } /* scan aLine until an unescaped '>' arives */ +static char* scanargs(char *aLine, long *argc, char ***args) { char *getP, *putP; @@ -459,7 +461,7 @@ char* scanargs(char *aLine, long *argc, char ***args) getP = aLine; putP = aLine; while (*getP && !( !Quote && (braket == 0) && ((*getP) == '>'))){ - if (*getP < ' ') *getP = ' '; /*remove all special chars*/ + if ((unsigned)*getP < ' ') *getP = ' '; /*remove all special chars*/ switch (*getP) { case ' ': if (Quote){