diff options
author | Volker Lendecke <vl@sernet.de> | 2007-12-01 20:03:47 +0100 |
---|---|---|
committer | Volker Lendecke <vl@sernet.de> | 2007-12-05 13:45:12 +0100 |
commit | db1a23586a59e1b008c6c69cbf9d1f589a246ed2 (patch) | |
tree | 4376f30491262c48f6bc6152c503eda6127dbeec /source3 | |
parent | ffeb5aaaa42c7a779609c1bcd745e9e403f32a67 (diff) | |
download | samba-db1a23586a59e1b008c6c69cbf9d1f589a246ed2.tar.gz samba-db1a23586a59e1b008c6c69cbf9d1f589a246ed2.tar.bz2 samba-db1a23586a59e1b008c6c69cbf9d1f589a246ed2.zip |
Tiny refactorings
(This used to be commit f3421c3b86aece4f8303e864c5df97485db77f88)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/nttrans.c | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 38cda65eb1..397b634f13 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -710,10 +710,6 @@ void reply_ntcreate_and_X(connection_struct *conn, ? BATCH_OPLOCK : 0; } - /* - * Now contruct the smb_open_mode value from the filename, - * desired access and the share access. - */ status = resolve_dfspath(ctx, conn, req->flags2 & FLAGS2_DFS_PATHNAMES, fname, @@ -918,8 +914,10 @@ void reply_ntcreate_and_X(connection_struct *conn, /* Save the requested allocation size. */ if ((info == FILE_WAS_CREATED) || (info == FILE_WAS_OVERWRITTEN)) { - if (allocation_size && (allocation_size > (SMB_BIG_UINT)file_len)) { - fsp->initial_allocation_size = smb_roundup(fsp->conn, allocation_size); + if (allocation_size + && (allocation_size > (SMB_BIG_UINT)file_len)) { + fsp->initial_allocation_size = smb_roundup( + fsp->conn, allocation_size); if (fsp->is_directory) { close_file(fsp,ERROR_CLOSE); /* Can't set allocation size on a directory. */ @@ -1387,7 +1385,7 @@ static void call_nt_transact_create(connection_struct *conn, * Get the file name. */ - if(root_dir_fid != 0) { + if (root_dir_fid != 0) { /* * This filename is relative to a directory fid. */ @@ -1407,8 +1405,8 @@ static void call_nt_transact_create(connection_struct *conn, */ if( is_ntfs_stream_name(fname)) { - reply_nterror(req, - NT_STATUS_OBJECT_PATH_NOT_FOUND); + reply_nterror( + req, NT_STATUS_OBJECT_PATH_NOT_FOUND); return; } @@ -1443,7 +1441,7 @@ static void call_nt_transact_create(connection_struct *conn, */ parent_fname = TALLOC_ARRAY(ctx, char, dir_name_len+2); - if (!fname) { + if (!parent_fname) { reply_nterror(req, NT_STATUS_NO_MEMORY); return; } @@ -1488,16 +1486,11 @@ static void call_nt_transact_create(connection_struct *conn, ? BATCH_OPLOCK : 0; } - /* - * Ordinary file or directory. - */ - status = resolve_dfspath(ctx, conn, req->flags2 & FLAGS2_DFS_PATHNAMES, fname, &fname); if (!NT_STATUS_IS_OK(status)) { - TALLOC_FREE(case_state); if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) { reply_botherror(req, NT_STATUS_PATH_NOT_COVERED, ERRSRV, ERRbadpath); @@ -1709,8 +1702,10 @@ static void call_nt_transact_create(connection_struct *conn, /* Save the requested allocation size. */ if ((info == FILE_WAS_CREATED) || (info == FILE_WAS_OVERWRITTEN)) { - if (allocation_size && (allocation_size > file_len)) { - fsp->initial_allocation_size = smb_roundup(fsp->conn, allocation_size); + if (allocation_size + && (allocation_size > (SMB_BIG_UINT)file_len)) { + fsp->initial_allocation_size = smb_roundup( + fsp->conn, allocation_size); if (fsp->is_directory) { close_file(fsp,ERROR_CLOSE); /* Can't set allocation size on a directory. */ |