[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Tue Jan 7 04:43:04 MST 2014


The branch, master has been updated
       via  6b586c3 s4:librpc: remove recv_data from transport
       via  9d2557d s4:librpc: factor out xxx_send_request() to dcerpc_send_request()
       via  4459131 s4:librpc: factor out xxx_send_read() to dcerpc_send_read()
       via  9832eb6 s4:librpc: factor out xxx_shutdown_pipe() to dcerpc_shutdown_pipe()
       via  30ca477 s4:librpc: factor out xxx_dead() to dcerpc_transport_dead()
       via  3193c27 s4:librpc: remove server_name from transport
       via  383ba3d s4:librpc: make 'struct dcerpc_pipe_connect' private
       via  27d0d32 s4:librpc: remove unused dcerpc_smb2.c
       via  a9bb84c s4:librpc: implement dcerpc_pipe_open_smb2() in dcerpc_smb.c
       via  7352f7f s4:librpc: make use of dcerpc_pipe_open_smb_send/recv for SMB2
       via  45fc961 s4:librpc: pass dcecli_connection instead of dcerpc_pipe to dcerpc_secondary_smb_send()
       via  bebc05a s4:librpc: use dcerpc_binding_dup() instead of talloc_reference()
       via  a08ee93 s4:librpc: pass smbXcli_{conn,session,tcon} to dcerpc_pipe_open_smb_send()
       via  f7b1ff2 s4:librpc: don't talloc_reference smbcli_tree
       via  e6474ba s4:librpc: keep smbcli_tree/smb2_tree as talloc child of dcecli_connection
       via  d230f73 s4:librpc: use tstream_smbXcli_np in dcerpc_smb.c
       via  2ec65ea s4:librpc: use tstream in dcerpc_sock.c
       via  01ea63e s4:librpc: make it possible for the transport to specify the max_xmit/recv_size
       via  0059929 libcli/smb: s/tstream_cli_np/tstream_smbXcli_np
       via  8ec4163 libcli/smb: s/TSTREAM_CLI_NP/TSTREAM_SMBXCLI_NP
       via  024fc73 libcli/smb: move source3/libsmb/cli_np_tstream.c to tstream_smbXcli_np.c
       via  acbd12a s3:libsmb: add a TSTREAM_CLI_NP_DESIRED_ACCESS define as collection of individual flags
       via  eb8869a s3:libsmb: add tstream_cli_np_ref as protection to talloc_free(smbXcli_conn)
       via  46d29d4 s3:libsmb: do not use cli_state internally within cli_np_tstream
       via  6ebbce9 s3:libsmb: let cli_np_tstream use smb1cli_readx
       via  68d8aa4 s3:libsmb: let cli_np_tstream use smb1cli_writex
       via  c25f19e s3:libsmb: let cli_np_tstream use smb1cli_close
       via  a8c6a05 s3:libsmb: let cli_np_tstream use smb1cli_trans
       via  7ebb081 s3:libsmb: let cli_np_tstream use smb1cli_ntcreatex
       via  3d90e93 libcli/smb: add smb1cli_readx*
       via  cb295d7 libcli/smb: add smb1cli_writex*
       via  b9d19e8 libcli/smb: add smb1cli_close*
       via  50f910f libcli/smb: add smb1cli_ntcreatex*
       via  ef28ed6 libcli/smb: move some *TRANSACT_* flags to smb_constants.h
       via  306cba4 libcli/smb: move some FILE_* flags to smb_constants.h
       via  54c0bde midltests: add tests with v1_enum and NDR64
       via  2ba9453 pidl:NDR/Client: avoid useless memcpy()
       via  f50b561 pidl:NDR/Client: fix dcerpc_function() with [out,ref] pointers
       via  662fc2d pidl:NDR/Client: simplify tevent_req_nterror() usage
       via  02c34fe pidl:NDR/Client: add missing TALLOC_FREE(subreq) after dcerpc_binding_handle_call_recv()
       via  3a0fa36 pidl:Samba3/ServerNDR: skip DCERPC pipe elements and leave NULL pointers.
       via  d821661 s4:librpc/rpc: update alloc_hint for each fragment
       via  ce84ade s4:librpc/rpc: remove unused rpc_request->ndr structure
       via  cc899e8 s4:rpc_server: don't support functions DCERPC pipes in remoted backend
       via  ef568f4 librpc/rpc: read the full header in dcerpc_read_ncacn_packet_next_vector()
       via  cd46437 dcerpc.idl: add DCERPC_NCACN_PAYLOAD_OFFSET
       via  4289750 librpc: fix possible memory leak
       via  a0f781c s4:librpc: fix memory leaks in dcerpc_request_recv_data()
       via  b61f717 s4:librpc: fix memory leak in ncacn_pull()
       via  70d8ac6 librpc/ndrdump: free some temporary memory while parsing dcerpc pipe chunks
       via  4cc3388 s4:pyrpc: fix talloc hierachie in dcerpc_InterfaceObject
       via  13ccc5b s4:torture:spoolss_win: fix valgrind problem in test_EnumJobs()
      from  0dc30b9 samba_upgradedns: message the user if they need to change smb.conf

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


- Log -----------------------------------------------------------------
commit 6b586c3cf6c5e342cabdd157c2c0776204e2aad0
Author: Gregor Beck <gbeck at sernet.de>
Date:   Wed Dec 4 14:58:40 2013 +0100

    s4:librpc: remove recv_data from transport
    
    Signed-off-by: Gregor Beck <gbeck at sernet.de>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Tue Jan  7 12:42:32 CET 2014 on sn-devel-104

commit 9d2557d6e468aef9415153ef86b495cdcefc8bf9
Author: Gregor Beck <gbeck at sernet.de>
Date:   Wed Dec 4 15:51:31 2013 +0100

    s4:librpc: factor out xxx_send_request() to dcerpc_send_request()
    
    Signed-off-by: Gregor Beck <gbeck at sernet.de>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 445913133a4999d8435a477373d40318d2fc4b0c
Author: Gregor Beck <gbeck at sernet.de>
Date:   Wed Dec 4 15:51:07 2013 +0100

    s4:librpc: factor out xxx_send_read() to dcerpc_send_read()
    
    Signed-off-by: Gregor Beck <gbeck at sernet.de>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 9832eb6bbfb73018d1a13425a918c402442526c9
Author: Gregor Beck <gbeck at sernet.de>
Date:   Tue Sep 24 12:45:26 2013 +0200

    s4:librpc: factor out xxx_shutdown_pipe() to dcerpc_shutdown_pipe()
    
    Signed-off-by: Gregor Beck <gbeck at sernet.de>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 30ca477c7153999b2bbac87cdbd928bc57ecce51
Author: Gregor Beck <gbeck at sernet.de>
Date:   Tue Sep 24 12:32:50 2013 +0200

    s4:librpc: factor out xxx_dead() to dcerpc_transport_dead()
    
    Signed-off-by: Gregor Beck <gbeck at sernet.de>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 3193c27256b921a9ac3963fe4b66bc42faae941d
Author: Gregor Beck <gbeck at sernet.de>
Date:   Mon Sep 23 13:54:38 2013 +0200

    s4:librpc: remove server_name from transport
    
    Signed-off-by: Gregor Beck <gbeck at sernet.de>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 383ba3dacf213138ca9dc6fceba2c6fc5131cf7d
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Dec 4 14:28:11 2013 +0100

    s4:librpc: make 'struct dcerpc_pipe_connect' private
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 27d0d3210598b334af8584291c6590a06a9750d5
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Sep 19 18:53:34 2013 +0200

    s4:librpc: remove unused dcerpc_smb2.c
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit a9bb84c4b0d572338258c88140b4f3fe2b425675
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Sep 19 18:50:27 2013 +0200

    s4:librpc: implement dcerpc_pipe_open_smb2() in dcerpc_smb.c
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 7352f7f91dcb8fb98a8a33000f3caf8b6a21ce4a
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Sep 19 18:43:06 2013 +0200

    s4:librpc: make use of dcerpc_pipe_open_smb_send/recv for SMB2
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 45fc961932036fb2a0f1847f1606743f0c93c109
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Sep 19 18:36:19 2013 +0200

    s4:librpc: pass dcecli_connection instead of dcerpc_pipe to dcerpc_secondary_smb_send()
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit bebc05a9730ed6a1ca0e0a04334be1988c362447
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Sep 19 18:23:37 2013 +0200

    s4:librpc: use dcerpc_binding_dup() instead of talloc_reference()
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit a08ee93a2fd75b99cfd8ba66c42e08c3f1403bf9
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Sep 19 18:16:16 2013 +0200

    s4:librpc: pass smbXcli_{conn,session,tcon} to dcerpc_pipe_open_smb_send()
    
    This will allow it to be used also for smb2 later.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit f7b1ff2cf4f42562980e18b9b1cb0e262630f338
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Sep 19 17:29:56 2013 +0200

    s4:librpc: don't talloc_reference smbcli_tree
    
    It's the job of the caller to make sure it stays for the
    whole lifetime of the connection.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit e6474ba2c23aa14804b823be2abd8c9c691099ba
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Sep 19 17:26:37 2013 +0200

    s4:librpc: keep smbcli_tree/smb2_tree as talloc child of dcecli_connection
    
    This will avoid the need of talloc_reference later.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit d230f73e97f6dc625e1111a676d1504ac00fb28f
Author: Gregor Beck <gbeck at sernet.de>
Date:   Mon Sep 16 11:51:44 2013 +0200

    s4:librpc: use tstream_smbXcli_np in dcerpc_smb.c
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    
    Signed-off-by: Gregor Beck <gbeck at sernet.de>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 2ec65ea1e76069393b5b4cc66b5dca6865deb893
Author: Gregor Beck <gbeck at sernet.de>
Date:   Wed Sep 4 13:16:05 2013 +0200

    s4:librpc: use tstream in dcerpc_sock.c
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    
    Signed-off-by: Gregor Beck <gbeck at sernet.de>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 01ea63e1a14192c8d463883f3e488f396c47cdcb
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Sep 18 17:29:53 2013 +0200

    s4:librpc: make it possible for the transport to specify the max_xmit/recv_size
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 0059929601781363929124bd94bfb5358112750c
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Nov 29 12:24:50 2013 +0100

    libcli/smb: s/tstream_cli_np/tstream_smbXcli_np
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 8ec416384880e9d28009eb61b1ff83fecbcf8fbc
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Nov 29 12:18:29 2013 +0100

    libcli/smb: s/TSTREAM_CLI_NP/TSTREAM_SMBXCLI_NP
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 024fc73047ffb6bb25dfdfbd99dbd7f490eaaa13
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Sep 13 15:50:10 2013 +0200

    libcli/smb: move source3/libsmb/cli_np_tstream.c to tstream_smbXcli_np.c
    
    This code is generic enough to have it in the top level now.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit acbd12adf90830070db7e5aec088aa3051dfaa63
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Nov 29 11:58:18 2013 +0100

    s3:libsmb: add a TSTREAM_CLI_NP_DESIRED_ACCESS define as collection of individual flags
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit eb8869a43d65767c3f67ed8c1918c8d9db2e294e
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Sep 20 01:11:40 2013 +0200

    s3:libsmb: add tstream_cli_np_ref as protection to talloc_free(smbXcli_conn)
    
    This makes sure that we don't have dangling pointers.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 46d29d46bc065d51e3f7ca6892ccd04cf6ce9bef
Author: Gregor Beck <gbeck at sernet.de>
Date:   Fri Sep 13 12:55:34 2013 +0200

    s3:libsmb: do not use cli_state internally within cli_np_tstream
    
    Signed-off-by: Gregor Beck <gbeck at sernet.de>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 6ebbce96a4fcd1fea8009698e9c0ea8fb4a5e220
Author: Gregor Beck <gbeck at sernet.de>
Date:   Fri Sep 13 09:26:25 2013 +0200

    s3:libsmb: let cli_np_tstream use smb1cli_readx
    
    Signed-off-by: Gregor Beck <gbeck at sernet.de>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 68d8aa41e3d89d329f5f970df1b88e87d873bc01
Author: Gregor Beck <gbeck at sernet.de>
Date:   Thu Sep 12 11:43:30 2013 +0200

    s3:libsmb: let cli_np_tstream use smb1cli_writex
    
    Signed-off-by: Gregor Beck <gbeck at sernet.de>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit c25f19e593bb88486b4d459d2b3df949d6869278
Author: Gregor Beck <gbeck at sernet.de>
Date:   Thu Sep 12 10:10:06 2013 +0200

    s3:libsmb: let cli_np_tstream use smb1cli_close
    
    Signed-off-by: Gregor Beck <gbeck at sernet.de>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit a8c6a05976cee9e94001216eebab6a4ae38ec378
Author: Gregor Beck <gbeck at sernet.de>
Date:   Wed Sep 11 14:16:15 2013 +0000

    s3:libsmb: let cli_np_tstream use smb1cli_trans
    
    Signed-off-by: Gregor Beck <gbeck at sernet.de>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 7ebb0813e6b978692aa481501115e6d9f0a4f341
Author: Gregor Beck <gbeck at sernet.de>
Date:   Wed Sep 11 13:54:31 2013 +0000

    s3:libsmb: let cli_np_tstream use smb1cli_ntcreatex
    
    Signed-off-by: Gregor Beck <gbeck at sernet.de>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 3d90e9346b1e934a529390f9fd37f108264565ff
Author: Gregor Beck <gbeck at sernet.de>
Date:   Thu Sep 12 14:35:35 2013 +0200

    libcli/smb: add smb1cli_readx*
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    
    Signed-off-by: Gregor Beck <gbeck at sernet.de>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit cb295d708d5ea99a59943a4a59d247481a6406c4
Author: Gregor Beck <gbeck at sernet.de>
Date:   Thu Sep 12 11:31:48 2013 +0200

    libcli/smb: add smb1cli_writex*
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    
    Signed-off-by: Gregor Beck <gbeck at sernet.de>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit b9d19e876f002f39a90042231ab5c34ebe24d5c2
Author: Gregor Beck <gbeck at sernet.de>
Date:   Thu Sep 12 09:51:01 2013 +0200

    libcli/smb: add smb1cli_close*
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    
    Signed-off-by: Gregor Beck <gbeck at sernet.de>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 50f910ff5dd8b1e25245e6557eeac5aa09f17557
Author: Gregor Beck <gbeck at sernet.de>
Date:   Tue Sep 10 10:43:35 2013 +0200

    libcli/smb: add smb1cli_ntcreatex*
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    
    Signed-off-by: Gregor Beck <gbeck at sernet.de>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit ef28ed685f55155446a1386d94f8b30b6164be6b
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Nov 29 12:04:36 2013 +0100

    libcli/smb: move some *TRANSACT_* flags to smb_constants.h
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 306cba4b8c3bcf5aa1e13296eaebbe212bb35a48
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Nov 29 12:00:24 2013 +0100

    libcli/smb: move some FILE_* flags to smb_constants.h
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 54c0bde3e98059db8faa26c967c804143e679c8e
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Oct 16 10:06:13 2013 +0200

    midltests: add tests with v1_enum and NDR64
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 2ba9453e9ff5d911a146e786ff8878ef67717366
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Sep 26 20:38:12 2013 +0200

    pidl:NDR/Client: avoid useless memcpy()
    
    If the src and dest pointer of memcpy would be the same
    we should avoid it in order to avoid valgrind warnings.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit f50b561336c7b6c08300e6e477859d1f9fab62c2
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Sep 26 01:20:10 2013 +0200

    pidl:NDR/Client: fix dcerpc_function() with [out,ref] pointers
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 662fc2de8c2896503026a2a4052ed1ea8ce78af5
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Aug 30 08:54:10 2013 +0200

    pidl:NDR/Client: simplify tevent_req_nterror() usage
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 02c34fe4e51b5e62157eaf2de1d0aaf9fc6b8d72
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Aug 30 08:53:18 2013 +0200

    pidl:NDR/Client: add missing TALLOC_FREE(subreq) after dcerpc_binding_handle_call_recv()
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 3a0fa3605b8eb995a8cc4696256129893e1f6f7e
Author: Stefan Metzmacher <metze at samba.org>
Date:   Sat Sep 21 23:46:01 2013 +0200

    pidl:Samba3/ServerNDR: skip DCERPC pipe elements and leave NULL pointers.
    
    We don't support them anyway, but this lets us adding them to the idl
    file and only ignore it on the server.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit d821661484b6f2a4a61cae3f1711cef151526dcc
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Sep 17 14:03:44 2013 +0200

    s4:librpc/rpc: update alloc_hint for each fragment
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit ce84ade56c51f2e29a10be60c311101517145351
Author: Stefan Metzmacher <metze at samba.org>
Date:   Sat Aug 31 11:31:45 2013 +0200

    s4:librpc/rpc: remove unused rpc_request->ndr structure
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit cc899e8d96dee8aadd84c44cdace0fffaf026a8c
Author: Stefan Metzmacher <metze at samba.org>
Date:   Sun Sep 22 08:31:49 2013 +0200

    s4:rpc_server: don't support functions DCERPC pipes in remoted backend
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit ef568f425c4199960bd9eb10c5769902f5eb6593
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Sep 11 12:23:27 2013 +0200

    librpc/rpc: read the full header in dcerpc_read_ncacn_packet_next_vector()
    
    This helps wireshark reassamble the PDUs generated by socket_wrapper.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit cd4643730552674b2a10a37665eeac13c58940a8
Author: Stefan Metzmacher <metze at samba.org>
Date:   Sun Sep 15 16:43:22 2013 +0200

    dcerpc.idl: add DCERPC_NCACN_PAYLOAD_OFFSET
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 4289750211645ce7af6cc236de70382666e72425
Author: Gregor Beck <gbeck at sernet.de>
Date:   Wed Sep 4 13:15:34 2013 +0200

    librpc: fix possible memory leak
    
    Signed-off-by: Gregor Beck <gbeck at sernet.de>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit a0f781cca4fbe9ce462d4b400e18f4fca3470f1f
Author: Stefan Metzmacher <metze at samba.org>
Date:   Sun Sep 22 00:25:55 2013 +0200

    s4:librpc: fix memory leaks in dcerpc_request_recv_data()
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit b61f71730f579ad0b87b299a792a14b8703b91f9
Author: Stefan Metzmacher <metze at samba.org>
Date:   Sun Sep 22 00:25:33 2013 +0200

    s4:librpc: fix memory leak in ncacn_pull()
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 70d8ac63ebd3cb1cf07e0bff85ae6040fba76147
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Sep 10 11:07:48 2013 +0200

    librpc/ndrdump: free some temporary memory while parsing dcerpc pipe chunks
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 4cc3388c034fa43c855fba802a30bbd2e78122be
Author: Stefan Metzmacher <metze at samba.org>
Date:   Sun Jan 5 18:37:41 2014 +0100

    s4:pyrpc: fix talloc hierachie in dcerpc_InterfaceObject
    
    The tevent_context is cached under the connection,
    so we need to make sure it stays arround as long as the connection.
    
    Otherwise it will segfault while dereferencing the tevent_context
    on deallocation if a secondary connection is arround.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 13ccc5b517e873fe61da4ed7c10b26717aa2fa65
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Sep 18 13:10:20 2013 +0200

    s4:torture:spoolss_win: fix valgrind problem in test_EnumJobs()
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

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

Summary of changes:
 libcli/smb/smb1cli_close.c                         |  188 +++
 libcli/smb/smb1cli_create.c                        |  367 ++++++
 libcli/smb/smb1cli_read.c                          |  224 ++++
 libcli/smb/smb1cli_write.c                         |  284 +++++
 libcli/smb/smbXcli_base.h                          |   94 ++
 libcli/smb/smb_constants.h                         |   84 ++
 libcli/smb/tstream_smbXcli_np.c                    | 1337 ++++++++++++++++++++
 libcli/smb/tstream_smbXcli_np.h                    |   52 +
 libcli/smb/wscript                                 |    6 +
 librpc/idl/dcerpc.idl                              |    1 +
 librpc/ndr/ndr.c                                   |    1 +
 librpc/rpc/dcerpc_util.c                           |   12 +-
 librpc/tools/ndrdump.c                             |    7 +-
 pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm            |    3 +-
 pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm           |   32 +-
 source3/include/smb.h                              |   85 --
 source3/libsmb/cli_np_tstream.c                    | 1235 ------------------
 source3/libsmb/cli_np_tstream.h                    |   46 -
 source3/rpc_client/rpc_transport_np.c              |   22 +-
 source3/rpc_client/rpc_transport_tstream.c         |   20 +-
 source3/wscript_build                              |    1 -
 source4/libcli/raw/smb.h                           |   29 -
 source4/libcli/raw/trans2.h                        |   19 -
 source4/librpc/rpc/dcerpc.c                        |  400 ++++++-
 source4/librpc/rpc/dcerpc.h                        |   45 +-
 source4/librpc/rpc/dcerpc_auth.c                   |    2 +-
 source4/librpc/rpc/dcerpc_connect.c                |   83 +-
 source4/librpc/rpc/dcerpc_secondary.c              |    7 +-
 source4/librpc/rpc/dcerpc_smb.c                    |  670 +++-------
 source4/librpc/rpc/dcerpc_smb2.c                   |  558 --------
 source4/librpc/rpc/dcerpc_sock.c                   |  296 +----
 source4/librpc/rpc/dcerpc_util.c                   |    6 +-
 source4/librpc/rpc/pyrpc.c                         |   85 +-
 source4/librpc/wscript_build                       |    2 +-
 source4/rpc_server/remote/dcesrv_remote.c          |   12 +
 source4/torture/rpc/spoolss_win.c                  |    3 +
 .../win32/midltests/valid/midltests_v1_enum_01.idl |   56 +
 .../win32/midltests/valid/midltests_v1_enum_01.txt |   37 +
 38 files changed, 3558 insertions(+), 2853 deletions(-)
 create mode 100644 libcli/smb/smb1cli_close.c
 create mode 100644 libcli/smb/smb1cli_create.c
 create mode 100644 libcli/smb/smb1cli_read.c
 create mode 100644 libcli/smb/smb1cli_write.c
 create mode 100644 libcli/smb/tstream_smbXcli_np.c
 create mode 100644 libcli/smb/tstream_smbXcli_np.h
 delete mode 100644 source3/libsmb/cli_np_tstream.c
 delete mode 100644 source3/libsmb/cli_np_tstream.h
 delete mode 100644 source4/librpc/rpc/dcerpc_smb2.c
 create mode 100644 testprogs/win32/midltests/valid/midltests_v1_enum_01.idl
 create mode 100644 testprogs/win32/midltests/valid/midltests_v1_enum_01.txt


Changeset truncated at 500 lines:

diff --git a/libcli/smb/smb1cli_close.c b/libcli/smb/smb1cli_close.c
new file mode 100644
index 0000000..89fbbba
--- /dev/null
+++ b/libcli/smb/smb1cli_close.c
@@ -0,0 +1,188 @@
+/*
+   Unix SMB/CIFS implementation.
+
+   Copyright (C) Gregor Beck 2013
+   Copyright (C) Stefan Metzmacher 2013
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "includes.h"
+#include "system/network.h"
+#include "lib/util/tevent_ntstatus.h"
+#include "smb_common.h"
+#include "smbXcli_base.h"
+
+struct smb1cli_close_state {
+	uint16_t vwv[3];
+};
+
+static void smb1cli_close_done(struct tevent_req *subreq);
+
+/**
+ * Send an asynchronous SMB_COM_CLOSE request.
+ * <a href="http://msdn.microsoft.com/en-us/library/ee442151.aspx">MS-CIFS 2.2.4.5.1</a>
+ * @see smb1cli_close_recv(), smb1cli_close()
+ *
+ * @param[in] mem_ctx  The memory context for the result.
+ * @param[in] ev The event context to work on.
+ * @param[in] conn The smb connection.
+ * @param[in] timeout_msec If positiv a timeout for the request.
+ * @param[in] pid The process identifier.
+ * @param[in] tcon The smb tree connect.
+ * @param[in] session The smb session.
+ * @param[in] fnum The file id of the file to be closed.
+ * @param[in] last_modified If not 0 or 0xFFFFFFFF request to set modification time to this number of seconds since January 1, 1970.
+ *
+ * @return a tevent_req or NULL.
+ */
+struct tevent_req *smb1cli_close_send(TALLOC_CTX *mem_ctx,
+				      struct tevent_context *ev,
+				      struct smbXcli_conn *conn,
+				      uint32_t timeout_msec,
+				      uint32_t pid,
+				      struct smbXcli_tcon *tcon,
+				      struct smbXcli_session *session,
+				      uint16_t fnum,
+				      uint32_t last_modified)
+{
+	struct tevent_req *req, *subreq;
+	struct smb1cli_close_state *state;
+
+	req = tevent_req_create(mem_ctx, &state, struct smb1cli_close_state);
+	if (req == NULL) {
+		return NULL;
+	}
+
+	SSVAL(state->vwv+0, 0, fnum);
+	SIVALS(state->vwv+1, 0, last_modified);
+
+	subreq = smb1cli_req_send(state, ev, conn, SMBclose,
+				  0, 0, /* *_flags */
+				  0, 0, /* *_flags2 */
+				  timeout_msec, pid, tcon, session,
+				  ARRAY_SIZE(state->vwv), state->vwv,
+				  0, NULL);
+	if (tevent_req_nomem(subreq, req)) {
+		return tevent_req_post(req, ev);
+	}
+	tevent_req_set_callback(subreq, smb1cli_close_done, req);
+	return req;
+}
+
+static void smb1cli_close_done(struct tevent_req *subreq)
+{
+	struct tevent_req *req = tevent_req_callback_data(
+		subreq, struct tevent_req);
+	struct smb1cli_close_state *state = tevent_req_data(
+		req, struct smb1cli_close_state);
+	NTSTATUS status;
+	static const struct smb1cli_req_expected_response expected[] = {
+	{
+		.status = NT_STATUS_OK,
+		.wct = 0x00
+	},
+	};
+
+	status = smb1cli_req_recv(subreq, state,
+				  NULL, /* recv_iov */
+				  NULL, /* phdr */
+				  NULL, /* wct */
+				  NULL, /* vwv */
+				  NULL, /* pvwv_offset */
+				  NULL, /* num_bytes */
+				  NULL, /* bytes */
+				  NULL, /* pbytes_offset */
+				  NULL, /* inbuf */
+				  expected, ARRAY_SIZE(expected));
+	TALLOC_FREE(subreq);
+	if (tevent_req_nterror(req, status)) {
+		return;
+	}
+
+	tevent_req_done(req);
+}
+
+/**
+ * Receive the response to an asynchronous SMB_COM_CLOSE request.
+ * <a href="http://msdn.microsoft.com/en-us/library/ee441667.aspx">MS-CIFS 2.2.4.5.2</a>
+ *
+ * @param req A tevent_req created with smb1cli_close_send()
+ *
+ * @return NT_STATUS_OK on success
+ */
+NTSTATUS smb1cli_close_recv(struct tevent_req *req)
+{
+	return tevent_req_simple_recv_ntstatus(req);
+}
+
+/**
+ * Send an synchronous SMB_COM_CLOSE request.
+ * <a href="http://msdn.microsoft.com/en-us/library/ee441493.aspx">MS-CIFS 2.2.4.5</a>
+ * @see smb1cli_close_send(), smb1cli_close_recv()
+ *
+ * @param[in] conn The smb connection.
+ * @param[in] timeout_msec If positiv a timeout for the request.
+ * @param[in] pid The process identifier.
+ * @param[in] tcon The smb tree connect.
+ * @param[in] session The smb session.
+ * @param[in] fnum The file id of the file to be closed.
+ * @param[in] last_modified If not 0 or 0xFFFFFFFF request to set modification time to this number of seconds since J
+ *
+ * @return NT_STATUS_OK on success.
+ */
+NTSTATUS smb1cli_close(struct smbXcli_conn *conn,
+		       uint32_t timeout_msec,
+		       uint32_t pid,
+		       struct smbXcli_tcon *tcon,
+		       struct smbXcli_session *session,
+		       uint16_t fnum,
+		       uint32_t last_modified)
+{
+	NTSTATUS status = NT_STATUS_OK;
+	struct tevent_req *req;
+	TALLOC_CTX *frame = talloc_stackframe();
+	struct tevent_context *ev;
+
+	if (smbXcli_conn_has_async_calls(conn)) {
+		/*
+		 * Can't use sync call while an async call is in flight
+		 */
+		status = NT_STATUS_INVALID_PARAMETER;
+		goto done;
+	}
+
+	ev = samba_tevent_context_init(frame);
+	if (ev == NULL) {
+		status = NT_STATUS_NO_MEMORY;
+		goto done;
+	}
+
+	req = smb1cli_close_send(frame, ev, conn,
+				 timeout_msec, pid, tcon, session,
+				 fnum, last_modified);
+	if (req == NULL) {
+		status = NT_STATUS_NO_MEMORY;
+		goto done;
+	}
+
+	if (!tevent_req_poll_ntstatus(req, ev, &status)) {
+		goto done;
+	}
+
+	status = smb1cli_close_recv(req);
+done:
+	talloc_free(frame);
+	return status;
+}
diff --git a/libcli/smb/smb1cli_create.c b/libcli/smb/smb1cli_create.c
new file mode 100644
index 0000000..1963aed
--- /dev/null
+++ b/libcli/smb/smb1cli_create.c
@@ -0,0 +1,367 @@
+/*
+   Unix SMB/CIFS implementation.
+
+   Copyright (C) Gregor Beck 2013
+   Copyright (C) Stefan Metzmacher 2013
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "includes.h"
+#include "system/network.h"
+#include "lib/util/tevent_ntstatus.h"
+#include "smb_common.h"
+#include "smbXcli_base.h"
+
+static uint8_t *internal_bytes_push_str(uint8_t *buf, bool ucs2,
+					const char *str, size_t str_len,
+					bool align_odd,
+					size_t *pconverted_size)
+{
+	TALLOC_CTX *frame = talloc_stackframe();
+	size_t buflen;
+	char *converted;
+	size_t converted_size;
+
+	/*
+	 * This check prevents us from
+	 * (re)alloc buf on a NULL TALLOC_CTX.
+	 */
+	if (buf == NULL) {
+		TALLOC_FREE(frame);
+		return NULL;
+	}
+
+	buflen = talloc_get_size(buf);
+
+	if (ucs2 &&
+	    ((align_odd && (buflen % 2 == 0)) ||
+	     (!align_odd && (buflen % 2 == 1)))) {
+		/*
+		 * We're pushing into an SMB buffer, align odd
+		 */
+		buf = talloc_realloc(NULL, buf, uint8_t, buflen + 1);
+		if (buf == NULL) {
+			TALLOC_FREE(frame);
+			return NULL;
+		}
+		buf[buflen] = '\0';
+		buflen += 1;
+	}
+
+	if (!convert_string_talloc(frame, CH_UNIX,
+				   ucs2 ? CH_UTF16LE : CH_DOS,
+				   str, str_len, &converted,
+				   &converted_size)) {
+		TALLOC_FREE(frame);
+		return NULL;
+	}
+
+	buf = talloc_realloc(NULL, buf, uint8_t,
+			     buflen + converted_size);
+	if (buf == NULL) {
+		TALLOC_FREE(frame);
+		return NULL;
+	}
+
+	memcpy(buf + buflen, converted, converted_size);
+
+	TALLOC_FREE(converted);
+
+	if (pconverted_size) {
+		*pconverted_size = converted_size;
+	}
+
+	TALLOC_FREE(frame);
+	return buf;
+}
+
+static uint8_t *smb_bytes_push_str(uint8_t *buf, bool ucs2,
+				   const char *str, size_t str_len,
+				   size_t *pconverted_size)
+{
+	return internal_bytes_push_str(buf, ucs2, str, str_len,
+				       true, pconverted_size);
+}
+
+struct smb1cli_ntcreatex_state {
+	uint16_t vwv[24];
+	uint16_t fnum;
+};
+
+static void smb1cli_ntcreatex_done(struct tevent_req *subreq);
+
+/**
+ * Send an asynchronous SMB_COM_NT_CREATE_ANDX request.
+ * <a href="http://msdn.microsoft.com/en-us/library/ee442175.aspx">MS-CIFS 2.2.4.64.1</a>
+ * @see smb1cli_ntcreatex_recv(), smb1cli_ntcreatex()
+ *
+ * @param[in] mem_ctx The memory context for the result.
+ * @param[in] ev The event context to work on.
+ * @param[in] conn The smb connection.
+ * @param[in] timeout_msec If positiv a timeout for the request.
+ * @param[in] pid The process identifier
+ * @param[in] tcon The smb tree connect.
+ * @param[in] session The smb session.
+ * @param[in] fname The name of the file or directory to be opened or created.
+ * @param[in] CreatFlags
+ * @param[in] RootDirectoryFid The file id of an opened root directory fname is based on. 0 means root of the share.
+ * @param[in] DesiredAccess A field of flags that indicate standard, specific, and generic access rights to be requested.
+ * @param[in] AllocationSize Number of Bytes to allocate if the file is to be created or overwritten.
+ * @param[in] FileAttributes <a href="http://msdn.microsoft.com/en-us/library/ee878573.aspx">Extended file attributes</a>
+ * @param[in] ShareAccess A field that specifies how the file should be shared with other processes.
+ * @param[in] CreateDisposition A value that represents the action to take if the file already exists or if the file is a new file and does not already exist.
+ * @param[in] CreateOptions  A field of flag options to use if creating a file or directory.
+ * @param[in] ImpersonationLevel
+ * @param[in] SecurityFlags
+ *
+ * @return a tevent_req or NULL
+ */
+struct tevent_req *smb1cli_ntcreatex_send(TALLOC_CTX *mem_ctx,
+					  struct tevent_context *ev,
+					  struct smbXcli_conn *conn,
+					  uint32_t timeout_msec,
+					  uint32_t pid,
+					  struct smbXcli_tcon *tcon,
+					  struct smbXcli_session *session,
+					  const char *fname,
+					  uint32_t CreatFlags,
+					  uint32_t RootDirectoryFid,
+					  uint32_t DesiredAccess,
+					  uint64_t AllocationSize,
+					  uint32_t FileAttributes,
+					  uint32_t ShareAccess,
+					  uint32_t CreateDisposition,
+					  uint32_t CreateOptions,
+					  uint32_t ImpersonationLevel,
+					  uint8_t SecurityFlags)
+{
+	struct tevent_req *req, *subreq;
+	struct smb1cli_ntcreatex_state *state;
+	uint8_t *bytes;
+	size_t converted_len;
+
+	req = tevent_req_create(mem_ctx, &state, struct smb1cli_ntcreatex_state);
+	if (req == NULL) {
+		return NULL;
+	}
+
+	SCVAL(state->vwv+0, 0, 0xFF);
+	SCVAL(state->vwv+0, 1, 0);
+	SSVAL(state->vwv+1, 0, 0);
+	SCVAL(state->vwv+2, 0, 0);
+	SIVAL(state->vwv+3, 1, CreatFlags);
+	SIVAL(state->vwv+5, 1, RootDirectoryFid);
+	SIVAL(state->vwv+7, 1, DesiredAccess);
+	SBVAL(state->vwv+9, 1, AllocationSize);
+	SIVAL(state->vwv+13, 1, FileAttributes);
+	SIVAL(state->vwv+15, 1, ShareAccess);
+	SIVAL(state->vwv+17, 1, CreateDisposition);
+	SIVAL(state->vwv+19, 1, CreateOptions);
+	SIVAL(state->vwv+21, 1, ImpersonationLevel);
+	SCVAL(state->vwv+23, 1, SecurityFlags);
+
+	bytes = talloc_array(state, uint8_t, 0);
+	bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(conn),
+				   fname, strlen(fname)+1,
+				   &converted_len);
+
+	/* sigh. this copes with broken netapp filer behaviour */
+	bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(conn), "", 1, NULL);
+
+	if (tevent_req_nomem(bytes, req)) {
+		return tevent_req_post(req, ev);
+	}
+
+	SSVAL(state->vwv+2, 1, converted_len);
+
+	subreq = smb1cli_req_send(state, ev, conn, SMBntcreateX,
+				  0, 0, /* *_flags */
+				  0, 0, /* *_flags2 */
+				  timeout_msec, pid, tcon, session,
+				  ARRAY_SIZE(state->vwv), state->vwv,
+				  talloc_get_size(bytes), bytes);
+	if (tevent_req_nomem(subreq, req)) {
+		return tevent_req_post(req, ev);
+	}
+	tevent_req_set_callback(subreq, smb1cli_ntcreatex_done, req);
+
+	return req;
+}
+
+static void smb1cli_ntcreatex_done(struct tevent_req *subreq)
+{
+	struct tevent_req *req = tevent_req_callback_data(
+		subreq, struct tevent_req);
+	struct smb1cli_ntcreatex_state *state = tevent_req_data(
+		req, struct smb1cli_ntcreatex_state);
+	struct iovec *recv_iov = NULL;
+	uint8_t wct;
+	uint16_t *vwv;
+	NTSTATUS status;
+	static const struct smb1cli_req_expected_response expected[] = {
+	{
+		.status = NT_STATUS_OK,
+		.wct = 0x22
+	},
+	{
+		/*
+		 * This is the broken version see from
+		 * [MS-SMB]:
+		 * Windows-based SMB servers send 50 (0x32) words in the extended
+		 * response although they set the WordCount field to 0x2A.
+		 *
+		 * And Samba does the same...
+		 */
+		.status = NT_STATUS_OK,
+		.wct = 0x2a
+	},
+	{
+		.status = NT_STATUS_OK,
+		.wct = 0x32
+	},
+	};
+
+	status = smb1cli_req_recv(subreq, state,
+				  &recv_iov,
+				  NULL, /* phdr */
+				  &wct,
+				  &vwv,
+				  NULL, /* pvwv_offset */
+				  NULL, /* num_bytes */
+				  NULL, /* bytes */
+				  NULL, /* pbytes_offset */
+				  NULL, /* inbuf */
+				  expected, ARRAY_SIZE(expected));
+	TALLOC_FREE(subreq);
+	if (tevent_req_nterror(req, status)) {
+		return;
+	}
+
+	state->fnum = SVAL(vwv+2, 1);
+	tevent_req_done(req);
+}
+
+/**
+ * Receive the response to an asynchronous SMB_COM_NT_CREATE_ANDX request.
+ * <a href="http://msdn.microsoft.com/en-us/library/ee441612.aspx">MS-CIFS 2.2.4.64.2</a>
+ *
+ * @param[in] req A tevent request created with smb1cli_ntcreatex_send()
+ * @param[out] pfnum The file id of the opened file or directory.
+ *
+ * @return NT_STATUS_OK on succsess
+ */
+NTSTATUS smb1cli_ntcreatex_recv(struct tevent_req *req, uint16_t *pfnum)
+{
+	struct smb1cli_ntcreatex_state *state = tevent_req_data(
+		req, struct smb1cli_ntcreatex_state);
+	NTSTATUS status;
+
+	if (tevent_req_is_nterror(req, &status)) {
+		tevent_req_received(req);
+		return status;
+	}
+
+	*pfnum = state->fnum;
+	tevent_req_received(req);
+	return NT_STATUS_OK;
+}
+
+
+/**
+ * Send a synchronous SMB_COM_NT_CREATE_ANDX request.
+ * <a href="http://msdn.microsoft.com/en-us/library/ee442091.aspx">MS-CIFS 2.2.4.64</a>
+ * @see smb1cli_ntcreatex_send() smb1cli_ntcreatex_recv()
+ *
+ * @param[in] conn The smb connection.
+ * @param[in] timeout_msec If positiv a timeout for the request.
+ * @param[in] pid The process identifier
+ * @param[in] tcon The smb tree connect.
+ * @param[in] session The smb session.
+ * @param[in] fname The name of the file or directory to be opened or created.
+ * @param[in] CreatFlags
+ * @param[in] RootDirectoryFid The file id of an opened root directory fname is based on. 0 means root of the share.
+ * @param[in] DesiredAccess A field of flags that indicate standard, specific, and generic access rights to be requested.
+ * @param[in] AllocationSize Number of Bytes to allocate if the file is to be created or overwritten.
+ * @param[in] FileAttributes <a href="http://msdn.microsoft.com/en-us/library/ee878573.aspx">Extended file attributes</a>
+ * @param[in] ShareAccess A field that specifies how the file should be shared with other processes.
+ * @param[in] CreateDisposition A value that represents the action to take if the file already exists or if the file is a new file and does not already exist.
+ * @param[in] CreateOptions  A field of flag options to use if creating a file or directory.


-- 
Samba Shared Repository


More information about the samba-cvs mailing list