From 110bba72ed3f0c3e65bc213fab1fa892dfd9bc50 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 23 Jul 2014 17:43:30 +0200 Subject: [PATCH] Fix for bug #2082 (hopefully) --- bacula/src/findlib/file_attrs.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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; } -- 2.39.5