diff options
author | Tim Prouty <tprouty@samba.org> | 2009-07-07 19:20:22 -0700 |
---|---|---|
committer | Tim Prouty <tprouty@samba.org> | 2009-07-08 21:36:03 -0700 |
commit | 69c8795b672054cb6b5a85cc5f8961099425bd7a (patch) | |
tree | 1484215b8c1b9778d8079d53863ff5557e753614 /source3/smbd/posix_acls.c | |
parent | 400c18a8c4098b4ba86d32a236e5d89014774f3f (diff) | |
download | samba-69c8795b672054cb6b5a85cc5f8961099425bd7a.tar.gz samba-69c8795b672054cb6b5a85cc5f8961099425bd7a.tar.xz samba-69c8795b672054cb6b5a85cc5f8961099425bd7a.zip |
s3: convert unix_mode to take an smb_filename
Diffstat (limited to 'source3/smbd/posix_acls.c')
-rw-r--r-- | source3/smbd/posix_acls.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c index 627ca2e171f..0c7f4b7bb7f 100644 --- a/source3/smbd/posix_acls.c +++ b/source3/smbd/posix_acls.c @@ -2166,10 +2166,23 @@ static mode_t create_default_mode(files_struct *fsp, bool interitable_mode) int snum = SNUM(fsp->conn); mode_t and_bits = (mode_t)0; mode_t or_bits = (mode_t)0; - mode_t mode = interitable_mode - ? unix_mode( fsp->conn, FILE_ATTRIBUTE_ARCHIVE, fsp->fsp_name, - NULL ) - : S_IRUSR; + mode_t mode; + + if (interitable_mode) { + struct smb_filename *smb_fname = NULL; + NTSTATUS status; + + status = create_synthetic_smb_fname_split(talloc_tos(), + fsp->fsp_name, NULL, + &smb_fname); + if (!NT_STATUS_IS_OK(status)) { + return 0; + } + mode = unix_mode(fsp->conn, FILE_ATTRIBUTE_ARCHIVE, smb_fname, + NULL); + } else { + mode = S_IRUSR; + } if (fsp->is_directory) mode |= (S_IWUSR|S_IXUSR); |