diff options
author | Stefan Metzmacher <metze@samba.org> | 2009-06-02 16:07:53 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2009-06-05 10:50:17 +0200 |
commit | 96de8766fc80881c4398ea11ce65cccbb9b7c83b (patch) | |
tree | a2374bac7d9c3ad5e0b4a508abcf27ad3fff7763 | |
parent | ecd1fe2456acb1c700d7bf91eb0ec76103e7db93 (diff) | |
download | samba-96de8766fc80881c4398ea11ce65cccbb9b7c83b.tar.gz samba-96de8766fc80881c4398ea11ce65cccbb9b7c83b.tar.bz2 samba-96de8766fc80881c4398ea11ce65cccbb9b7c83b.zip |
s3:smbd: add support for printers to SMB2 Create
This is not tested, but the code looks like the
for SMB1, so it's likely to work:-)
metze
-rw-r--r-- | source3/smbd/smb2_create.c | 79 |
1 files changed, 41 insertions, 38 deletions
diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c index 0f955a4df8..8979073045 100644 --- a/source3/smbd/smb2_create.c +++ b/source3/smbd/smb2_create.c @@ -213,47 +213,50 @@ static NTSTATUS smbd_smb2_create(struct smbd_smb2_request *req, return NT_STATUS_NO_MEMORY; } - /* If it's an IPC, pass off the pipe handler. */ - if (IS_IPC(req->tcon->compat_conn)) { + if (IS_IPC(smbreq->conn)) { return NT_STATUS_NOT_IMPLEMENTED; - } - - if (CAN_PRINT(req->tcon->compat_conn)) { - return NT_STATUS_NOT_IMPLEMENTED; - } + } else if (CAN_PRINT(smbreq->conn)) { + status = file_new(smbreq, smbreq->conn, &result); + if(!NT_STATUS_IS_OK(status)) { + return status; + } - switch (in_oplock_level) { - case SMB2_OPLOCK_LEVEL_BATCH: - break; - case SMB2_OPLOCK_LEVEL_EXCLUSIVE: - break; - default: - break; - } - - /* these are ignored for SMB2 */ - in_create_options &= ~(0x10);/* NTCREATEX_OPTIONS_SYNC_ALERT */ - in_create_options &= ~(0x20);/* NTCREATEX_OPTIONS_ASYNC_ALERT */ + status = print_fsp_open(smbreq, + smbreq->conn, + in_name, + smbreq->vuid, + result, + &sbuf); + if (!NT_STATUS_IS_OK(status)) { + file_free(smbreq, result); + return status; + } + info = FILE_WAS_CREATED; + } else { + /* these are ignored for SMB2 */ + in_create_options &= ~(0x10);/* NTCREATEX_OPTIONS_SYNC_ALERT */ + in_create_options &= ~(0x20);/* NTCREATEX_OPTIONS_ASYNC_ALERT */ - status = SMB_VFS_CREATE_FILE(req->tcon->compat_conn, - smbreq, - 0, /* root_dir_fid */ - in_name, - CFF_DOS_PATH, /* create_file_flags */ - in_desired_access, - in_share_access, - in_create_disposition, - in_create_options, - in_file_attributes, - 0, /* oplock_request */ - 0, /* allocation_size */ - NULL, /* security_descriptor */ - NULL, /* ea_list */ - &result, - &info, - &sbuf); - if (!NT_STATUS_IS_OK(status)) { - return status; + status = SMB_VFS_CREATE_FILE(req->tcon->compat_conn, + smbreq, + 0, /* root_dir_fid */ + in_name, + CFF_DOS_PATH, /* create_file_flags */ + in_desired_access, + in_share_access, + in_create_disposition, + in_create_options, + in_file_attributes, + 0, /* oplock_request */ + 0, /* allocation_size */ + NULL, /* security_descriptor */ + NULL, /* ea_list */ + &result, + &info, + &sbuf); + if (!NT_STATUS_IS_OK(status)) { + return status; + } } *out_oplock_level = 0; |