From fe26619f69faa3be8b41de050af3ca9c79ba903a Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Fri, 27 Feb 2009 12:07:34 +1100 Subject: [PATCH] use an explicit chmod to make sure the bits are set correctly --- migrate/remote-cache.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/migrate/remote-cache.c b/migrate/remote-cache.c index 8ba2d1e..4114a88 100644 --- a/migrate/remote-cache.c +++ b/migrate/remote-cache.c @@ -1407,14 +1407,19 @@ static int migrate_small_file_immed(TALLOC_CTX *mem_ctx, char *old_path, char *n ret = -EIO; goto finished; } + ret = 0; if (chown(new_tmppath, st->st_uid, st->st_gid) == -1) { - DEBUG(DEBUG_ERR, (__location__ " fchown for migrated file %s failed with %s\n", new_tmppath, strerror(errno))); + DEBUG(DEBUG_ERR, (__location__ " chown for migrated file %s failed with %s\n", new_tmppath, strerror(errno))); ret = -errno; goto finished; } - ret = 0; + if (chmod(new_tmppath, st->st_mode) == -1) { + DEBUG(DEBUG_ERR, (__location__ " chmod for migrated file %s failed with %s\n", new_tmppath, strerror(errno))); + ret = -errno; + goto finished; + } times.actime = st->st_atime; times.modtime = st->st_mtime; if (utime(new_tmppath, ×) == -1) { -- 2.34.1