diff options
author | Tim Prouty <tprouty@samba.org> | 2009-07-06 14:36:16 -0700 |
---|---|---|
committer | Tim Prouty <tprouty@samba.org> | 2009-07-06 15:38:41 -0700 |
commit | 99bd4fda0cd97eb211549a511a2ff6153c2bde2d (patch) | |
tree | db1e4d3424b6bd1215a341f727ef94c748244454 /source3/smbd/trans2.c | |
parent | 0f6e10886f3f778fe301ee981873f29d295d39c5 (diff) | |
download | samba-99bd4fda0cd97eb211549a511a2ff6153c2bde2d.tar.gz samba-99bd4fda0cd97eb211549a511a2ff6153c2bde2d.tar.bz2 samba-99bd4fda0cd97eb211549a511a2ff6153c2bde2d.zip |
s3: Plumb smb_filename around SMB_VFS_CHFLAGS
SMB_VFS_CHFLAGS isn't actually getting the smb_filename struct for now
since it only operates on the basefile. This is the strategy for all
path-based operations that will never actually operate on a stream.
By clarifying the meaning of path based operations that don't take an
smb_filename struct, modules that implement streams such as vfs_onefs
no longer need to implement SMB_VFS_CHFLAGS to ensure it's only called
on the base_name.
Diffstat (limited to 'source3/smbd/trans2.c')
-rw-r--r-- | source3/smbd/trans2.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index dfb682ee21..2c74c8f49e 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -5063,15 +5063,26 @@ static NTSTATUS smb_set_file_dosmode(connection_struct *conn, /* check the mode isn't different, before changing it */ if ((dosmode != 0) && (dosmode != dos_mode(conn, fname, psbuf))) { + struct smb_filename *smb_fname = NULL; + NTSTATUS status; + + status = create_synthetic_smb_fname_split(talloc_tos(), fname, + psbuf, &smb_fname); + if (!NT_STATUS_IS_OK(status)) { + return status; + } DEBUG(10,("smb_set_file_dosmode: file %s : setting dos mode 0x%x\n", fname, (unsigned int)dosmode )); - if(file_set_dosmode(conn, fname, dosmode, psbuf, NULL, false)) { + if(file_set_dosmode(conn, smb_fname, dosmode, NULL, false)) { DEBUG(2,("smb_set_file_dosmode: file_set_dosmode of %s failed (%s)\n", fname, strerror(errno))); + TALLOC_FREE(smb_fname); return map_nt_error_from_unix(errno); } + *psbuf = smb_fname->st; + TALLOC_FREE(smb_fname); } return NT_STATUS_OK; } @@ -6320,7 +6331,7 @@ static NTSTATUS smb_set_file_unix_basic(connection_struct *conn, return status; } - id = vfs_file_id_from_sbuf(conn, psbuf); + id = vfs_file_id_from_sbuf(conn, &sbuf); for(all_fsps = file_find_di_first(id); all_fsps; all_fsps = file_find_di_next(all_fsps)) { /* @@ -6349,7 +6360,7 @@ static NTSTATUS smb_set_file_unix_basic(connection_struct *conn, false); if (modify_mtime) { notify_fname(conn, NOTIFY_ACTION_MODIFIED, - FILE_NOTIFY_CHANGE_LAST_WRITE, fname); + FILE_NOTIFY_CHANGE_LAST_WRITE, smb_fname->base_name); } return status; } |