pr.MaxVols, pr.PoolType);
while (pr.MaxVols > 0 && pr.NumVols >= pr.MaxVols) {
- bsendmsg(ua, _("Pool already has maximum volumes = %d\n"), pr.MaxVols);
+ bsendmsg(ua, _("Pool already has maximum volumes=%d\n"), pr.MaxVols);
for (;;) {
if (!get_pint(ua, _("Enter new maximum (zero for unlimited): "))) {
return 1;
Mmsg(query, "DELETE FROM Job WHERE JobId=%s", edit_int64(JobId, ed1));
db_sql_query(ua->db, query, NULL, (void *)NULL);
- Mmsg(query, "DELETE FROM File WHERE JobId=%s", edit_int64(JobId, ed1));
+ Mmsg(query, "DELETE FROM MAC WHERE JobId=%s", ed1);
db_sql_query(ua->db, query, NULL, (void *)NULL);
- Mmsg(query, "DELETE FROM JobMedia WHERE JobId=%s", edit_int64(JobId, ed1));
+ Mmsg(query, "DELETE FROM File WHERE JobId=%s", ed1);
+ db_sql_query(ua->db, query, NULL, (void *)NULL);
+ Mmsg(query, "DELETE FROM JobMedia WHERE JobId=%s", ed1);
db_sql_query(ua->db, query, NULL, (void *)NULL);
free_pool_memory(query);
bsendmsg(ua, _("Job %s and associated records deleted from the catalog.\n"), edit_int64(JobId, ed1));
* a "use catalog xxx" command, we simply find the first
* catalog resource and open it.
*/
-int open_db(UAContext *ua)
+bool open_db(UAContext *ua)
{
if (ua->db) {
- return 1;
+ return true;
}
if (!ua->catalog) {
LockRes();
UnlockRes();
if (!ua->catalog) {
bsendmsg(ua, _("Could not find a Catalog resource\n"));
- return 0;
+ return false;
+ } else if (!acl_access_ok(ua, Catalog_ACL, ua->catalog->hdr.name)) {
+ bsendmsg(ua, _("You must specify a \"use <catalog-name>\" command before continuing.\n"));
+ ua->catalog = NULL;
+ return false;
} else {
bsendmsg(ua, _("Using default Catalog name=%s DB=%s\n"),
ua->catalog->hdr.name, ua->catalog->db_name);
bsendmsg(ua, "%s", db_strerror(ua->db));
}
close_db(ua);
- return 0;
+ return false;
}
ua->jcr->db = ua->db;
Dmsg1(150, "DB %s opened\n", ua->catalog->db_name);
- return 1;
+ return true;
}
void close_db(UAContext *ua)