1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

Moved fchown_acl change to the point where we *really* know if we

created the file or not.
Jeremy.
This commit is contained in:
Jeremy Allison -
parent 2405385854
commit 32dffa0ba7

View File

@ -204,16 +204,6 @@ static BOOL open_file(files_struct *fsp,connection_struct *conn,
BOOLSTR(fsp->can_read), BOOLSTR(fsp->can_write), BOOLSTR(fsp->can_read), BOOLSTR(fsp->can_write),
conn->num_files_open + 1)); conn->num_files_open + 1));
/*
* Take care of inherited ACLs on created files. JRA.
*/
if ((flags & O_CREAT) && (conn->vfs_ops.fchmod_acl != NULL)) {
int saved_errno = errno; /* We might get ENOSYS in the next call.. */
if (conn->vfs_ops.fchmod_acl(fsp, fsp->fd, mode) == -1 && errno == ENOSYS)
errno = saved_errno; /* Ignore ENOSYS */
}
return True; return True;
} }
@ -922,6 +912,16 @@ flags=0x%X flags2=0x%X mode=0%o returned %d\n",
} }
} }
/*
* Take care of inherited ACLs on created files. JRA.
*/
if (!file_existed && (conn->vfs_ops.fchmod_acl != NULL)) {
int saved_errno = errno; /* We might get ENOSYS in the next call.. */
if (conn->vfs_ops.fchmod_acl(fsp, fsp->fd, mode) == -1 && errno == ENOSYS)
errno = saved_errno; /* Ignore ENOSYS */
}
unlock_share_entry_fsp(fsp); unlock_share_entry_fsp(fsp);
conn->num_files_open++; conn->num_files_open++;