summaryrefslogtreecommitdiff
path: root/source3/smbd/msdfs.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/msdfs.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/msdfs.c')
-rw-r--r--source3/smbd/msdfs.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c
index d40b8a8902..2b63eb1743 100644
--- a/source3/smbd/msdfs.c
+++ b/source3/smbd/msdfs.c
@@ -411,7 +411,6 @@ static bool is_msdfs_link_internal(TALLOC_CTX *ctx,
char **pp_link_target,
SMB_STRUCT_STAT *sbufp)
{
- SMB_STRUCT_STAT st;
int referral_len = 0;
#if defined(HAVE_BROKEN_READLINK)
char link_target_buf[PATH_MAX];
@@ -420,6 +419,8 @@ static bool is_msdfs_link_internal(TALLOC_CTX *ctx,
#endif
size_t bufsize = 0;
char *link_target = NULL;
+ struct smb_filename *smb_fname = NULL;
+ NTSTATUS status;
if (pp_link_target) {
bufsize = 1024;
@@ -433,21 +434,28 @@ static bool is_msdfs_link_internal(TALLOC_CTX *ctx,
link_target = link_target_buf;
}
- if (sbufp == NULL) {
- sbufp = &st;
+ status = create_synthetic_smb_fname(talloc_tos(), path, NULL, NULL,
+ &smb_fname);
+ if (!NT_STATUS_IS_OK(status)) {
+ goto err;
}
- if (vfs_lstat_smb_fname(conn, path, sbufp) != 0) {
+ if (SMB_VFS_LSTAT(conn, smb_fname) != 0) {
DEBUG(5,("is_msdfs_link_read_target: %s does not exist.\n",
path));
+ TALLOC_FREE(smb_fname);
goto err;
}
-
- if (!S_ISLNK(sbufp->st_ex_mode)) {
+ if (!S_ISLNK(smb_fname->st.st_ex_mode)) {
DEBUG(5,("is_msdfs_link_read_target: %s is not a link.\n",
path));
+ TALLOC_FREE(smb_fname);
goto err;
}
+ if (sbufp != NULL) {
+ *sbufp = smb_fname->st;
+ }
+ TALLOC_FREE(smb_fname);
referral_len = SMB_VFS_READLINK(conn, path, link_target, bufsize - 1);
if (referral_len == -1) {