diff options
author | Tim Prouty <tprouty@samba.org> | 2009-07-10 15:35:08 -0700 |
---|---|---|
committer | Tim Prouty <tprouty@samba.org> | 2009-07-20 17:26:57 -0700 |
commit | 841efce8b5e931a7ec910afb7d0d8b6a123c6900 (patch) | |
tree | 7ba710be5ffedf23caaecadf7425278ba007b971 /source3/smbd/vfs.c | |
parent | 82c3f505fe2e50022b5102e6388dc3b830d235da (diff) | |
download | samba-841efce8b5e931a7ec910afb7d0d8b6a123c6900.tar.gz samba-841efce8b5e931a7ec910afb7d0d8b6a123c6900.tar.bz2 samba-841efce8b5e931a7ec910afb7d0d8b6a123c6900.zip |
s3: Separate out a new file: filename_utils.c
This is to ease the linking pain of everything that links LOCKING_OBJ
Diffstat (limited to 'source3/smbd/vfs.c')
-rw-r--r-- | source3/smbd/vfs.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index a2e3ec504c..55495183bd 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -990,3 +990,58 @@ NTSTATUS check_reduced_name(connection_struct *conn, const char *fname) } return NT_STATUS_OK; } + +/** + * XXX: This is temporary and there should be no callers of this once + * smb_filename is plumbed through all path based operations. + */ +int vfs_stat_smb_fname(struct connection_struct *conn, const char *fname, + SMB_STRUCT_STAT *psbuf) +{ + struct smb_filename *smb_fname = NULL; + NTSTATUS status; + int ret; + + status = create_synthetic_smb_fname_split(talloc_tos(), fname, NULL, + &smb_fname); + if (!NT_STATUS_IS_OK(status)) { + errno = map_errno_from_nt_status(status); + return -1; + } + + ret = SMB_VFS_STAT(conn, smb_fname); + if (ret != -1) { + *psbuf = smb_fname->st; + } + + TALLOC_FREE(smb_fname); + return ret; +} + +/** + * XXX: This is temporary and there should be no callers of this once + * smb_filename is plumbed through all path based operations. + */ +int vfs_lstat_smb_fname(struct connection_struct *conn, const char *fname, + SMB_STRUCT_STAT *psbuf) +{ + struct smb_filename *smb_fname = NULL; + NTSTATUS status; + int ret; + + status = create_synthetic_smb_fname_split(talloc_tos(), fname, NULL, + &smb_fname); + if (!NT_STATUS_IS_OK(status)) { + errno = map_errno_from_nt_status(status); + return -1; + } + + ret = SMB_VFS_LSTAT(conn, smb_fname); + if (ret != -1) { + *psbuf = smb_fname->st; + } + + TALLOC_FREE(smb_fname); + return ret; +} + |