From: Kern Sibbald Date: Wed, 14 Nov 2007 07:31:32 +0000 (+0000) Subject: kes This patch fixes the infinite loop when trying to increase the X-Git-Tag: Release-3.0.0~2253 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f0f667f4273372d311bc8073a6a7b05bef88f176;p=bacula%2Fbacula kes This patch fixes the infinite loop when trying to increase the maximum number of volumes in a Pool during the add command. This patch fixes bug #1008. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5927 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/patches/2.2.6-add.patch b/bacula/patches/2.2.6-add.patch new file mode 100644 index 0000000000..67e53bdcdc --- /dev/null +++ b/bacula/patches/2.2.6-add.patch @@ -0,0 +1,35 @@ + + This patch fixes the infinite loop when trying to increase the + maximum number of volumes in a Pool during the add command. + This patch fixes bug #1008. + + It can be applied to Bacula version 2.2.6 (and probably earlier + 2.2.x versions) with: + + cd + ./configure + patch -p0 <2.2.6-add.patch + make + ... + make install + +Index: src/dird/ua_cmds.c +=================================================================== +--- src/dird/ua_cmds.c (revision 5901) ++++ src/dird/ua_cmds.c (working copy) +@@ -244,12 +244,10 @@ + + while (pr.MaxVols > 0 && pr.NumVols >= pr.MaxVols) { + ua->warning_msg(_("Pool already has maximum volumes=%d\n"), pr.MaxVols); +- for (;;) { +- if (!get_pint(ua, _("Enter new maximum (zero for unlimited): "))) { +- return 1; +- } +- pr.MaxVols = ua->pint32_val; ++ if (!get_pint(ua, _("Enter new maximum (zero for unlimited): "))) { ++ return 1; + } ++ pr.MaxVols = ua->pint32_val; + } + + /* Get media type */ diff --git a/bacula/src/baconfig.h b/bacula/src/baconfig.h index f5b0282da7..c947d31739 100644 --- a/bacula/src/baconfig.h +++ b/bacula/src/baconfig.h @@ -238,6 +238,8 @@ void InitWinAPIWrapper(); #define STREAM_ENCRYPTED_FILE_GZIP_DATA 23 /* Encrypted, compressed data */ #define STREAM_ENCRYPTED_WIN32_GZIP_DATA 24 /* Encrypted, compressed Win32 BackupRead data */ #define STREAM_ENCRYPTED_MACOS_FORK_DATA 25 /* Encrypted, uncompressed Mac resource fork */ +#define STREAM_PLUGIN_NAME 26 /* Plugin "file" string */ +#define STREAM_PLUGIN_DATA 27 /* Plugin specific data */ /* @@ -245,7 +247,7 @@ void InitWinAPIWrapper(); * NOTE!!! These are saved in the Attributes record on the tape, so * do not change them. If need be, add to them. * - * This is stored as 32 bits on tape, but only FT_MASK bits are + * This is stored as 32 bits on the Volume, but only FT_MASK (16) bits are * used for the file type. The upper bits are used to indicate * additional optional fields in the attribute record. */ @@ -274,6 +276,7 @@ void InitWinAPIWrapper(); #define FT_INVALIDFS 19 /* File system not allowed for */ #define FT_INVALIDDT 20 /* Drive type not allowed for */ #define FT_REPARSE 21 /* Win NTFS reparse point */ +#define FT_PLUGIN 22 /* Plugin generated filename */ /* Definitions for upper part of type word (see above). */ #define AR_DATA_STREAM (1<<16) /* Data stream id present */ diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index ed49b1a3ff..98481052e4 100644 --- a/bacula/src/dird/ua_cmds.c +++ b/bacula/src/dird/ua_cmds.c @@ -244,12 +244,10 @@ static int add_cmd(UAContext *ua, const char *cmd) while (pr.MaxVols > 0 && pr.NumVols >= pr.MaxVols) { ua->warning_msg(_("Pool already has maximum volumes=%d\n"), pr.MaxVols); - for (;;) { - if (!get_pint(ua, _("Enter new maximum (zero for unlimited): "))) { - return 1; - } - pr.MaxVols = ua->pint32_val; + if (!get_pint(ua, _("Enter new maximum (zero for unlimited): "))) { + return 1; } + pr.MaxVols = ua->pint32_val; } /* Get media type */ @@ -277,27 +275,30 @@ static int add_cmd(UAContext *ua, const char *cmd) } break; } -getVolName: - if (num == 0) { - if (!get_cmd(ua, _("Enter Volume name: "))) { - return 1; + + for (;;) { + if (num == 0) { + if (!get_cmd(ua, _("Enter Volume name: "))) { + return 1; + } + } else { + if (!get_cmd(ua, _("Enter base volume name: "))) { + return 1; + } } - } else { - if (!get_cmd(ua, _("Enter base volume name: "))) { - return 1; + /* Don't allow | in Volume name because it is the volume separator character */ + if (!is_volume_name_legal(ua, ua->cmd)) { + continue; } - } - /* Don't allow | in Volume name because it is the volume separator character */ - if (!is_volume_name_legal(ua, ua->cmd)) { - goto getVolName; - } - if (strlen(ua->cmd) >= MAX_NAME_LENGTH-10) { - ua->warning_msg(_("Volume name too long.\n")); - goto getVolName; - } - if (strlen(ua->cmd) == 0) { - ua->warning_msg(_("Volume name must be at least one character long.\n")); - goto getVolName; + if (strlen(ua->cmd) >= MAX_NAME_LENGTH-10) { + ua->warning_msg(_("Volume name too long.\n")); + continue; + } + if (strlen(ua->cmd) == 0) { + ua->warning_msg(_("Volume name must be at least one character long.\n")); + continue; + } + break; } bstrncpy(name, ua->cmd, sizeof(name)); diff --git a/bacula/src/findlib/find_one.c b/bacula/src/findlib/find_one.c index 723d45ccf7..704ee9c444 100644 --- a/bacula/src/findlib/find_one.c +++ b/bacula/src/findlib/find_one.c @@ -675,8 +675,8 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, * On FreeBSD, all block devices are character devices, so * to be able to read a raw disk, we need the check for * a character device. -    * crw-r-----  1 root  operator  - 116, 0x00040002 Jun  9 19:32 /dev/ad0s3 -    * crw-r-----  1 root  operator  - 116, 0x00040002 Jun  9 19:32 /dev/rad0s3 + * crw-r----- 1 root operator - 116, 0x00040002 Jun 9 19:32 /dev/ad0s3 + * crw-r----- 1 root operator - 116, 0x00040002 Jun 9 19:32 /dev/rad0s3 */ if (top_level && (S_ISBLK(ff_pkt->statp.st_mode) || S_ISCHR(ff_pkt->statp.st_mode))) { #else diff --git a/bacula/technotes-2.3 b/bacula/technotes-2.3 index 3832586b4c..3ba9dfe87c 100644 --- a/bacula/technotes-2.3 +++ b/bacula/technotes-2.3 @@ -1,6 +1,14 @@ Technical notes on version 2.3 General: +14Nov07 +kes This patch fixes the infinite loop when trying to increase the + maximum number of volumes in a Pool during the add command. + This patch fixes bug #1008. + +Release Version 2.2.6 +09Nov07 +db Remove extra data on estimate command in joblist for bat. 04Nov07 kes Cleanup of code in SD that sets the LastWritten date. This doesn't really change anything, but is the beginning of doing it *right*. @@ -56,6 +64,11 @@ kes Add a #define __CONFIG_H when including config.h in bacula.h. This 12Oct07 kes Fix spurious warning message printed when creating a volume with a LabelFormat. This fixes bug #976. + +Release Version 2.2.5 +09Oct07 +kes Add JobId in place of Job name in all the Jmsg() output. +kes Correct the APP_DESC for the Win32 storage service (remove an e). 07Oct07 kes Make maxvol-test and new more strict maxvol2-test work. kes Print JobId in all Jmsg() job output.