From: Eric Bollengier Date: Tue, 4 May 2021 11:59:03 +0000 (+0200) Subject: Fix regress test issue with lchmod() feature on symlinks X-Git-Tag: Release-11.3.2~550 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f23d15b64f58251e1b2f56bfc19dddb7cb6c36db;p=thirdparty%2Fbacula.git Fix regress test issue with lchmod() feature on symlinks --- diff --git a/bacula/src/findlib/attribs.c b/bacula/src/findlib/attribs.c index 7ed8d590e..3c96858ce 100644 --- a/bacula/src/findlib/attribs.c +++ b/bacula/src/findlib/attribs.c @@ -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];