summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-02-07 00:49:45 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:17:47 -0500
commitf3f1dd8879af55b675f80c10f5d7f25d65f11385 (patch)
tree17449c9548dad621d97eb36a6b372adfd71f5cd3 /source3
parent15ee7961ef9422ba8b73f87784bda2c286afa87d (diff)
downloadsamba-f3f1dd8879af55b675f80c10f5d7f25d65f11385.tar.gz
samba-f3f1dd8879af55b675f80c10f5d7f25d65f11385.tar.bz2
samba-f3f1dd8879af55b675f80c10f5d7f25d65f11385.zip
r21207: Make the code match the spec :-).
Jeremy. (This used to be commit 36afae2d48a3c3e97d1c2c35275f99d51ba2b64a)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/trans2.c33
1 files changed, 25 insertions, 8 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index d85ed9877d..e20192c3b5 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -4857,25 +4857,25 @@ size = %.0f, uid = %u, gid = %u, raw perms = 0%o\n",
****************************************************************************/
static NTSTATUS smb_posix_mkdir(connection_struct *conn,
- const char *pdata,
+ char **ppdata,
int total_data,
- const char *fname)
+ const char *fname,
+ SMB_STRUCT_STAT *psbuf,
+ int *pdata_return_size)
{
NTSTATUS status;
- SMB_STRUCT_STAT sbuf;
uint32 raw_unixmode;
uint32 mod_unixmode;
mode_t unixmode;
files_struct *fsp;
+ const char *pdata = *ppdata;
if (total_data < 10) {
return NT_STATUS_INVALID_PARAMETER;
}
- ZERO_STRUCT(sbuf);
-
raw_unixmode = IVAL(pdata,8);
- status = unix_perms_from_wire(conn, &sbuf, raw_unixmode, PERM_NEW_DIR, &unixmode);
+ status = unix_perms_from_wire(conn, psbuf, raw_unixmode, PERM_NEW_DIR, &unixmode);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -4884,7 +4884,7 @@ static NTSTATUS smb_posix_mkdir(connection_struct *conn,
status = open_directory(conn,
fname,
- &sbuf,
+ psbuf,
FILE_READ_ATTRIBUTES, /* Just a stat open */
FILE_SHARE_NONE, /* Ignored for stat opens */
FILE_CREATE,
@@ -4896,6 +4896,18 @@ static NTSTATUS smb_posix_mkdir(connection_struct *conn,
if (NT_STATUS_IS_OK(status)) {
close_file(fsp, NORMAL_CLOSE);
}
+
+ *pdata_return_size = 6;
+ /* Realloc the data size */
+ *ppdata = (char *)SMB_REALLOC(*ppdata,*pdata_return_size);
+ if (*ppdata == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ SSVAL(pdata,0,NO_OPLOCK_RETURN);
+ SSVAL(pdata,2,0);
+ SSVAL(pdata,4,SMB_NO_INFO_LEVEL_RETURNED);
+
return status;
}
@@ -4938,7 +4950,12 @@ static NTSTATUS smb_posix_open(connection_struct *conn,
wire_open_mode = IVAL(pdata,4);
if (wire_open_mode == (SMB_O_CREAT|SMB_O_DIRECTORY)) {
- return smb_posix_mkdir(conn, pdata, total_data, fname);
+ return smb_posix_mkdir(conn,
+ ppdata,
+ total_data,
+ fname,
+ psbuf,
+ pdata_return_size);
}
switch (wire_open_mode & SMB_ACCMODE) {