From bb901d6fb82c5908ab7d7b61828ae75e4b6ddbe5 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 28 May 2008 21:07:21 +0000 Subject: [PATCH] kes Add Martin's fixes to argument scanning for the estimate command. This fixes bug #1093. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7050 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/dird/ua_cmds.c | 16 ++++++++++++++-- bacula/technotes-2.3 | 2 ++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index 633e3a6b3d..063a1b4c55 100644 --- a/bacula/src/dird/ua_cmds.c +++ b/bacula/src/dird/ua_cmds.c @@ -1082,13 +1082,21 @@ static int estimate_cmd(UAContext *ua, const char *cmd) strcasecmp(ua->argk[i], NT_("fd")) == 0) { if (ua->argv[i]) { client = GetClientResWithName(ua->argv[i]); + if (!client) { + ua->error_msg(_("Client \"%s\" not found.\n"), ua->argv[i]); + return 1; + } continue; } } if (strcasecmp(ua->argk[i], NT_("job")) == 0) { if (ua->argv[i]) { job = GetJobResWithName(ua->argv[i]); - if (job && !acl_access_ok(ua, Job_ACL, job->name())) { + if (!job) { + ua->error_msg(_("Job \"%s\" not found.\n"), ua->argv[i]); + return 1; + } + if (!acl_access_ok(ua, Job_ACL, job->name())) { ua->error_msg(_("No authorization for Job \"%s\"\n"), job->name()); return 1; } @@ -1098,7 +1106,11 @@ static int estimate_cmd(UAContext *ua, const char *cmd) if (strcasecmp(ua->argk[i], NT_("fileset")) == 0) { if (ua->argv[i]) { fileset = GetFileSetResWithName(ua->argv[i]); - if (fileset && !acl_access_ok(ua, FileSet_ACL, fileset->name())) { + if (!fileset) { + ua->error_msg(_("Fileset \"%s\" not found.\n"), ua->argv[i]); + return 1; + } + if (!acl_access_ok(ua, FileSet_ACL, fileset->name())) { ua->error_msg(_("No authorization for FileSet \"%s\"\n"), fileset->name()); return 1; } diff --git a/bacula/technotes-2.3 b/bacula/technotes-2.3 index 97af471b50..27ff147c34 100644 --- a/bacula/technotes-2.3 +++ b/bacula/technotes-2.3 @@ -25,6 +25,8 @@ Add long term statistics job table General: 28May08 +kes Add Martin's fixes to argument scanning for the estimate + command. This fixes bug #1093. kes Add debug code to SD. kes Fix renaming a Volume, which used the wrong Volume name. 26May08 -- 2.39.5