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) {