summaryrefslogtreecommitdiff
path: root/source3/smbd/vfs.c
diff options
context:
space:
mode:
authorTim Prouty <tprouty@samba.org>2009-07-21 15:55:25 -0700
committerTim Prouty <tprouty@samba.org>2009-07-22 11:48:22 -0700
commit83284e13f91f685b8dcccb9202e33fe64e6930b2 (patch)
tree423e67802cb063b3e8f2a332ac58e03a246f60c9 /source3/smbd/vfs.c
parent4b42927ec31a0819b1e5ec415fd1a16061cff677 (diff)
downloadsamba-83284e13f91f685b8dcccb9202e33fe64e6930b2.tar.gz
samba-83284e13f91f685b8dcccb9202e33fe64e6930b2.tar.bz2
samba-83284e13f91f685b8dcccb9202e33fe64e6930b2.zip
s3: Convert some callers of vfs_lstat_smb_fname to SMB_VFS_LSTAT()
Diffstat (limited to 'source3/smbd/vfs.c')
-rw-r--r--source3/smbd/vfs.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 55495183bd..cd78c7962e 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -972,15 +972,28 @@ NTSTATUS check_reduced_name(connection_struct *conn, const char *fname)
#ifdef S_ISLNK
if (!lp_symlinks(SNUM(conn))) {
- SMB_STRUCT_STAT statbuf;
- if ( (vfs_lstat_smb_fname(conn,fname,&statbuf) != -1) &&
- (S_ISLNK(statbuf.st_ex_mode)) ) {
+ struct smb_filename *smb_fname = NULL;
+ NTSTATUS status;
+
+ status = create_synthetic_smb_fname(talloc_tos(), fname, NULL,
+ NULL, &smb_fname);
+ if (!NT_STATUS_IS_OK(status)) {
+ if (free_resolved_name) {
+ SAFE_FREE(resolved_name);
+ }
+ return status;
+ }
+
+ if ( (SMB_VFS_LSTAT(conn, smb_fname) != -1) &&
+ (S_ISLNK(smb_fname->st.st_ex_mode)) ) {
if (free_resolved_name) {
SAFE_FREE(resolved_name);
}
DEBUG(3,("reduce_name: denied: file path name %s is a symlink\n",resolved_name));
+ TALLOC_FREE(smb_fname);
return NT_STATUS_ACCESS_DENIED;
}
+ TALLOC_FREE(smb_fname);
}
#endif