* Version $Id$
*/
/*
- Copyright (C) 2000-2005 Kern Sibbald
+ Copyright (C) 2000-2006 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
return 1;
}
+ while (ua->jcr->storage->size()) {
+ ua->jcr->storage->remove(0);
+ }
+
len = strlen(ua->argk[0]);
for (i=0; i<comsize; i++) { /* search for command */
if (strncasecmp(ua->argk[0], _(commands[i].key), len) == 0) {
- if (!acl_access_ok(ua, Command_ACL, ua->argk[0], len)) {
+ /* Check if command permitted, but "quit" is always OK */
+ if (strcmp(ua->argk[0], "quit") != 0 &&
+ !acl_access_ok(ua, Command_ACL, ua->argk[0], len)) {
break;
}
stat = (*commands[i].func)(ua, cmd); /* go execute command */
/* Count Jobs running */
foreach_jcr(jcr) {
if (jcr->JobId == 0) { /* this is us */
- free_jcr(jcr);
continue;
}
- free_jcr(jcr);
njobs++;
}
+ endeach_jcr(jcr);
if (njobs == 0) {
bsendmsg(ua, _("No Jobs running.\n"));
foreach_jcr(jcr) {
char ed1[50];
if (jcr->JobId == 0) { /* this is us */
- free_jcr(jcr);
continue;
}
bsnprintf(buf, sizeof(buf), _("JobId=%s Job=%s"), edit_int64(jcr->JobId, ed1), jcr->Job);
add_prompt(ua, buf);
- free_jcr(jcr);
}
+ endeach_jcr(jcr);
if (do_prompt(ua, _("Job"), _("Choose Job to cancel"), buf, sizeof(buf)) < 0) {
return 1;
JOB *job = NULL;
CLIENT *client = NULL;
FILESET *fileset = NULL;
- FILESET_DBR fsr;
int listing = 0;
char since[MAXSTRING];
JCR *jcr = ua->jcr;
if (!get_or_create_client_record(jcr)) {
return 1;
}
- if (!get_or_create_fileset_record(jcr, &fsr)) {
+ if (!get_or_create_fileset_record(jcr)) {
return 1;
}
}
Dmsg2(120, "%s: %s\n", command, ua->UA_sock->msg);
- store = get_storage_resource(ua, true/*use default*/);
+ store = get_storage_resource(ua, true/*arg is storage*/);
if (!store) {
return;
}
- drive = ua->int32_val;
+ set_storage(jcr, store);
+ drive = get_storage_drive(ua, store);
Dmsg3(120, "Found storage, MediaType=%s DevName=%s drive=%d\n",
store->media_type, store->dev_name(), drive);
- set_storage(jcr, store);
if (!connect_to_storage_daemon(jcr, 10, SDConnectTimeout, 1)) {
bsendmsg(ua, _("Failed to connect to Storage daemon.\n"));
return;
foreach_jcr(jcr) {
if (jcr->JobId != 0) {
running = true;
- free_jcr(jcr);
break;
}
- free_jcr(jcr);
}
+ endeach_jcr(jcr);
+
if (running) {
bmicrosleep(1, 0);
}