diff options
author | Tim Prouty <tprouty@samba.org> | 2009-06-22 15:26:56 -0700 |
---|---|---|
committer | Tim Prouty <tprouty@samba.org> | 2009-06-24 21:15:25 -0700 |
commit | e129384d7c1df664e447186673dd107e190e2894 (patch) | |
tree | 166c08e9d2ee0bbb8a88fb2ad76ed226a62f83dc /source3/modules/vfs_fake_perms.c | |
parent | 36c10191750c845a2a7cd6cc62149b1095c0b651 (diff) | |
download | samba-e129384d7c1df664e447186673dd107e190e2894.tar.gz samba-e129384d7c1df664e447186673dd107e190e2894.tar.bz2 samba-e129384d7c1df664e447186673dd107e190e2894.zip |
s3: Plumb smb_filename through SMB_VFS_STAT and SMB_VFS_LSTAT
This patch introduces two new temporary helper functions
vfs_stat_smb_fname and vfs_lstat_smb_fname. They basically allowed me
to call the new smb_filename version of stat, while avoiding plumbing
it through callers that are still too inconvenient. As the conversion
moves along, I will be able to remove callers of this, with the goal
being to remove all callers.
There was also a bug in create_synthetic_smb_fname_split (also a
temporary utility function) that caused it to incorrectly handle
filenames with ':'s in them when in posix mode. This is now fixed.
Diffstat (limited to 'source3/modules/vfs_fake_perms.c')
-rw-r--r-- | source3/modules/vfs_fake_perms.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source3/modules/vfs_fake_perms.c b/source3/modules/vfs_fake_perms.c index cc3ab6220d..2740b612ca 100644 --- a/source3/modules/vfs_fake_perms.c +++ b/source3/modules/vfs_fake_perms.c @@ -26,19 +26,20 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_VFS -static int fake_perms_stat(vfs_handle_struct *handle, const char *fname, SMB_STRUCT_STAT *sbuf) +static int fake_perms_stat(vfs_handle_struct *handle, + struct smb_filename *smb_fname) { int ret = -1; - ret = SMB_VFS_NEXT_STAT(handle, fname, sbuf); + ret = SMB_VFS_NEXT_STAT(handle, smb_fname); if (ret == 0) { - if (S_ISDIR(sbuf->st_ex_mode)) { - sbuf->st_ex_mode = S_IFDIR | S_IRWXU; + if (S_ISDIR(smb_fname->st.st_ex_mode)) { + smb_fname->st.st_ex_mode = S_IFDIR | S_IRWXU; } else { - sbuf->st_ex_mode = S_IRWXU; + smb_fname->st.st_ex_mode = S_IRWXU; } - sbuf->st_ex_uid = handle->conn->server_info->utok.uid; - sbuf->st_ex_gid = handle->conn->server_info->utok.gid; + smb_fname->st.st_ex_uid = handle->conn->server_info->utok.uid; + smb_fname->st.st_ex_gid = handle->conn->server_info->utok.gid; } return ret; |