summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-11-12 13:08:04 -0800
committerJeremy Allison <jra@samba.org>2009-11-12 13:08:04 -0800
commit6747a91ca0c350374c54bac5892cf96e5aed029f (patch)
tree7a0baa098574e9b2ebc7f64c6c0ab883bfb854ea /source3
parent83c2c177a5e86d04da37384f1f04230c8274e1e6 (diff)
downloadsamba-6747a91ca0c350374c54bac5892cf96e5aed029f.tar.gz
samba-6747a91ca0c350374c54bac5892cf96e5aed029f.tar.bz2
samba-6747a91ca0c350374c54bac5892cf96e5aed029f.zip
Fix bug 6891 - using windows explorer to change ownership on a folder fails with Bad File Descriptor.
Jeremy.
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/posix_acls.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c
index 26e609fb83..15ea4d5fb2 100644
--- a/source3/smbd/posix_acls.c
+++ b/source3/smbd/posix_acls.c
@@ -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);