mirror of
https://github.com/samba-team/samba.git
synced 2025-02-04 17:47:26 +03:00
r24084: Convert reply_mkdir to the new API
(This used to be commit e93f3996fcdde6f0fbba3fb9e1e97407e9ccdd62)
This commit is contained in:
parent
ef97e2dece
commit
68513d521d
@ -634,7 +634,7 @@ static const struct smb_message_struct {
|
||||
int flags;
|
||||
} smb_messages[256] = {
|
||||
|
||||
/* 0x00 */ { "SMBmkdir",reply_mkdir,NULL,AS_USER | NEED_WRITE},
|
||||
/* 0x00 */ { "SMBmkdir",NULL,reply_mkdir,AS_USER | NEED_WRITE},
|
||||
/* 0x01 */ { "SMBrmdir",reply_rmdir,NULL,AS_USER | NEED_WRITE},
|
||||
/* 0x02 */ { "SMBopen",reply_open,NULL,AS_USER },
|
||||
/* 0x03 */ { "SMBcreate",reply_mknew,NULL,AS_USER},
|
||||
|
@ -3952,42 +3952,50 @@ int reply_printwrite(connection_struct *conn, char *inbuf,char *outbuf, int dum_
|
||||
Reply to a mkdir.
|
||||
****************************************************************************/
|
||||
|
||||
int reply_mkdir(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize)
|
||||
void reply_mkdir(connection_struct *conn, struct smb_request *req)
|
||||
{
|
||||
pstring directory;
|
||||
int outsize;
|
||||
NTSTATUS status;
|
||||
SMB_STRUCT_STAT sbuf;
|
||||
|
||||
START_PROFILE(SMBmkdir);
|
||||
|
||||
srvstr_get_path(inbuf, SVAL(inbuf,smb_flg2), directory,
|
||||
smb_buf(inbuf) + 1, sizeof(directory), 0,
|
||||
srvstr_get_path((char *)req->inbuf, req->flags2, directory,
|
||||
smb_buf(req->inbuf) + 1, sizeof(directory), 0,
|
||||
STR_TERMINATE, &status);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
reply_nterror(req, status);
|
||||
END_PROFILE(SMBmkdir);
|
||||
return ERROR_NT(status);
|
||||
return;
|
||||
}
|
||||
|
||||
status = resolve_dfspath(conn, SVAL(inbuf,smb_flg2) & FLAGS2_DFS_PATHNAMES, directory);
|
||||
status = resolve_dfspath(conn,
|
||||
req->flags2 & FLAGS2_DFS_PATHNAMES,
|
||||
directory);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
END_PROFILE(SMBmkdir);
|
||||
if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) {
|
||||
return ERROR_BOTH(NT_STATUS_PATH_NOT_COVERED, ERRSRV, ERRbadpath);
|
||||
reply_botherror(req, NT_STATUS_PATH_NOT_COVERED,
|
||||
ERRSRV, ERRbadpath);
|
||||
END_PROFILE(SMBmkdir);
|
||||
return;
|
||||
}
|
||||
return ERROR_NT(status);
|
||||
reply_nterror(req, status);
|
||||
END_PROFILE(SMBmkdir);
|
||||
return;
|
||||
}
|
||||
|
||||
status = unix_convert(conn, directory, False, NULL, &sbuf);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
reply_nterror(req, status);
|
||||
END_PROFILE(SMBmkdir);
|
||||
return ERROR_NT(status);
|
||||
return;
|
||||
}
|
||||
|
||||
status = check_name(conn, directory);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
reply_nterror(req, status);
|
||||
END_PROFILE(SMBmkdir);
|
||||
return ERROR_NT(status);
|
||||
return;
|
||||
}
|
||||
|
||||
status = create_directory(conn, directory);
|
||||
@ -4007,16 +4015,17 @@ int reply_mkdir(connection_struct *conn, char *inbuf,char *outbuf, int dum_size,
|
||||
status = NT_STATUS_DOS(ERRDOS, ERRnoaccess);
|
||||
}
|
||||
|
||||
reply_nterror(req, status);
|
||||
END_PROFILE(SMBmkdir);
|
||||
return ERROR_NT(status);
|
||||
return;
|
||||
}
|
||||
|
||||
outsize = set_message(inbuf,outbuf,0,0,False);
|
||||
reply_outbuf(req, 0, 0);
|
||||
|
||||
DEBUG( 3, ( "mkdir %s ret=%d\n", directory, outsize ) );
|
||||
DEBUG( 3, ( "mkdir %s\n", directory ) );
|
||||
|
||||
END_PROFILE(SMBmkdir);
|
||||
return(outsize);
|
||||
return;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
Loading…
x
Reference in New Issue
Block a user