- if (strcasecmp(ua->argk[i], _("storage")) == 0 ||
- strcasecmp(ua->argk[i], _("sd")) == 0) {
- store_name = ua->argv[i];
- break;
-
- } else if (strcasecmp(ua->argk[i], _("jobid")) == 0) {
- jobid = atoi(ua->argv[i]);
- if (jobid <= 0) {
- bsendmsg(ua, _("Expecting jobid=nn command, got: %s\n"), ua->argk[i]);
- return NULL;
- }
- if (!(jcr=get_jcr_by_id(jobid))) {
- bsendmsg(ua, _("JobId %d is not running.\n"), jobid);
- return NULL;
- }
- store = jcr->store;
- free_jcr(jcr);
- break;
-
- } else if (strcasecmp(ua->argk[i], _("job")) == 0) {
- if (!(jcr=get_jcr_by_partial_name(ua->argv[i]))) {
- bsendmsg(ua, _("Job %s is not running.\n"), ua->argv[i]);
- return NULL;
- }
- store = jcr->store;
- free_jcr(jcr);
- break;
- }
- }
- }
-
- if (!store && store_name) {
+ if (strcasecmp(ua->argk[i], NT_("storage")) == 0 ||
+ strcasecmp(ua->argk[i], NT_("sd")) == 0) {
+ store_name = ua->argv[i];
+ break;
+
+ } else if (strcasecmp(ua->argk[i], NT_("jobid")) == 0) {
+ jobid = str_to_int64(ua->argv[i]);
+ if (jobid <= 0) {
+ ua->error_msg(_("Expecting jobid=nn command, got: %s\n"), ua->argk[i]);
+ return NULL;
+ }
+ if (!(jcr=get_jcr_by_id(jobid))) {
+ ua->error_msg(_("JobId %s is not running.\n"), edit_int64(jobid, ed1));
+ return NULL;
+ }
+ store = jcr->wstore;
+ free_jcr(jcr);
+ break;
+
+ } else if (strcasecmp(ua->argk[i], NT_("job")) == 0 ||
+ strcasecmp(ua->argk[i], NT_("jobname")) == 0) {
+ if (!ua->argv[i]) {
+ ua->error_msg(_("Expecting job=xxx, got: %s.\n"), ua->argk[i]);
+ return NULL;
+ }
+ if (!(jcr=get_jcr_by_partial_name(ua->argv[i]))) {
+ ua->error_msg(_("Job \"%s\" is not running.\n"), ua->argv[i]);
+ return NULL;
+ }
+ store = jcr->wstore;
+ free_jcr(jcr);
+ break;
+ } else if (strcasecmp(ua->argk[i], NT_("ujobid")) == 0) {
+ if (!ua->argv[i]) {
+ ua->error_msg(_("Expecting ujobid=xxx, got: %s.\n"), ua->argk[i]);
+ return NULL;
+ }
+ if (!(jcr=get_jcr_by_full_name(ua->argv[i]))) {
+ ua->error_msg(_("Job \"%s\" is not running.\n"), ua->argv[i]);
+ return NULL;
+ }
+ store = jcr->wstore;
+ free_jcr(jcr);
+ break;
+ }
+ }
+ }
+ if (store && !acl_access_ok(ua, Storage_ACL, store->name())) {
+ store = NULL;
+ }
+
+ if (!store && store_name && store_name[0] != 0) {