From: Kern Sibbald Date: Mon, 19 Feb 2007 18:00:26 +0000 (+0000) Subject: kes Restore of sockets created false error messages because Bacula X-Git-Tag: Release-2.0.3~31 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=07fde355e658f850aa56a608e687eb62768d8a90;p=bacula%2Fbacula kes Restore of sockets created false error messages because Bacula no longer restores sockets, but the code was still trying to set the attributes on a non-existent file. Reported by a user. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.0@4213 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/findlib/attribs.c b/bacula/src/findlib/attribs.c index 4e1122afe5..d747543e18 100755 --- a/bacula/src/findlib/attribs.c +++ b/bacula/src/findlib/attribs.c @@ -1,17 +1,7 @@ -/* - * Encode and decode standard Unix attributes and - * Extended attributes for Win32 and - * other non-Unix systems, or Unix systems with ACLs, ... - * - * Kern Sibbald, October MMII - * - * Version $Id$ - * - */ /* Bacula® - The Network Backup Solution - Copyright (C) 2002-2006 Free Software Foundation Europe e.V. + Copyright (C) 2002-2007 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. @@ -35,6 +25,16 @@ (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich, Switzerland, email:ftf@fsfeurope.org. */ +/* + * Encode and decode standard Unix attributes and + * Extended attributes for Win32 and + * other non-Unix systems, or Unix systems with ACLs, ... + * + * Kern Sibbald, October MMII + * + * Version $Id$ + * + */ #include "bacula.h" #include "find.h" @@ -410,6 +410,14 @@ bool set_attributes(JCR *jcr, ATTR *attr, BFILE *ofd) } } + /* + * We do not restore sockets, so skip trying to restore their + * attributes. + */ + if (attr->type == FT_SPEC && S_ISSOCK(attr->statp.st_mode)) { + goto bail_out; + } + ut.actime = attr->statp.st_atime; ut.modtime = attr->statp.st_mtime; @@ -465,6 +473,8 @@ bool set_attributes(JCR *jcr, ATTR *attr, BFILE *ofd) } #endif } + +bail_out: pm_strcpy(attr->ofname, "*none*"); umask(old_mask); return ok; diff --git a/bacula/src/findlib/create_file.c b/bacula/src/findlib/create_file.c index 3d08fdcc84..0cbf644fda 100644 --- a/bacula/src/findlib/create_file.c +++ b/bacula/src/findlib/create_file.c @@ -1,15 +1,7 @@ -/* - * Create a file, and reset the modes - * - * Kern Sibbald, November MM - * - * Version $Id$ - * - */ /* Bacula® - The Network Backup Solution - Copyright (C) 2000-2006 Free Software Foundation Europe e.V. + Copyright (C) 2000-2007 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. @@ -33,6 +25,14 @@ (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich, Switzerland, email:ftf@fsfeurope.org. */ +/* + * Create a file, and reset the modes + * + * Kern Sibbald, November MM + * + * Version $Id$ + * + */ #include "bacula.h" #include "find.h" @@ -235,7 +235,7 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) attr->ofname, be.strerror()); return CF_ERROR; } - } else if(S_ISSOCK(attr->statp.st_mode)) { + } else if (S_ISSOCK(attr->statp.st_mode)) { Dmsg1(200, "Skipping restore of socket: %s\n", attr->ofname); } else { Dmsg1(200, "Restore node: %s\n", attr->ofname); @@ -297,7 +297,7 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) * preventing this. So attempt to disable, retry link, * and reset flags. * Note that BSD securelevel may prevent disabling flag. - */ + */ if (stat(attr->olname, &s) == 0 && s.st_flags != 0) { if (chflags(attr->olname, 0) == 0) { diff --git a/bacula/src/version.h b/bacula/src/version.h index 66498fde1c..42ec7035f2 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "2.0.3" -#define BDATE "16 February 2007" -#define LSMDATE "16Feb07" +#define BDATE "19 February 2007" +#define LSMDATE "19Feb07" #define PROG_COPYRIGHT "Copyright (C) %d-2007 Free Software Foundation Europe e.V.\n" #define BYEAR "2007" /* year for copyright messages in progs */ diff --git a/bacula/technotes-2.0 b/bacula/technotes-2.0 index c9a9d2964c..6008e84b72 100644 --- a/bacula/technotes-2.0 +++ b/bacula/technotes-2.0 @@ -1,6 +1,10 @@ Technical notes on version 2.0 General: +19Feb07 +kes Restore of sockets created false error messages because Bacula + no longer restores sockets, but the code was still trying to + set the attributes on a non-existent file. Reported by a user. 16Feb07 kes Fix encryption deblocking bug, which caused some restored files to be truncated. This fixes bug #763.