summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorTim Prouty <tprouty@samba.org>2009-07-08 16:53:01 -0700
committerTim Prouty <tprouty@samba.org>2009-07-08 21:36:04 -0700
commit02aad05e0ed3e1d4790b323a94e43184f9c4e643 (patch)
tree466f2fe414d60700aa76416b76febc543860ebab /source3/smbd
parentdcc97c5ad7d274e88ee2be2bbd37234030737bc2 (diff)
downloadsamba-02aad05e0ed3e1d4790b323a94e43184f9c4e643.tar.gz
samba-02aad05e0ed3e1d4790b323a94e43184f9c4e643.tar.bz2
samba-02aad05e0ed3e1d4790b323a94e43184f9c4e643.zip
s3: Prepare open.c to switch fsp_name to an smb_filename struct
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/open.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 3e7b9d2657..e01350f2bf 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -358,12 +358,6 @@ static NTSTATUS open_file(files_struct *fsp,
fsp->fh->fd = -1;
errno = EPERM;
- status = get_full_smb_filename(talloc_tos(), smb_fname,
- &path);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
-
/* Check permissions */
/*
@@ -442,7 +436,7 @@ static NTSTATUS open_file(files_struct *fsp,
*/
wild = fsp->base_fsp->fsp_name;
} else {
- wild = path;
+ wild = smb_fname->base_name;
}
if ((local_flags & O_CREAT) && !file_existed &&
ms_has_wild(wild)) {
@@ -462,8 +456,9 @@ static NTSTATUS open_file(files_struct *fsp,
/* Inherit the ACL if required */
if (lp_inherit_perms(SNUM(conn))) {
- inherit_access_posix_acl(conn, parent_dir, path,
- unx_mode);
+ inherit_access_posix_acl(conn, parent_dir,
+ smb_fname->base_name,
+ unx_mode);
}
/* Change the owner if required. */
@@ -473,7 +468,8 @@ static NTSTATUS open_file(files_struct *fsp,
}
notify_fname(conn, NOTIFY_ACTION_ADDED,
- FILE_NOTIFY_CHANGE_FILE_NAME, path);
+ FILE_NOTIFY_CHANGE_FILE_NAME,
+ smb_fname->base_name);
}
} else {
@@ -619,12 +615,20 @@ static NTSTATUS open_file(files_struct *fsp,
fsp->aio_write_behind = True;
}
+ status = get_full_smb_filename(talloc_tos(), smb_fname,
+ &path);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
string_set(&fsp->fsp_name, path);
+ TALLOC_FREE(path);
+
fsp->wcp = NULL; /* Write cache pointer. */
DEBUG(2,("%s opened file %s read=%s write=%s (numopen=%d)\n",
conn->server_info->unix_name,
- fsp->fsp_name,
+ smb_fname_str_dbg(smb_fname),
BOOLSTR(fsp->can_read), BOOLSTR(fsp->can_write),
conn->num_files_open));