]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix regress test issue with lchmod() feature on symlinks
authorEric Bollengier <eric@baculasystems.com>
Tue, 4 May 2021 11:59:03 +0000 (13:59 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:03:01 +0000 (09:03 +0100)
bacula/src/findlib/attribs.c

index 7ed8d590e41b30d5a0b42eac189a47e9add31cf5..3c96858ce35e3f5687bbd5037423cffc44b2f059 100644 (file)
@@ -645,13 +645,16 @@ bool set_attributes(JCR *jcr, ATTR *attr, BFILE *ofd)
          ok = false;
       }
 #endif
-#ifdef HAVE_LCHMOD
+#if defined(HAVE_FREEBSD_OS) || defined(HAVE_DARWIN_OS)
+/* lchmod() is defined on Linux but doesn't work */
+# ifdef HAVE_LCHMOD
       if (lchmod(attr->ofname, attr->statp.st_mode) < 0 && print_error(jcr)) {
          berrno be;
          Jmsg2(jcr, M_ERROR, 0, _("Unable to set file modes %s: ERR=%s\n"),
             attr->ofname, be.bstrerror());
          ok = false;
       }
+# endif
 #endif
 #ifdef HAVE_LUTIMES
       struct timeval times[2];