1
0
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:
Jeremy Allison 2009-11-12 13:08:04 -08:00
parent 83c2c177a5
commit 6747a91ca0

View File

@ -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);