From 32dffa0ba792a81d89d06b527d82820b89507efd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sun, 16 Dec 2001 23:44:38 +0000 Subject: [PATCH] Moved fchown_acl change to the point where we *really* know if we created the file or not. Jeremy. --- source/smbd/open.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/source/smbd/open.c b/source/smbd/open.c index 03540ec7c31..72f73deb84b 100644 --- a/source/smbd/open.c +++ b/source/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++; -- 2.34.1