From: Kern Sibbald Date: Wed, 23 Jul 2014 15:43:30 +0000 (+0200) Subject: Fix for bug #2082 (hopefully) X-Git-Tag: Release-7.0.5~20 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=110bba72ed3f0c3e65bc213fab1fa892dfd9bc50;p=bacula%2Fbacula Fix for bug #2082 (hopefully) --- diff --git a/bacula/src/findlib/file_attrs.c b/bacula/src/findlib/file_attrs.c index 485d8ec628..9268ce18ac 100644 --- a/bacula/src/findlib/file_attrs.c +++ b/bacula/src/findlib/file_attrs.c @@ -87,23 +87,23 @@ bool set_mod_own_time(JCR *jcr, BFILE *ofd, ATTR *attr) * The #ifdefing is a bit ugly, but it is the only * way we can ensure this works on older systems. */ -#ifdef HAVE_FCHMOD - if (fchmod(ofd->fid, attr->statp.st_mode) < 0 && print_error) { +#ifdef HAVE_FCHOWN + if (fchown(ofd->fid, attr->statp.st_uid, attr->statp.st_gid) < 0 && print_error) { #else - if (lchmod(attr->ofname, attr->statp.st_mode) < 0 && print_error) { + if (lchown(attr->ofname, attr->statp.st_uid, attr->statp.st_gid) < 0 && print_error) { #endif berrno be; - Jmsg2(jcr, M_ERROR, 0, _("Unable to set file modes %s: ERR=%s\n"), + Jmsg2(jcr, M_ERROR, 0, _("Unable to set file owner %s: ERR=%s\n"), attr->ofname, be.bstrerror()); ok = false; } -#ifdef HAVE_FCHOWN - if (fchown(ofd->fid, attr->statp.st_uid, attr->statp.st_gid) < 0 && print_error) { +#ifdef HAVE_FCHMOD + if (fchmod(ofd->fid, attr->statp.st_mode) < 0 && print_error) { #else - if (lchown(attr->ofname, attr->statp.st_uid, attr->statp.st_gid) < 0 && print_error) { + if (lchmod(attr->ofname, attr->statp.st_mode) < 0 && print_error) { #endif berrno be; - Jmsg2(jcr, M_ERROR, 0, _("Unable to set file owner %s: ERR=%s\n"), + Jmsg2(jcr, M_ERROR, 0, _("Unable to set file modes %s: ERR=%s\n"), attr->ofname, be.bstrerror()); ok = false; }