diff options
author | Jeremy Allison <jra@samba.org> | 2013-08-24 18:43:29 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2013-08-24 18:43:29 -0700 |
commit | 9cbd4fcd1e7ef87e564a0ffa07940af6f26f4e2b (patch) | |
tree | f51162450fb7169b3b06d383083fc2d5a639c5a4 /source3/smbd | |
parent | cf86adc4419f2636a0b24824ab04ebfcd5bb074d (diff) | |
download | samba-9cbd4fcd1e7ef87e564a0ffa07940af6f26f4e2b.tar.gz samba-9cbd4fcd1e7ef87e564a0ffa07940af6f26f4e2b.tar.bz2 samba-9cbd4fcd1e7ef87e564a0ffa07940af6f26f4e2b.zip |
Pushed from the wrong branch - this is the version
without Simo's review changes. Apologies to all
and I'll re-submit in less of a haste after the
weekend.
Revert "Fix the UNIX extensions CHOWN calls to use FCHOWN if available, else LCHOWN."
This reverts commit cf86adc4419f2636a0b24824ab04ebfcd5bb074d.
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/trans2.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 04947d3c8a..55272e9018 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -7148,12 +7148,12 @@ static NTSTATUS smb_set_file_unix_basic(connection_struct *conn, (unsigned int)set_owner, smb_fname_str_dbg(smb_fname))); - if (fsp && fsp->fh->fd != -1) { - ret = SMB_VFS_FCHOWN(fsp, set_owner, (gid_t)-1); - } else { - /* UNIX calls always operate on symlinks. */ + if (S_ISLNK(sbuf.st_ex_mode)) { ret = SMB_VFS_LCHOWN(conn, smb_fname->base_name, set_owner, (gid_t)-1); + } else { + ret = SMB_VFS_CHOWN(conn, smb_fname->base_name, + set_owner, (gid_t)-1); } if (ret != 0) { @@ -7171,20 +7171,12 @@ static NTSTATUS smb_set_file_unix_basic(connection_struct *conn, if ((set_grp != (uid_t)SMB_GID_NO_CHANGE) && (sbuf.st_ex_gid != set_grp)) { - int ret; - DEBUG(10,("smb_set_file_unix_basic: SMB_SET_FILE_UNIX_BASIC " "changing group %u for file %s\n", (unsigned int)set_owner, smb_fname_str_dbg(smb_fname))); - if (fsp && fsp->fh->fd != -1) { - ret = SMB_VFS_FCHOWN(fsp, set_owner, (gid_t)-1); - } else { - /* UNIX calls always operate on symlinks. */ - ret = SMB_VFS_LCHOWN(conn, smb_fname->base_name, (uid_t)-1, - set_grp); - } - if (ret != 0) { + if (SMB_VFS_CHOWN(conn, smb_fname->base_name, (uid_t)-1, + set_grp) != 0) { status = map_nt_error_from_unix(errno); if (delete_on_fail) { SMB_VFS_UNLINK(conn, smb_fname); |