summaryrefslogtreecommitdiff
path: root/source3/smbd/reply.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-12-24 11:45:55 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:16:42 -0500
commitd0c6f9b728936297efd002008b69a59da6bbfabc (patch)
treef2b51e6df6840b4caaae197cb794fc181a25f416 /source3/smbd/reply.c
parent469b42c61f73c0bd5166c33a909b3c68c1fb9dde (diff)
downloadsamba-d0c6f9b728936297efd002008b69a59da6bbfabc.tar.gz
samba-d0c6f9b728936297efd002008b69a59da6bbfabc.tar.bz2
samba-d0c6f9b728936297efd002008b69a59da6bbfabc.zip
r20339: Make mkdir_internal static to open.c
(This used to be commit 6dd0886b49969d0edfe16861f19d35275217b2af)
Diffstat (limited to 'source3/smbd/reply.c')
-rw-r--r--source3/smbd/reply.c50
1 files changed, 2 insertions, 48 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 282779fcd3..a156409942 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -3745,46 +3745,6 @@ int reply_printwrite(connection_struct *conn, char *inbuf,char *outbuf, int dum_
}
/****************************************************************************
- The guts of the mkdir command, split out so it may be called by the NT SMB
- code.
-****************************************************************************/
-
-NTSTATUS mkdir_internal(connection_struct *conn, const pstring directory, BOOL bad_path)
-{
- int ret= -1;
-
- if(!CAN_WRITE(conn)) {
- DEBUG(5,("mkdir_internal: failing create on read-only share %s\n", lp_servicename(SNUM(conn))));
- return NT_STATUS_ACCESS_DENIED;
- }
-
- if (bad_path) {
- return NT_STATUS_OBJECT_PATH_NOT_FOUND;
- }
-
- if (!check_name(directory, conn)) {
- if(errno == ENOENT) {
- if (bad_path) {
- return NT_STATUS_OBJECT_PATH_NOT_FOUND;
- } else {
- return NT_STATUS_OBJECT_NAME_NOT_FOUND;
- }
- }
- return map_nt_error_from_unix(errno);
- }
-
- ret = vfs_MkDir(conn,directory,unix_mode(conn,aDIR,directory,True));
- if (ret == -1) {
- if(errno == ENOENT) {
- return NT_STATUS_OBJECT_NAME_NOT_FOUND;
- }
- return map_nt_error_from_unix(errno);
- }
-
- return NT_STATUS_OK;
-}
-
-/****************************************************************************
Reply to a mkdir.
****************************************************************************/
@@ -3795,7 +3755,6 @@ int reply_mkdir(connection_struct *conn, char *inbuf,char *outbuf, int dum_size,
NTSTATUS status;
BOOL bad_path = False;
SMB_STRUCT_STAT sbuf;
- files_struct *fsp;
START_PROFILE(SMBmkdir);
@@ -3809,12 +3768,9 @@ int reply_mkdir(connection_struct *conn, char *inbuf,char *outbuf, int dum_size,
unix_convert(directory,conn,0,&bad_path,&sbuf);
- status = open_directory(conn, directory, &sbuf,
- FILE_READ_ATTRIBUTES, /* Just a stat open */
- FILE_SHARE_NONE, /* Ignored for stat opens */
- FILE_CREATE, 0, NULL, &fsp);
+ status = create_directory(conn, directory);
- DEBUG(1, ("open_directory returned %s\n", nt_errstr(status)));
+ DEBUG(1, ("create_directory returned %s\n", nt_errstr(status)));
if (!NT_STATUS_IS_OK(status)) {
@@ -3833,8 +3789,6 @@ int reply_mkdir(connection_struct *conn, char *inbuf,char *outbuf, int dum_size,
return ERROR_NT(status);
}
- close_file(fsp, NORMAL_CLOSE);
-
outsize = set_message(outbuf,0,0,False);
DEBUG( 3, ( "mkdir %s ret=%d\n", directory, outsize ) );