From f23d15b64f58251e1b2f56bfc19dddb7cb6c36db Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Tue, 4 May 2021 13:59:03 +0200 Subject: [PATCH] Fix regress test issue with lchmod() feature on symlinks --- bacula/src/findlib/attribs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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]; -- 2.47.3