and possibly manipulating the autochanger (much asked for).
- Make "update slots" when pointing to Autochanger, remove
all Volumes from other drives. "update slots all-drives"?
+
+Idea:
+- Use non-blocking network I/O but if no data is available, use
+ select().
+- Use gather write() for network I/O.
For 1.37:
+- If drive is opened read/write, close it and re-open
+ read-only if doing a restore, and vice-versa.
- Fix FD JobType to be set before RunBeforeJob in FD.
- SD crashes after a tape restore then doing a backup.
- Look at dird_conf.c:1000: warning: `int size'
int ch, i, item;
bool no_signals = false;
bool test_config = false;
- char buf[1024];
JCR jcr;
init_stack_dump();
senditf(_("Connecting to Director %s:%d\n"), dir->address,dir->DIRport);
#ifdef HAVE_TLS
+ char buf[1024];
/* Initialize Console TLS context */
if (cons && (cons->tls_enable || cons->tls_require)) {
/* Generate passphrase prompt */
* Keyfile PEM Callback, Keyfile CB Userdata, DHfile, Verify Peer */
cons->tls_ctx = new_tls_context(cons->tls_ca_certfile,
cons->tls_ca_certdir, cons->tls_certfile,
- cons->tls_keyfile, tls_pem_callback, &buf, NULL, true);
+ cons->tls_keyfile, tls_pem_callback, &buf, NULL, true);
if (!cons->tls_ctx) {
- senditf(_("Failed to initialize TLS context for Console \"%s\".\n"),
- dir->hdr.name);
- terminate_console(0);
- return 1;
+ senditf(_("Failed to initialize TLS context for Console \"%s\".\n"),
+ dir->hdr.name);
+ terminate_console(0);
+ return 1;
}
}
* Keyfile PEM Callback, Keyfile CB Userdata, DHfile, Verify Peer */
dir->tls_ctx = new_tls_context(dir->tls_ca_certfile,
dir->tls_ca_certdir, dir->tls_certfile,
- dir->tls_keyfile, tls_pem_callback, &buf, NULL, true);
+ dir->tls_keyfile, tls_pem_callback, &buf, NULL, true);
if (!dir->tls_ctx) {
- senditf(_("Failed to initialize TLS context for Director \"%s\".\n"),
- dir->hdr.name);
- terminate_console(0);
- return 1;
+ senditf(_("Failed to initialize TLS context for Director \"%s\".\n"),
+ dir->hdr.name);
+ terminate_console(0);
+ return 1;
}
}
#endif /* HAVE_TLS */
static int check_resources()
{
bool OK = true;
- CONRES *cons;
DIRRES *director;
LockRes();
#ifdef HAVE_TLS
/* tls_require implies tls_enable */
if (director->tls_require) {
- director->tls_enable = true;
+ director->tls_enable = true;
}
if ((!director->tls_ca_certfile && !director->tls_ca_certdir) && director->tls_enable) {
- Emsg2(M_FATAL, 0, _("Neither \"TLS CA Certificate\""
- " or \"TLS CA Certificate Dir\" are defined for Director \"%s\" in %s."
- " At least one CA certificate store is required.\n"),
- director->hdr.name, configfile);
- OK = false;
+ Emsg2(M_FATAL, 0, _("Neither \"TLS CA Certificate\""
+ " or \"TLS CA Certificate Dir\" are defined for Director \"%s\" in %s."
+ " At least one CA certificate store is required.\n"),
+ director->hdr.name, configfile);
+ OK = false;
}
#endif /* HAVE_TLS */
}
if (numdir == 0) {
Emsg1(M_FATAL, 0, _("No Director resource defined in %s\n"
- "Without that I don't how to speak to the Director :-(\n"), configfile);
+ "Without that I don't how to speak to the Director :-(\n"), configfile);
OK = false;
}
#ifdef HAVE_TLS
+ CONRES *cons;
/* Loop over Consoles */
foreach_res(cons, R_CONSOLE) {
/* tls_require implies tls_enable */
if (cons->tls_require) {
- cons->tls_enable = true;
+ cons->tls_enable = true;
}
if ((!cons->tls_ca_certfile && !cons->tls_ca_certdir) && cons->tls_enable) {
- Emsg2(M_FATAL, 0, _("Neither \"TLS CA Certificate\""
- " or \"TLS CA Certificate Dir\" are defined for Console \"%s\" in %s.\n"),
- cons->hdr.name, configfile);
- OK = false;
+ Emsg2(M_FATAL, 0, _("Neither \"TLS CA Certificate\""
+ " or \"TLS CA Certificate Dir\" are defined for Console \"%s\" in %s.\n"),
+ cons->hdr.name, configfile);
+ OK = false;
}
}
#endif /* HAVE_TLS */
* tools (e.g. bls, bextract, bscan, ...)
*/
JCR *setup_jcr(const char *name, char *dev_name, BSR *bsr,
- const char *VolumeName, int mode)
+ const char *VolumeName, int mode)
{
DCR *dcr;
JCR *jcr = new_jcr(sizeof(JCR), my_free_jcr);
* If the caller wants read access, acquire the device, otherwise,
* the caller will do it.
*/
-static DCR *setup_to_access_device(JCR *jcr, char *dev_name, const char *VolumeName, int mode)
+static DCR *setup_to_access_device(JCR *jcr, char *dev_name,
+ const char *VolumeName, int mode)
{
DEVICE *dev;
char *p;
}
if (!jcr->bsr && VolName[0] == 0) {
if (strncmp(dev_name, "/dev/", 5) != 0) {
- /* Try stripping file part */
- p = dev_name + strlen(dev_name);
+ /* Try stripping file part */
+ p = dev_name + strlen(dev_name);
while (p >= dev_name && *p != '/')
- p--;
+ p--;
if (*p == '/') {
- bstrncpy(VolName, p+1, sizeof(VolName));
- *p = 0;
- }
+ bstrncpy(VolName, p+1, sizeof(VolName));
+ *p = 0;
+ }
}
}
if ((device=find_device_res(dev_name, mode)) == NULL) {
Jmsg2(jcr, M_FATAL, 0, _("Cannot find device \"%s\" in config file %s.\n"),
- dev_name, configfile);
+ dev_name, configfile);
return NULL;
}
bstrncpy(dcr->VolumeName, VolName, sizeof(dcr->VolumeName));
}
bstrncpy(dcr->dev_name, device->device_name, sizeof(dcr->dev_name));
- if (!first_open_device(dev)) {
- Jmsg1(jcr, M_FATAL, 0, _("Cannot open %s\n"), dcr->dev_name);
- return NULL;
- }
- Dmsg0(90, "Device opened for read.\n");
create_vol_list(jcr);
- if (mode) { /* read only access? */
+ if (mode) { /* read only access? */
if (!acquire_device_for_read(dcr)) {
- return NULL;
+ return NULL;
+ }
+ } else {
+ if (!first_open_device(dev)) {
+ Jmsg1(jcr, M_FATAL, 0, _("Cannot open %s\n"), dcr->dev_name);
+ return NULL;
}
}
return dcr;
* device name on command line (or default).
*
* Returns: NULL on failure
- * Device resource pointer on success
+ * Device resource pointer on success
*/
static DEVRES *find_device_res(char *device_name, int read_access)
{
LockRes();
foreach_res(device, R_DEVICE) {
if (strcmp(device->device_name, device_name) == 0) {
- found = true;
- break;
+ found = true;
+ break;
}
}
if (!found) {
/* Search for name of Device resource rather than archive name */
if (device_name[0] == '"') {
- int len = strlen(device_name);
- bstrncpy(device_name, device_name+1, len+1);
- len--;
- if (len > 0) {
+ int len = strlen(device_name);
+ bstrncpy(device_name, device_name+1, len+1);
+ len--;
+ if (len > 0) {
device_name[len-1] = 0; /* zap trailing " */
- }
+ }
}
foreach_res(device, R_DEVICE) {
- if (strcmp(device->hdr.name, device_name) == 0) {
- found = true;
- break;
- }
+ if (strcmp(device->hdr.name, device_name) == 0) {
+ found = true;
+ break;
+ }
}
}
UnlockRes();
if (!found) {
Pmsg2(0, _("Could not find device \"%s\" in config file %s.\n"), device_name,
- configfile);
+ configfile);
return NULL;
}
Pmsg2(0, _("Using device: \"%s\" for %s.\n"), device_name,
if (open_dev(dev, dev->VolCatInfo.VolCatName, dev->openmode) < 0) {
return -1;
- } else {
- dev->state = state;
- return dev->fd;
- }
+ }
+ dev->state = state;
+ return dev->fd;
}
/* Open the first part file.
dev->part_start = 0;
dev->part = 0;
- if (open_dev(dev, dev->VolCatInfo.VolCatName, dev->openmode)) {
- dev->state = state;
- return dev->fd;
- } else {
- return 0;
+ if (open_dev(dev, dev->VolCatInfo.VolCatName, dev->openmode) < 0) {
+ return -1;
}
+ dev->state = state;
+ return dev->fd;
}
MONITOR_CPPFLAGS=@TRAY_MONITOR_CPPFLAGS@
MONITOR_LDFLAGS=@TRAY_MONITOR_LDFLAGS@ @X_LIBS@ -lX11
+OPENSSL_INC = @OPENSSL_INC@
+OPENSSL_LIBS = @OPENSSL_LIBS@
+
.SUFFIXES: .c .o
.PHONY:
.DONTCARE:
# inference rules
.c.o:
- $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(MONITOR_CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
+ $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(MONITOR_CPPFLAGS) \
+ $(OPENSSL_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
#-------------------------------------------------------------------------
all: Makefile bacula-tray-monitor @STATIC_CONS@
@echo "==== Make of bacula-tray-monitor is good ===="
@echo " "
bacula-tray-monitor: $(MONITOROBJS) ../lib/libbac.a
- $(CXX) $(LDFLAGS) $(MONITOR_LDFLAGS) -L../lib -L../cats -o $@ $(MONITOROBJS) \
- $(DLIB) -lbac -lm $(LIBS)
+ $(CXX) $(LDFLAGS) $(MONITOR_LDFLAGS) -L../lib -L../cats -o $@ \
+ $(MONITOROBJS) $(DLIB) $(OPENSSL_LIBS) -lbac -lm $(LIBS)
Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
/* */
#undef VERSION
#define VERSION "1.37.14"
-#define BDATE "21 April 2005"
-#define LSMDATE "21Apr05"
+#define BDATE "22 April 2005"
+#define LSMDATE "22Apr05"
/* Debug flags */
#undef DEBUG
# wx-config generated by configure
CONS_CPPFLAGS=-DHAVE_WXCONSOLE @WXCONS_CPPFLAGS@ $(@MACOSX@_cppflags)
CONS_LDFLAGS=@WXCONS_LDFLAGS@
+OPENSSL_INC = @OPENSSL_INC@
+OPENSSL_LIBS = @OPENSSL_LIBS@
+
.SUFFIXES: .cpp .c .o
.PHONY:
# inference rules
.c.o:
- $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(CONS_CPPFLAGS) $(CONS_INC) -I$(srcdir) \
- -I$(basedir) $(DINCLUDE) $(WCFLAGS) $(CFLAGS) $<
+ $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(CONS_CPPFLAGS) $(CONS_INC) \
+ $(OPENSSL_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(WCFLAGS) $(CFLAGS) $<
.cpp.o:
- $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(CONS_CPPFLAGS) $(CONS_INC) -I$(srcdir) \
- -I$(basedir) $(DINCLUDE) $(WCFLAGS) $(CFLAGS) $<
+ $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(CONS_CPPFLAGS) $(CONS_INC) \
+ $(OPENSSL_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(WCFLAGS) $(CFLAGS) $<
#-------------------------------------------------------------------------
cp wx-console.conf /Library/Preferences/org.bacula.wxconsole.conf
wx-console: $(CONSOBJS) @WIN32@ ../lib/libbac.a
- $(CXX) $(CONSOBJS) $(WIN32RES) -o $@ $(LIBS) -L../lib $(CONS_LDFLAGS) -lbac
+ $(CXX) $(CONSOBJS) $(WIN32RES) -o $@ $(LIBS) -L../lib $(CONS_LDFLAGS) \
+ $(OPENSSL_LIBS) -lbac
win32: wx-console_private.res