]> git.sur5r.net Git - bacula/bacula/commitdiff
kes Restore of sockets created false error messages because Bacula
authorKern Sibbald <kern@sibbald.com>
Mon, 19 Feb 2007 18:00:26 +0000 (18:00 +0000)
committerKern Sibbald <kern@sibbald.com>
Mon, 19 Feb 2007 18:00:26 +0000 (18:00 +0000)
     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

bacula/src/findlib/attribs.c
bacula/src/findlib/create_file.c
bacula/src/version.h
bacula/technotes-2.0

index 4e1122afe543b77514e8646b9e22f0fbcde60978..d747543e188cc62c3b76bc82c4afbf9930c4ad21 100755 (executable)
@@ -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.
    (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;
index 3d08fdcc8447259478da786c5be72d11128b5b09..0cbf644fda9242572edfd2fe8c38f2e187389f92 100644 (file)
@@ -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.
    (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) {
index 66498fde1c06ab6ee512d851c402efd1a9d88a76..42ec7035f23419f86b4a6310fd52d69367ba7ed6 100644 (file)
@@ -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 */
index c9a9d2964c439088990c411ccba8c63389f6c746..6008e84b72d51a852140d33d193354f299a40ed3 100644 (file)
@@ -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.