summaryrefslogtreecommitdiff
path: root/source3/smbd/nttrans.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-06-18 13:13:38 -0700
committerJeremy Allison <jra@samba.org>2009-06-18 13:13:38 -0700
commit34267482d53cb559cc40c4ec2bee929c21b7886b (patch)
treedae973a4b11a0a7f3dd51e07a30f7a1065d7c6a6 /source3/smbd/nttrans.c
parente7e98ba4807f3c4e0538b24ae0092f69383ae2d7 (diff)
downloadsamba-34267482d53cb559cc40c4ec2bee929c21b7886b.tar.gz
samba-34267482d53cb559cc40c4ec2bee929c21b7886b.tar.bz2
samba-34267482d53cb559cc40c4ec2bee929c21b7886b.zip
Replace the boilerplate calls to :
resolve_dfspath() -> unix_convert() -> get_full_smb_filename() -> check_name() with a new function filename_convert(). This restores the check_name() calls that had gone missing since the default create_file was changed. All "standard" pathname processing now goes through filename_convert(). I'll take a look at the non-standard pathname processing next. As a benefit, fixed a missing resolve_dfspath() in the trans2 mkdir call. Jeremy.
Diffstat (limited to 'source3/smbd/nttrans.c')
-rw-r--r--source3/smbd/nttrans.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index c4d0374e99..73c062e69f 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -535,10 +535,11 @@ void reply_ntcreate_and_X(struct smb_request *req)
? BATCH_OPLOCK : 0;
}
- status = resolve_dfspath(ctx,
+ status = filename_convert(ctx,
conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
fname,
+ &smb_fname,
&fname);
if (!NT_STATUS_IS_OK(status)) {
@@ -552,12 +553,6 @@ void reply_ntcreate_and_X(struct smb_request *req)
goto out;
}
- status = unix_convert(ctx, conn, fname, &smb_fname, 0);
- if (!NT_STATUS_IS_OK(status)) {
- reply_nterror(req, status);
- goto out;
- }
-
status = SMB_VFS_CREATE_FILE(
conn, /* conn */
req, /* req */
@@ -1021,10 +1016,11 @@ static void call_nt_transact_create(connection_struct *conn,
goto out;
}
- status = resolve_dfspath(ctx,
+ status = filename_convert(ctx,
conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
fname,
+ &smb_fname,
&fname);
if (!NT_STATUS_IS_OK(status)) {
@@ -1038,12 +1034,6 @@ static void call_nt_transact_create(connection_struct *conn,
goto out;
}
- status = unix_convert(ctx, conn, fname, &smb_fname, 0);
- if (!NT_STATUS_IS_OK(status)) {
- reply_nterror(req, status);
- goto out;
- }
-
oplock_request = (flags & REQUEST_OPLOCK) ? EXCLUSIVE_OPLOCK : 0;
if (oplock_request) {
oplock_request |= (flags & REQUEST_BATCH_OPLOCK)
@@ -1399,6 +1389,8 @@ static NTSTATUS copy_internals(TALLOC_CTX *ctx,
void reply_ntrename(struct smb_request *req)
{
connection_struct *conn = req->conn;
+ struct smb_filename *smb_fname_old = NULL;
+ struct smb_filename *smb_fname_new = NULL;
char *oldname = NULL;
char *newname = NULL;
const char *p;
@@ -1444,9 +1436,10 @@ void reply_ntrename(struct smb_request *req)
return;
}
- status = resolve_dfspath(ctx, conn,
+ status = filename_convert(ctx, conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
oldname,
+ &smb_fname_old,
&oldname);
if (!NT_STATUS_IS_OK(status)) {
if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) {
@@ -1460,9 +1453,10 @@ void reply_ntrename(struct smb_request *req)
return;
}
- status = resolve_dfspath(ctx, conn,
+ status = filename_convert(ctx, conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
newname,
+ &smb_fname_new,
&newname);
if (!NT_STATUS_IS_OK(status)) {
if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) {
@@ -1498,8 +1492,8 @@ void reply_ntrename(struct smb_request *req)
} else {
status = hardlink_internals(ctx,
conn,
- oldname,
- newname);
+ smb_fname_old,
+ smb_fname_new);
}
break;
case RENAME_FLAG_COPY: