summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-12-16 23:44:38 +0000
committerJeremy Allison <jra@samba.org>2001-12-16 23:44:38 +0000
commit28df80cf68158c37fa8ddcadd0ce94dd3ef3887e (patch)
tree0c78f43b64fe0d19f63748889496a487691bd4cf
parent0fd94a5c4b659e715e16fa4b2d5102520412ad55 (diff)
downloadsamba-28df80cf68158c37fa8ddcadd0ce94dd3ef3887e.tar.gz
samba-28df80cf68158c37fa8ddcadd0ce94dd3ef3887e.tar.bz2
samba-28df80cf68158c37fa8ddcadd0ce94dd3ef3887e.zip
Moved fchown_acl change to the point where we *really* know if we
created the file or not. Jeremy. (This used to be commit 32dffa0ba792a81d89d06b527d82820b89507efd)
-rw-r--r--source3/smbd/open.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 03540ec7c3..72f73deb84 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -204,16 +204,6 @@ static BOOL open_file(files_struct *fsp,connection_struct *conn,
BOOLSTR(fsp->can_read), BOOLSTR(fsp->can_write),
conn->num_files_open + 1));
- /*
- * Take care of inherited ACLs on created files. JRA.
- */
-
- if ((flags & O_CREAT) && (conn->vfs_ops.fchmod_acl != NULL)) {
- int saved_errno = errno; /* We might get ENOSYS in the next call.. */
- if (conn->vfs_ops.fchmod_acl(fsp, fsp->fd, mode) == -1 && errno == ENOSYS)
- errno = saved_errno; /* Ignore ENOSYS */
- }
-
return True;
}
@@ -922,6 +912,16 @@ flags=0x%X flags2=0x%X mode=0%o returned %d\n",
}
}
+ /*
+ * Take care of inherited ACLs on created files. JRA.
+ */
+
+ if (!file_existed && (conn->vfs_ops.fchmod_acl != NULL)) {
+ int saved_errno = errno; /* We might get ENOSYS in the next call.. */
+ if (conn->vfs_ops.fchmod_acl(fsp, fsp->fd, mode) == -1 && errno == ENOSYS)
+ errno = saved_errno; /* Ignore ENOSYS */
+ }
+
unlock_share_entry_fsp(fsp);
conn->num_files_open++;