The branch, master has been updated
       via  96de8766fc80881c4398ea11ce65cccbb9b7c83b (commit)
      from  ecd1fe2456acb1c700d7bf91eb0ec76103e7db93 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 96de8766fc80881c4398ea11ce65cccbb9b7c83b
Author: Stefan Metzmacher <me...@samba.org>
Date:   Tue Jun 2 16:07:53 2009 +0200

    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

-----------------------------------------------------------------------

Summary of changes:
 source3/smbd/smb2_create.c |   79 +++++++++++++++++++++++---------------------
 1 files changed, 41 insertions(+), 38 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c
index 0f955a4..8979073 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;


-- 
Samba Shared Repository

Reply via email to