mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
Fix bug 6891 - using windows explorer to change ownership on a folder fails with Bad File Descriptor.
Jeremy.
This commit is contained in:
parent
83c2c177a5
commit
6747a91ca0
@ -3594,7 +3594,17 @@ int try_chown(connection_struct *conn, struct smb_filename *smb_fname,
|
||||
|
||||
become_root();
|
||||
/* Keep the current file gid the same. */
|
||||
ret = SMB_VFS_FCHOWN(fsp, uid, (gid_t)-1);
|
||||
if (fsp->fh->fd == -1) {
|
||||
if (lp_posix_pathnames()) {
|
||||
ret = SMB_VFS_LCHOWN(conn, smb_fname->base_name, uid,
|
||||
(gid_t)-1);
|
||||
} else {
|
||||
ret = SMB_VFS_CHOWN(conn, smb_fname->base_name, uid,
|
||||
(gid_t)-1);
|
||||
}
|
||||
} else {
|
||||
ret = SMB_VFS_FCHOWN(fsp, uid, (gid_t)-1);
|
||||
}
|
||||
unbecome_root();
|
||||
|
||||
close_file_fchmod(NULL, fsp);
|
||||
|
Loading…
x
Reference in New Issue
Block a user