Commit f08baea3 authored by Andrew Tridgell's avatar Andrew Tridgell

removed ACCESSPERMS mask when transferring a file without perms

copy. This makes us match GNU cp more closely.
parent 2fb139c1
...@@ -200,14 +200,9 @@ int set_perms(char *fname,struct file_struct *file,STRUCT_STAT *st, ...@@ -200,14 +200,9 @@ int set_perms(char *fname,struct file_struct *file,STRUCT_STAT *st,
#ifdef HAVE_CHMOD #ifdef HAVE_CHMOD
if (!S_ISLNK(st->st_mode)) { if (!S_ISLNK(st->st_mode)) {
int file_mode;
if (preserve_perms)
file_mode = file->mode;
else
file_mode = file->mode & ACCESSPERMS;
if (st->st_mode != file->mode) { if (st->st_mode != file->mode) {
updated = 1; updated = 1;
if (do_chmod(fname,file_mode) != 0) { if (do_chmod(fname,file->mode) != 0) {
rprintf(FERROR,"failed to set permissions on %s : %s\n", rprintf(FERROR,"failed to set permissions on %s : %s\n",
fname,strerror(errno)); fname,strerror(errno));
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment