-2003-10-26 Version 1.32c 26Oct03
+2003-10-29 Version 1.32c 29Oct03
+29Oct03
+- Add code to ensure that fds 0,1, and 2 are defined by dup'ing them
+ to /dev/null if necessary. Mostly for Windows that does not have them.
+- Error check dir_create_jobmedia_record() 2 places in acquire.c
26Oct03
- More doc fixes.
- Make message buffer longer for a status message that was
- Add an item to the FAQ about running jobs in different timezones.
For 1.32c
+- Add Volume name to "I cannot write on this volume because"
For 1.33
+- Write your PID file and chwon root:wheel before drop.
+- Make sure there is no symlink in a file before creating a
+ file (attack).
+- Look at mktemp or mkstemp(3).
+ mktemp and mkstemp create files with predictable names too. That's
+ not the vulnerability. The vulnerability is in creating files without
+ using the O_EXCL flag, which means "only create this file if it doesn't
+ exist, including if the file is a dangling symlink."
+
+ It is *NOT* enough to do the equivalent of
+
+ if doesn't exist $filename
+ then create $filename
+
+ because between the test and the create another process could have
+ gotten the CPU and created the file. You must use atomic functions
+ (those that don't get interrupted by other processes) and O_EXCL is
+ the only way for this particular example.
+- Keep last 5 or 10 completed jobs and show them in a similar
+ list.
+- Make a Running Jobs: output similar to current Scheduled Jobs:
+- Use ioctl() fsf if it exists. Figure out where we are from
+ the mt_status command. Use slow fsf only if other does
+ not work.
+- Add flag to write only one EOF mark on the tape.
+- Mount a tape that is not right for the job (wrong # files on tape)
+ Bacula asks for another tape, fix problems with first tape and
+ say "mount". All works OK, but status shows:
+ Device /dev/nst0 open but no Bacula volume is mounted.
+ Total Bytes=1,153,820,213 Blocks=17,888 Bytes/block=64,502
+ Positioned at File=9 Block=3,951
+ Full Backup job Rufus.2003-10-26_16.45.31 using Volume "DLT-24Oct03" on device /dev/nst0
+ Files=21,003 Bytes=253,954,408 Bytes/sec=2,919,016
+ FDReadSeqNo=192,134 in_msg=129830 out_msg=5 fd=7
- Automatically create pools, but instead of looking for what
in in Job records, walk through the pool resources.
- Check and double check tree code, why does it take so long?
VolCount = db_get_job_volume_parameters(jcr, jcr->db, jcr->JobId,
&VolParams);
if (VolCount == 0) {
- Jmsg(jcr, M_ERROR, 0, _("Could not get Job Volume Parameters. ERR=%s\n"),
- db_strerror(jcr->db));
+ Jmsg(jcr, M_ERROR, 0, _("Could not get Job Volume Parameters to "
+ "update Bootstrap file. ERR=%s\n"), db_strerror(jcr->db));
+ if (jcr->SDJobFiles != 0) {
+ set_jcr_job_status(jcr, JS_ErrorTerminated);
+ }
+
}
for (int i=0; i < VolCount; i++) {
/* Write the record */
#
# WARNING! the following will create a file that you must cycle from
# time to time as it will grow indefinitely. However, it will
-# also keep all your messages if the scroll off the console.
+# also keep all your messages if they scroll off the console.
#
append = "@working_dir@/log" = all, !skipped
}
while ((ch = getopt(argc, argv, "c:d:fg:istu:v?")) != -1) {
switch (ch) {
- case 'c': /* configuration file */
- if (configfile != NULL) {
- free(configfile);
- }
- configfile = bstrdup(optarg);
- break;
-
- case 'd': /* debug level */
- debug_level = atoi(optarg);
- if (debug_level <= 0) {
- debug_level = 1;
- }
- break;
-
- case 'f': /* run in foreground */
- foreground = TRUE;
- break;
-
- case 'g': /* set group */
- gid = optarg;
- break;
-
- case 'i':
- inetd_request = TRUE;
- break;
- case 's':
- no_signals = TRUE;
- break;
-
- case 't':
- test_config = TRUE;
- break;
-
- case 'u': /* set userid */
- uid = optarg;
- break;
-
- case 'v': /* verbose */
- verbose++;
- break;
-
- case '?':
- default:
- usage();
+ case 'c': /* configuration file */
+ if (configfile != NULL) {
+ free(configfile);
+ }
+ configfile = bstrdup(optarg);
+ break;
+
+ case 'd': /* debug level */
+ debug_level = atoi(optarg);
+ if (debug_level <= 0) {
+ debug_level = 1;
+ }
+ break;
+
+ case 'f': /* run in foreground */
+ foreground = TRUE;
+ break;
+
+ case 'g': /* set group */
+ gid = optarg;
+ break;
+
+ case 'i':
+ inetd_request = TRUE;
+ break;
+ case 's':
+ no_signals = TRUE;
+ break;
+
+ case 't':
+ test_config = TRUE;
+ break;
+
+ case 'u': /* set userid */
+ uid = optarg;
+ break;
+
+ case 'v': /* verbose */
+ verbose++;
+ break;
+
+ case '?':
+ default:
+ usage();
}
}
This is the binary distribution of Bacula for Win32
-systems (Win95, Win98, WinMe, WinNT, and Win2000).
+systems (Win95, Win98, WinMe, WinXP, WinNT, and Win2000).
INSTALLATION
file into your root directory on drive c:\ then follow
the instructions in the online manual viewable by any
Internet Browser (Netscape, Microsoft Internet Explorer).
-See http://www.bacula.net/htm-manual
+See http://www.bacula.org/rel-manual/index.html
or get the source release
Bacula (tm) is released under the GPL license (given below).
MA 02111-1307, USA.
*/
-
if (sscanf(mp_chr(bs->msg), "auth cram-md5 %s ssl=%d\n", chal, &ssl_has) != 2) {
ssl_has = BNET_SSL_NONE;
if (sscanf(mp_chr(bs->msg), "auth cram-md5 %s\n", chal) != 1) {
+ bnet_fsend(bs, "1999 Authorization failed.\n");
Dmsg1(100, "Cannot scan challenge: %s\n", bs->msg);
bmicrosleep(5, 0);
return 0;
setsid();
/* In the PRODUCTION system, we close ALL
- * file descriptors. It is useful
- * for debugging to leave the STDOUT ane STDERR open.
+ * file descriptors except stdin, stdout, and stderr.
*/
- for (i=sysconf(_SC_OPEN_MAX)-1; i >=0; i--) {
-#ifdef DEBUG
- if (i != STDOUT_FILENO && i != STDERR_FILENO) {
- close(i);
- }
-#else
+ for (i=sysconf(_SC_OPEN_MAX)-1; i >= 3; i--) {
close(i);
-#endif
}
/* Move to root directory. For debug we stay
init_msg(JCR *jcr, MSGS *msg)
{
DEST *d, *dnew, *temp_chain = NULL;
+ int i, fd;
+
+ /*
+ * Make sure we have fd's 0, 1, 2 open
+ * If we don't do this one of our sockets may open
+ * there and if we then use stdout, it could
+ * send total garbage to our socket.
+ *
+ */
+ fd = open("/dev/null", O_RDONLY, 0644);
+ if (fd > 2) {
+ close(fd);
+ } else {
+ for(i=1; fd + i <= 2; i++) {
+ dup2(fd, fd+i);
+ }
+ }
+
/*
* If msg is NULL, initialize global chain for STDOUT and syslog
*/
if (msg == NULL) {
- int i;
daemon_msgs = (MSGS *)malloc(sizeof(MSGS));
memset(daemon_msgs, 0, sizeof(MSGS));
for (i=1; i<=M_MAX; i++) {
/* If we are the only writer, write EOF after job */
if (dev->state & ST_LABEL) {
Dmsg0(100, "dir_create_jobmedia_record. Release\n");
- dir_create_jobmedia_record(jcr);
+ if (!dir_create_jobmedia_record(jcr)) {
+ Jmsg(jcr, M_ERROR, 0, _("Could not create JobMedia record for Volume=\"%s\" Job=%s\n"),
+ jcr->VolCatInfo.VolCatName, jcr->Job);
+ }
if (dev_can_write(dev)) {
weof_dev(dev, 1);
}
}
} else if (dev->state & ST_LABEL) {
Dmsg0(100, "dir_create_jobmedia_record. Release\n");
- dir_create_jobmedia_record(jcr);
+ if (!dir_create_jobmedia_record(jcr)) {
+ Jmsg(jcr, M_ERROR, 0, _("Could not create JobMedia record for Volume=\"%s\" Job=%s\n"),
+ jcr->VolCatInfo.VolCatName, jcr->Job);
+ }
Dmsg0(200, "dir_update_vol_info. Release1\n");
dev->VolCatInfo.VolCatFiles = dev->file; /* set number of files */
dev->VolCatInfo.VolCatJobs++; /* increment number of jobs */
dir_update_volume_info(jcr, &dev->VolCatInfo, 0); /* send Volume info to Director */
}
} else {
- Jmsg2(jcr, M_ERROR, 0, _("BAD ERROR: release_device %s, Volume %s not in use.\n"),
+ Jmsg2(jcr, M_ERROR, 0, _("BAD ERROR: release_device %s, Volume \"%s\" not in use.\n"),
dev_name(dev), NPRT(jcr->VolumeName));
}
detach_jcr_from_device(dev, jcr);
#undef VERSION
#define VERSION "1.32c"
#define VSTRING "1"
-#define BDATE "26 Oct 2003"
-#define LSMDATE "26Oct03"
+#define BDATE "29 Oct 2003"
+#define LSMDATE "20Oct03"
/* Debug flags */
#undef DEBUG