/*
Bacula® - The Network Backup Solution
- Copyright (C) 2001-2007 Free Software Foundation Europe e.V.
+ Copyright (C) 2001-2008 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
static char hello[] = "Hello Director %s calling\n";
/* Response from Storage daemon */
-static char OKhello[] = "3000 OK Hello\n";
-static char FDOKhello[] = "2000 OK Hello\n";
+static char OKhello[] = "3000 OK Hello\n";
+static char FDOKhello[] = "2000 OK Hello\n";
+static char FDOKnewHello[] = "2000 OK Hello %d\n";
/* Sent to User Agent */
static char Dir_sorry[] = "1999 You are not authorized.\n";
if (tls_local_need >= BNET_TLS_OK && tls_remote_need >= BNET_TLS_OK) {
/* Engage TLS! Full Speed Ahead! */
if (!bnet_tls_client(client->tls_ctx, fd, client->tls_allowed_cns)) {
-
stop_bsock_timer(tid);
Jmsg(jcr, M_FATAL, 0, _("TLS negotiation failed with FD at \"%s:%d\".\n"),
fd->host(), fd->port());
fd->host(), fd->port(), fd->bstrerror());
return 0;
}
- Dmsg1(110, "<stored: %s", fd->msg);
+ Dmsg1(110, "<filed: %s", fd->msg);
stop_bsock_timer(tid);
- if (strncmp(fd->msg, FDOKhello, sizeof(FDOKhello)) != 0) {
+ jcr->FDVersion = 0;
+ if (strncmp(fd->msg, FDOKhello, sizeof(FDOKhello)) != 0 &&
+ sscanf(fd->msg, FDOKnewHello, &jcr->FDVersion) != 1) {
Dmsg0(dbglvl, _("File daemon rejected Hello command\n"));
Jmsg(jcr, M_FATAL, 0, _("File daemon at \"%s:%d\" rejected Hello command\n"),
fd->host(), fd->port());
{"filesetacl", store_acl, ITEM(res_con.ACL_lists), FileSet_ACL, 0, 0},
{"catalogacl", store_acl, ITEM(res_con.ACL_lists), Catalog_ACL, 0, 0},
{"whereacl", store_acl, ITEM(res_con.ACL_lists), Where_ACL, 0, 0},
+ {"pluginoptionsacl", store_acl, ITEM(res_con.ACL_lists), PluginOptions_ACL, 0, 0},
{"tlsauthenticate", store_bool, ITEM(res_con.tls_authenticate), 0, 0, 0},
{"tlsenable", store_bool, ITEM(res_con.tls_enable), 0, 0, 0},
{"tlsrequire", store_bool, ITEM(res_con.tls_require), 0, 0, 0},
FileSet_ACL,
Catalog_ACL,
Where_ACL,
+ PluginOptions_ACL,
Num_ACL /* keep last */
};
#include "dird.h"
/* Commands sent to File daemon */
-static char restorecmd[] = "restore replace=%c prelinks=%d where=%s\n";
+static char restorecmd[] = "restore replace=%c prelinks=%d where=%s\n";
static char restorecmdR[] = "restore replace=%c prelinks=%d regexwhere=%s\n";
-static char storaddr[] = "storage address=%s port=%d ssl=0\n";
+static char storaddr[] = "storage address=%s port=%d ssl=0\n";
/* Responses received from File daemon */
static char OKrestore[] = "2000 OK restore\n";
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2004-2007 Free Software Foundation Europe e.V.
+ Copyright (C) 2004-2008 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
add_prompt(ua, _("Replace")); /* 10 */
add_prompt(ua, _("JobId")); /* 11 */
}
+ if (jcr->JobType == JT_BACKUP || jcr->JobType == JT_RESTORE) {
+ add_prompt(ua, _("Plugin Options")); /* 12 */
+ }
switch (do_prompt(ua, "", _("Select parameter to modify"), NULL, 0)) {
case 0:
/* Level */
jcr->JobPriority = ua->pint32_val;
}
goto try_again;
- case 7:
+ case 7:
/* Pool or Bootstrap depending on JobType */
if (jcr->JobType == JT_BACKUP ||
jcr->JobType == JT_COPY ||
ua->send_msg(_("You must set the bootstrap file to NULL to be able to specify a JobId.\n"));
}
goto try_again;
+ case 12:
+ /* Plugin Options */
+ if (!get_cmd(ua, _("Please Plugin Options string: "))) {
+ break;
+ }
+ if (jcr->plugin_options) {
+ free(jcr->plugin_options);
+ jcr->plugin_options = NULL;
+ }
+ jcr->plugin_options = bstrdup(ua->cmd);
+ goto try_again;
case -1: /* error or cancel */
goto bail_out;
default:
rc.where = NULL;
}
-
if (rc.regexwhere) {
if (jcr->RegexWhere) {
free(jcr->RegexWhere);
"Pool: %s (From %s)\n"
"Storage: %s (From %s)\n"
"When: %s\n"
- "Priority: %d\n"),
+ "Priority: %d\n"
+ "%s%s%s"),
_("Backup"),
job->name(),
level_to_str(jcr->JobLevel),
NPRT(jcr->pool->name()), jcr->pool_source,
jcr->wstore?jcr->wstore->name():"*None*", jcr->wstore_source,
bstrutime(dt, sizeof(dt), jcr->sched_time),
- jcr->JobPriority);
+ jcr->JobPriority,
+ jcr->plugin_options?"Plugin Options: ":"",
+ jcr->plugin_options?jcr->plugin_options:"",
+ jcr->plugin_options?"\n":"");
} else { /* JT_VERIFY */
const char *Name;
if (jcr->verify_job) {
"Storage: %s\n"
"When: %s\n"
"Catalog: %s\n"
- "Priority: %d\n"),
+ "Priority: %d\n"
+ "Plugin Options: %s\n"),
job->name(),
NPRT(jcr->RestoreBootstrap),
jcr->RegexWhere?jcr->RegexWhere:job->RegexWhere,
jcr->rstore->name(),
bstrutime(dt, sizeof(dt), jcr->sched_time),
jcr->catalog->name(),
- jcr->JobPriority);
+ jcr->JobPriority,
+ NPRT(jcr->plugin_options));
} else {
ua->send_msg(_("Run Restore job\n"
"Storage: %s\n"
"When: %s\n"
"Catalog: %s\n"
- "Priority: %d\n"),
+ "Priority: %d\n"
+ "Plugin Options: %s\n"),
job->name(),
NPRT(jcr->RestoreBootstrap),
jcr->where?jcr->where:NPRT(job->RestoreWhere),
jcr->rstore->name(),
bstrutime(dt, sizeof(dt), jcr->sched_time),
jcr->catalog->name(),
- jcr->JobPriority);
+ jcr->JobPriority,
+ NPRT(jcr->plugin_options));
}
} else {
jcr->where?jcr->where:NPRT(job->RestoreWhere));
}
- ua->send_msg(_("Replace: %s\n"
- "Client: %s\n"
- "Storage: %s\n"
- "JobId: %s\n"
- "When: %s\n"
- "Catalog: %s\n"
- "Priority: %d\n"),
+ ua->send_msg(_("Replace: %s\n"
+ "Client: %s\n"
+ "Storage: %s\n"
+ "JobId: %s\n"
+ "When: %s\n"
+ "Catalog: %s\n"
+ "Priority: %d\n"
+ "Plugin Options: %s\n"),
replace,
jcr->client->name(),
jcr->rstore->name(),
jcr->RestoreJobId==0?"*None*":edit_uint64(jcr->RestoreJobId, ec1),
bstrutime(dt, sizeof(dt), jcr->sched_time),
jcr->catalog->name(),
- jcr->JobPriority);
+ jcr->JobPriority,
+ NPRT(jcr->plugin_options));
}
break;
case JT_COPY:
"pool", /* 22 */
"backupclient", /* 23 */
"restoreclient", /* 24 */
+ "pluginoptions", /* 25 */
NULL};
#define YES_POS 14
rc.restore_client_name = ua->argv[i];
kw_ok = true;
break;
+ case 25: /* pluginoptions */
+ if (rc.plugin_options) {
+ ua->send_msg(_("Plugin Options specified twice.\n"));
+ return false;
+ }
+ rc.plugin_options = ua->argv[i];
+ if (!acl_access_ok(ua, PluginOptions_ACL, rc.plugin_options)) {
+ ua->send_msg(_("No authoriztion for \"PluginOptions\" specification.\n"));
+ return false;
+ }
+ kw_ok = true;
+ break;
default:
break;
}
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
const int dbglvl = 50;
-static char OK_hello[] = "2000 OK Hello\n";
+/* Version at end of Hello
+ * prior to 10Mar08 no version
+ * 1 10Mar08
+ */
+static char OK_hello[] = "2000 OK Hello 1\n";
static char Dir_sorry[] = "2999 No go\n";
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
int replace; /* Replace option */
int NumVols; /* Number of Volume used in pool */
int reschedule_count; /* Number of times rescheduled */
+ int FDVersion; /* File daemon version number */
int64_t spool_size; /* Spool size for this job */
bool spool_data; /* Spool data in SD */
bool acquired_resource_locks; /* set if resource locks acquired */
Technical notes on version 2.3
General:
+10Mar08
+kes Implement FD version to allow easier protocol changes.
+kes Add Plugin Options string -- not yet passed to FD.
+kes Implement PluginOptions ACL.
09Mar08
kes Attempt to correct problems with restores with autochangers and
use counts going negative