summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2011-06-08 10:17:42 -0700
committerKarolin Seeger <kseeger@samba.org>2011-06-14 12:59:06 +0200
commit06f653a72d84925c76f21ad1d4d8bc907c138f69 (patch)
tree039733d77e199f732aeb5d1d5713790de8ef66c2
parent5bf5324e6352bb8c68855e5fdbc9991ae71525b6 (diff)
downloadsamba-06f653a72d84925c76f21ad1d4d8bc907c138f69.tar.gz
Part 2 of bugfix for #8211 - "inherit owner = yes" doesn't interact correctly with "inherit permissions = yes" and POSIX ACLs
When changing ownership on a new file make sure we also change the returned stat struct to have the correct uid. (cherry picked from commit 59e77811b7774ad76e082ee9fd840a277df75c4c)
-rw-r--r--source3/smbd/open.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index e8d1a1bd407..aaae9673d1a 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -232,12 +232,15 @@ void change_file_owner_to_parent(connection_struct *conn,
"was %s\n", fsp_str_dbg(fsp),
(unsigned int)smb_fname_parent->st.st_ex_uid,
strerror(errno) ));
- }
-
- DEBUG(10,("change_file_owner_to_parent: changed new file %s to "
+ } else {
+ DEBUG(10,("change_file_owner_to_parent: changed new file %s to "
"parent directory uid %u.\n", fsp_str_dbg(fsp),
(unsigned int)smb_fname_parent->st.st_ex_uid));
+ /* Ensure the uid entry is updated. */
+ fsp->fsp_name->st.st_ex_uid = smb_fname_parent->st.st_ex_uid;
+ }
+
TALLOC_FREE(smb_fname_parent);
}