Fixes bug #600. Patch supplied by user.
- Remove -t option from mktemp in mtx_changer.in and use
working directory. Fixes bug #578.
- Update job start time after the any run before job so that
files created by the script are only backed up once. Fixes
bug #599.
- Strip trailing newline only from filenames entered in
the restore command when reading a file. This permits
the user to enter filenames with trailing spaces. Fixes
bug #549. The user supplied a patch that I modified slightly.
- Use the most recent time (st_mtime, st_ctime) in the dir
command in restore. This gives the user a better idea of what
the newest file really is. This fixes bug #574. The fix
was suggested by the user.
- Implement a compatible version of base64. This permits external
programs to duplicate Bacula's base64 algorithm using standard
routines. This fixes bugs #296, and 565. Patch submitted by
author of bug #565.
================= Note ========================
Previous Signatures stored in the database are no longer
compatible with this. The main downside is for Verify jobs,
and doing an InitCatalog run will fix the problem. Also, the
authentication between the deamons is changed, so all daemons
must be simultaneously upgraded.
==============================================
If you don't like this fix, set:
const bool compatible = true;
to
const bool compatible = false;
in src/lib/base64.c
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2952
91ce42f0-d328-0410-95d8-
f526ca767f89
AC_MSG_ERROR("You can configure for only one database.");
fi
if test "$withval" = "yes"; then
- if test -f /usr/local/include/libpq-fe.h; then
+ PG_CONFIG=`which pg_config`
+ if test -n "$PG_CONFIG";then
+ POSTGRESQL_INCDIR=`"$PG_CONFIG" --includedir`
+ POSTGRESQL_LIBDIR=`"$PG_CONFIG" --libdir`
+ POSTGRESQL_BINDIR=`"$PG_CONFIG" --bindir`
+ elif test -f /usr/local/include/libpq-fe.h; then
POSTGRESQL_INCDIR=/usr/local/include
POSTGRESQL_LIBDIR=/usr/local/lib
POSTGRESQL_BINDIR=/usr/local/bin
Kern Sibbald
General:
+21Apr06
+- Implement using pg_config for finding PostgreSQL files.
+ Fixes bug #600. Patch supplied by user.
+- Remove -t option from mktemp in mtx_changer.in and use
+ working directory. Fixes bug #578.
+- Update job start time after the any run before job so that
+ files created by the script are only backed up once. Fixes
+ bug #599.
+- Strip trailing newline only from filenames entered in
+ the restore command when reading a file. This permits
+ the user to enter filenames with trailing spaces. Fixes
+ bug #549. The user supplied a patch that I modified slightly.
+- Use the most recent time (st_mtime, st_ctime) in the dir
+ command in restore. This gives the user a better idea of what
+ the newest file really is. This fixes bug #574. The fix
+ was suggested by the user.
+- Implement a compatible version of base64. This permits external
+ programs to duplicate Bacula's base64 algorithm using standard
+ routines. This fixes bugs #296, and 565. Patch submitted by
+ author of bug #565.
+ ================= Note ========================
+ Previous Signatures stored in the database are no longer
+ compatible with this. The main downside is for Verify jobs,
+ and doing an InitCatalog run will fix the problem. Also, the
+ authentication between the deamons is changed, so all daemons
+ must be simultaneously upgraded.
+ ==============================================
+ If you don't like this fix, set:
+ const bool compatible = true;
+ to
+ const bool compatible = false;
+ in src/lib/base64.c
20Apr06
- Ensure that DB signature is never NULL.
- Ensure that DB table names are not translated.
# Create a temporary file
#
make_temp_file() {
- TMPFILE=`mktemp -t mtx.XXXXXXXXXX`
+ TMPFILE=`mktemp @working_dir@/mtx.XXXXXXXXXX`
if test x${TMPFILE} = x; then
TMPFILE="@working_dir@/mtx.$$"
if test -f ${TMPFILE}; then
goto bail_out;
}
}
-
+ /*
+ * We re-update the job start record so that the start
+ * time is set after the run before job. This avoids
+ * that any files created by the run before job will
+ * be saved twice. They will be backed up in the current
+ * job, but not in the next one unless they are changed.
+ * Without this, they will be backed up in this job and
+ * in the next job run because in that case, their date
+ * is after the start of this run.
+ */
+ if (!db_update_job_start_record(jcr, jcr->db, &jcr->jr)) {
+ Jmsg(jcr, M_FATAL, 0, "%s", db_strerror(jcr->db));
+ }
generate_job_event(jcr, "JobRun");
switch (jcr->JobType) {
{
char ed1[50];
- strip_trailing_junk(file);
+ strip_trailing_newline(file);
split_path_and_filename(rx, file);
if (*rx->JobIds == 0) {
Mmsg(rx->query, uar_jobid_fileindex, date, rx->path, rx->fname,
char ec1[30];
char en1[30], en2[30];
int n;
+ time_t time;
p = encode_mode(statp->st_mode, buf);
if (dot_cmd) {
p += n;
n = sprintf(p, "%10.10s ", edit_uint64(statp->st_size, ec1));
p += n;
- p = encode_time(statp->st_ctime, p);
+ if (statp->st_ctime > statp->st_mtime) {
+ time = statp->st_ctime;
+ } else {
+ time = statp->st_mtime;
+ }
+ /* Display most recent time */
+ p = encode_time(time, p);
*p++ = ' ';
*p++ = *tag;
}
}
for ( ; !done; ) {
- bsendmsg(ua, _("Updating Volume \"%s\"\n"), mr.VolumeName);
start_prompt(ua, _("Parameters to modify:\n"));
- add_prompt(ua, _("Volume Status"));
- add_prompt(ua, _("Volume Retention Period"));
- add_prompt(ua, _("Volume Use Duration"));
- add_prompt(ua, _("Maximum Volume Jobs"));
- add_prompt(ua, _("Maximum Volume Files"));
- add_prompt(ua, _("Maximum Volume Bytes"));
- add_prompt(ua, _("Recycle Flag"));
- add_prompt(ua, _("Slot"));
- add_prompt(ua, _("InChanger Flag"));
- add_prompt(ua, _("Volume Files"));
- add_prompt(ua, _("Pool"));
- add_prompt(ua, _("Volume from Pool"));
- add_prompt(ua, _("All Volumes from Pool"));
- add_prompt(ua, _("Done"));
+ add_prompt(ua, _("Volume Status")); /* 0 */
+ add_prompt(ua, _("Volume Retention Period")); /* 1 */
+ add_prompt(ua, _("Volume Use Duration")); /* 2 */
+ add_prompt(ua, _("Maximum Volume Jobs")); /* 3 */
+ add_prompt(ua, _("Maximum Volume Files")); /* 4 */
+ add_prompt(ua, _("Maximum Volume Bytes")); /* 5 */
+ add_prompt(ua, _("Recycle Flag")); /* 6 */
+ add_prompt(ua, _("Slot")); /* 7 */
+ add_prompt(ua, _("InChanger Flag")); /* 8 */
+ add_prompt(ua, _("Volume Files")); /* 9 */
+ add_prompt(ua, _("Pool")); /* 10 */
+ add_prompt(ua, _("Volume from Pool")); /* 11 */
+ add_prompt(ua, _("All Volumes from Pool")); /* 12 */
+ add_prompt(ua, _("Done")); /* 13 */
i = do_prompt(ua, "", _("Select parameter to modify"), NULL, 0);
+
/* For All Volumes from Pool we don't need a Volume record */
- if (i != 12) {
+ if (i != 12 && i != 13) {
if (!select_media_dbr(ua, &mr)) { /* Get Volume record */
return 0;
}
+ bsendmsg(ua, _("Updating Volume \"%s\"\n"), mr.VolumeName);
}
switch (i) {
case 0: /* Volume Status */
* Version $Id$
*/
/*
- Copyright (C) 2000-2005 Kern Sibbald
+ Copyright (C) 2000-2006 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
#include "bacula.h"
+const bool compatible = true;
+
#ifdef TEST_MODE
#include <glob.h>
#endif
for (i=0; i<len; ) {
if (rem < 6) {
reg <<= 8;
- reg |= (int8_t)bin[i++];
+ if (compatible) {
+ reg |= (int8_t)bin[i++] & 0xFF;
+ } else {
+ reg |= (int8_t)bin[i++];
+ }
rem += 8;
}
save = reg;
for (i=1; i<rem; i++) {
mask = (mask << 1) | 1;
}
- buf[j++] = base64_digits[reg & mask];
+ if (compatible) {
+ buf[j++] = base64_digits[(reg & mask) << 6 - rem];
+ } else {
+ buf[j++] = base64_digits[reg & mask];
+ }
}
buf[j] = 0;
return j;
* Version $Id$
*/
/*
- Copyright (C) 2000-2005 Kern Sibbald
+ Copyright (C) 2000-2006 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
#ifdef MD5_SUM
#define OUTPUT_BASE64 1
+
+static void usage()
+{
+ fprintf(stderr,
+"\n"
+"Usage: md5sum [-d decode] <data-file>\n"
+" -d decode the data file\n"
+" -? print this message.\n"
+"\n\n");
+
+ exit(1);
+}
+
+static bool decode = false;
+
/*
* Reads a single ASCII file and prints the HEX md5 sum.
*/
MD5Context ctx;
char buf[5000];
char signature[20];
+ int ch;
+
+ while ((ch = getopt(argc, argv, "d?")) != -1) {
+ switch (ch) {
+ case 'd':
+ decode = true;
+ break;
+ case '?':
+ default:
+ usage();
+ }
+ }
+
+ argc -= optind;
+ argv += optind;
if (argc < 1) {
printf("Must have filename\n");
exit(1);
}
- fd = fopen(argv[1], "r");
+
+ fd = fopen(argv[0], "r");
if (!fd) {
- printf("Could not open %s: ERR=%s\n", argv[1], strerror(errno));
+ printf("Could not open %s: ERR=%s\n", argv[0], strerror(errno));
exit(1);
}
+ if (decode) {
+ goto decode_it;
+ }
MD5Init(&ctx);
while (fgets(buf, sizeof(buf), fd)) {
MD5Update(&ctx, (unsigned char *)buf, strlen(buf));
bin_to_base64(MD5buf, (char *)signature, 16); /* encode 16 bytes */
printf(" %s", MD5buf);
#endif
- printf(" %s\n", argv[1]);
+ printf(" %s\n", argv[0]);
+ exit(0);
+
+decode_it:
+ while (fgets(buf, sizeof(buf), fd)) {
+ char bin[40];
+ unsigned char *p = (unsigned char *)buf;
+ unsigned char ch;
+ int val;
+ for (int i=0; i < 16; i++) {
+ if (*p <= '9') {
+ val = *p - '0';
+ } else {
+ val = *p - 'a' + 10;
+ }
+ ch = val << 4;
+ p++;
+ if (*p <= '9') {
+ val = *p - '0';
+ } else {
+ val = *p - 'a' + 10;
+ }
+ signature[i] = ch + val;
+ p++;
+ }
+ signature[16] = 0;
+ printf("%s", buf);
+ bin_to_base64(bin, (char *)signature, 16);
+ printf("%s\n", bin);
+ }
}
#endif
#undef VERSION
#define VERSION "1.39.9"
-#define BDATE "20 April 2006"
-#define LSMDATE "20Apr06"
+#define BDATE "21 April 2006"
+#define LSMDATE "21Apr06"
/* Debug flags */
#undef DEBUG