many others, a complete list can be found in the file AUTHORS.
This program is Free Software; you can redistribute it and/or
modify it under the terms of version two of the GNU General Public
- License as published by the Free Software Foundation plus additions
- that are listed in the file LICENSE.
+ License as published by the Free Software Foundation and included
+ in the file LICENSE.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
return 1;
}
LockRes();
- client = (CLIENT *)GetResWithName(R_CLIENT, ua->cons->name());
+ client = GetClientResWithName(ua->cons->name());
if (!client) {
ua->error_msg(_("Client \"%s\" not found.\n"), ua->cons->name());
}
} else {
LockRes();
- job = (JOB *)GetResWithName(R_JOB, ua->argv[i]);
+ job = GetJobResWithName(ua->argv[i]);
UnlockRes();
}
if (!job) {
strcasecmp(ua->argk[i], "fd") == 0) {
client = NULL;
if (ua->argv[i]) {
- client = (CLIENT *)GetResWithName(R_CLIENT, ua->argv[i]);
+ client = GetClientResWithName(ua->argv[i]);
if (client) {
do_client_setdebug(ua, client, level, trace_flag);
return 1;
strcasecmp(ua->argk[i], NT_("sd")) == 0) {
store = NULL;
if (ua->argv[i]) {
- store = (STORE *)GetResWithName(R_STORAGE, ua->argv[i]);
+ store = GetStoreResWithName(ua->argv[i]);
if (store) {
do_storage_setdebug(ua, store, level, trace_flag);
return 1;
if (strcasecmp(ua->argk[i], NT_("client")) == 0 ||
strcasecmp(ua->argk[i], NT_("fd")) == 0) {
if (ua->argv[i]) {
- client = (CLIENT *)GetResWithName(R_CLIENT, ua->argv[i]);
+ client = GetClientResWithName(ua->argv[i]);
continue;
}
}
if (strcasecmp(ua->argk[i], NT_("job")) == 0) {
if (ua->argv[i]) {
- job = (JOB *)GetResWithName(R_JOB, ua->argv[i]);
+ job = GetJobResWithName(ua->argv[i]);
if (job && !acl_access_ok(ua, Job_ACL, job->name())) {
ua->error_msg(_("No authorization for Job \"%s\"\n"), job->name());
return 1;
}
if (strcasecmp(ua->argk[i], NT_("fileset")) == 0) {
if (ua->argv[i]) {
- fileset = (FILESET *)GetResWithName(R_FILESET, ua->argv[i]);
+ fileset = GetFileSetResWithName(ua->argv[i]);
if (fileset && !acl_access_ok(ua, FileSet_ACL, fileset->name())) {
ua->error_msg(_("No authorization for FileSet \"%s\"\n"), fileset->name());
return 1;
}
}
if (!job) {
- job = (JOB *)GetResWithName(R_JOB, ua->argk[1]);
+ job = GetJobResWithName(ua->argk[1]);
if (!job) {
ua->error_msg(_("No job specified.\n"));
return 1;
int memory_cmd(UAContext *ua, const char *cmd)
{
list_dir_status_header(ua);
- sm_dump(false);
+ sm_dump(false, true);
return 1;
}
Dmsg2(120, "%s: %s\n", command, ua->UA_sock->msg);
store.store = get_storage_resource(ua, true/*arg is storage*/);
- pm_strcpy(store.store_source, _("unknown source"));
if (!store.store) {
return;
}
+ pm_strcpy(store.store_source, _("unknown source"));
set_wstorage(jcr, &store);
drive = get_storage_drive(ua, store.store);
if (strcmp(command, "mount") == 0) {
return 1;
}
+#if 1
static int version_cmd(UAContext *ua, const char *cmd)
{
ua->send_msg(_("%s Version: %s (%s) %s %s %s\n"), my_name, VERSION, BDATE,
HOST_OS, DISTNAME, DISTVER);
return 1;
}
+#else
+/*
+ * Test code -- turned on only for debug testing
+ */
+static int version_cmd(UAContext *ua, const char *cmd)
+{
+ dbid_list ids;
+ POOL_MEM query(PM_MESSAGE);
+ open_db(ua);
+ Mmsg(query, "select MediaId from Media,Pool where Pool.PoolId=Media.PoolId and Pool.Name='Full'");
+ db_get_query_dbids(ua->jcr, ua->db, query, ids);
+ ua->send_msg("num_ids=%d max_ids=%d tot_ids=%d\n", ids.num_ids, ids.max_ids, ids.tot_ids);
+ for (int i=0; i < ids.num_ids; i++) {
+ ua->send_msg("id=%d\n", ids.DBId[i]);
+ }
+ close_db(ua);
+ return 1;
+}
+#endif
/*
* This call explicitly checks for a catalog=xxx and
ua->error_msg(_("No authorization for Catalog \"%s\"\n"), ua->argv[i]);
return false;
}
- catalog = (CAT *)GetResWithName(R_CATALOG, ua->argv[i]);
+ catalog = GetCatalogResWithName(ua->argv[i]);
if (catalog) {
if (ua->catalog && ua->catalog != catalog) {
close_db(ua);
ua->error_msg(_("No authorization for Client \"%s\"\n"), ua->argv[i]);
return false;
}
- client = (CLIENT *)GetResWithName(R_CLIENT, ua->argv[i]);
+ client = GetClientResWithName(ua->argv[i]);
if (client) {
catalog = client->catalog;
if (ua->catalog && ua->catalog != catalog) {
ua->error_msg(_("No authorization for Job \"%s\"\n"), ua->argv[i]);
return false;
}
- job = (JOB *)GetResWithName(R_JOB, ua->argv[i]);
+ job = GetJobResWithName(ua->argv[i]);
if (job) {
catalog = job->client->catalog;
if (ua->catalog && ua->catalog != catalog) {