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/modules | |
parent | 400c18a8c4098b4ba86d32a236e5d89014774f3f (diff) | |
download | samba-69c8795b672054cb6b5a85cc5f8961099425bd7a.tar.gz samba-69c8795b672054cb6b5a85cc5f8961099425bd7a.tar.bz2 samba-69c8795b672054cb6b5a85cc5f8961099425bd7a.zip |
s3: convert unix_mode to take an smb_filename
Diffstat (limited to 'source3/modules')
-rw-r--r-- | source3/modules/onefs_acl.c | 15 | ||||
-rw-r--r-- | source3/modules/onefs_open.c | 6 |
2 files changed, 16 insertions, 5 deletions
diff --git a/source3/modules/onefs_acl.c b/source3/modules/onefs_acl.c index 81bdfd26cc..5c72d10a6b 100644 --- a/source3/modules/onefs_acl.c +++ b/source3/modules/onefs_acl.c @@ -542,14 +542,25 @@ static bool add_sfs_aces(files_struct *fsp, struct ifs_security_descriptor *sd) /* Only continue if this is a synthetic ACL and a directory. */ if (S_ISDIR(sbuf.st_ex_mode) && (sbuf.st_ex_flags & SF_HASNTFSACL) == 0) { + struct smb_filename *smb_fname = NULL; struct ifs_ace new_aces[6]; struct ifs_ace *old_aces; int i, num_aces_to_add = 0; mode_t file_mode = 0, dir_mode = 0; + NTSTATUS status; + + status = create_synthetic_smb_fname_split(talloc_tos(), + fsp->fsp_name, NULL, + &smb_fname); + if (!NT_STATUS_IS_OK(status)) { + return false; + } /* Use existing samba logic to derive the mode bits. */ - file_mode = unix_mode(fsp->conn, 0, fsp->fsp_name, false); - dir_mode = unix_mode(fsp->conn, aDIR, fsp->fsp_name, false); + file_mode = unix_mode(fsp->conn, 0, smb_fname, NULL); + dir_mode = unix_mode(fsp->conn, aDIR, smb_fname, NULL); + + TALLOC_FREE(smb_fname); /* Initialize ACEs. */ new_aces[0] = onefs_init_ace(fsp->conn, file_mode, false, USR); diff --git a/source3/modules/onefs_open.c b/source3/modules/onefs_open.c index da7d413073..20ce814518 100644 --- a/source3/modules/onefs_open.c +++ b/source3/modules/onefs_open.c @@ -504,8 +504,8 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn, } else { /* We add aARCH to this as this mode is only used if the file is * created new. */ - unx_mode = unix_mode(conn, new_dos_attributes | aARCH, fname, - parent_dir); + unx_mode = unix_mode(conn, new_dos_attributes | aARCH, + smb_fname, parent_dir); } DEBUG(10,("onefs_open_file_ntcreate: fname=%s, dos_attrs=0x%x " @@ -1444,7 +1444,7 @@ static NTSTATUS onefs_open_directory(connection_struct *conn, mode = (mode_t)(file_attributes & ~FILE_FLAG_POSIX_SEMANTICS); file_attributes = 0; } else { - mode = unix_mode(conn, aDIR, smb_dname->base_name, parent_dir); + mode = unix_mode(conn, aDIR, smb_dname, parent_dir); } /* |