diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-12-13 23:57:59 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:07:23 -0500 |
commit | 275df9a5c3b1ade9f2467870c3628a2a896c004c (patch) | |
tree | 3138be780e96a2156d03aa602cf54f09be196c22 /source4/smb_server | |
parent | 6ed5055d8e70e5889d8015783bad401d1bfa9c02 (diff) | |
download | samba-275df9a5c3b1ade9f2467870c3628a2a896c004c.tar.gz samba-275df9a5c3b1ade9f2467870c3628a2a896c004c.tar.bz2 samba-275df9a5c3b1ade9f2467870c3628a2a896c004c.zip |
r4182: fixed trans2 mkdir, allowing mkdir with an initial EA list
(This used to be commit 7d981c29c28391813c7f93245f64b3ee108378a4)
Diffstat (limited to 'source4/smb_server')
-rw-r--r-- | source4/smb_server/trans2.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/source4/smb_server/trans2.c b/source4/smb_server/trans2.c index 8f995e2f6a..c3768d6ee0 100644 --- a/source4/smb_server/trans2.c +++ b/source4/smb_server/trans2.c @@ -464,6 +464,47 @@ static NTSTATUS trans2_open(struct smbsrv_request *req, struct smb_trans2 *trans return status; } + +/* + trans2 mkdir implementation +*/ +static NTSTATUS trans2_mkdir(struct smbsrv_request *req, struct smb_trans2 *trans) +{ + union smb_mkdir *io; + NTSTATUS status; + + /* make sure we got enough parameters */ + if (trans->in.params.length < 5) { + return NT_STATUS_FOOBAR; + } + + io = talloc_p(req, union smb_mkdir); + if (io == NULL) { + return NT_STATUS_NO_MEMORY; + } + + io->t2mkdir.level = RAW_MKDIR_T2MKDIR; + trans2_pull_blob_string(req, &trans->in.params, 4, &io->t2mkdir.in.path, 0); + + status = ea_pull_list(&trans->in.data, io, + &io->t2mkdir.in.num_eas, + &io->t2mkdir.in.eas); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + status = ntvfs_mkdir(req, io); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + trans2_setup_reply(req, trans, 2, 0, 0); + + SSVAL(trans->out.params.data, VWV(0), 0); + + return status; +} + /* fill in the reply from a qpathinfo or qfileinfo call */ @@ -1305,6 +1346,8 @@ static NTSTATUS trans2_backend(struct smbsrv_request *req, struct smb_trans2 *tr return trans2_qfsinfo(req, trans); case TRANSACT2_OPEN: return trans2_open(req, trans); + case TRANSACT2_MKDIR: + return trans2_mkdir(req, trans); } /* an unknown trans2 command */ |