From: oetiker Date: Mon, 23 Aug 2010 05:28:23 +0000 (+0000) Subject: in remote mode, make argument count for remote commmands strict as suggested by Dave... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=aa6a96837d73f4f3992007c0b5b5e6950860a067;p=rrdtool.git in remote mode, make argument count for remote commmands strict as suggested by Dave Peticolas git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.4/program@2119 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/src/rrd_tool.c b/src/rrd_tool.c index 4ad80f7..2c32a35 100644 --- a/src/rrd_tool.c +++ b/src/rrd_tool.c @@ -534,7 +534,7 @@ int HandleInputLine( */ if (RemoteMode) { if (argc > 1 && strcmp("quit", argv[1]) == 0) { - if (argc > 2) { + if (argc != 2) { printf("ERROR: invalid parameter count for quit\n"); return (1); } @@ -542,7 +542,7 @@ int HandleInputLine( } #if defined(HAVE_OPENDIR) && defined(HAVE_READDIR) && defined(HAVE_CHDIR) if (argc > 1 && strcmp("cd", argv[1]) == 0) { - if (argc > 3) { + if (argc != 3) { printf("ERROR: invalid parameter count for cd\n"); return (1); } @@ -562,7 +562,7 @@ int HandleInputLine( } if (argc > 1 && strcmp("pwd", argv[1]) == 0) { char *cwd; /* To hold current working dir on call to pwd */ - if (argc > 2) { + if (argc != 2) { printf("ERROR: invalid parameter count for pwd\n"); return (1); } @@ -576,7 +576,7 @@ int HandleInputLine( return (0); } if (argc > 1 && strcmp("mkdir", argv[1]) == 0) { - if (argc > 3) { + if (argc != 3) { printf("ERROR: invalid parameter count for mkdir\n"); return (1); } @@ -595,7 +595,7 @@ int HandleInputLine( return (0); } if (argc > 1 && strcmp("ls", argv[1]) == 0) { - if (argc > 2) { + if (argc != 2) { printf("ERROR: invalid parameter count for ls\n"); return (1); }