[SCM] Samba Shared Repository - branch v4-0-test updated

Karolin Seeger kseeger at samba.org
Tue Apr 1 03:34:06 MDT 2014


The branch, v4-0-test has been updated
       via  fc185a5 tevent: fix crash bug in tevent_queue_immediate_trigger()
       via  f9e8a9e lsa.idl: define lsa.ForestTrustCollisionInfo and ForestTrustCollisionRecord as public structs
       via  ecfe72f s3-rpc_server: Fix handling of fragmented rpc requests.
       via  2170b8c s3:rpc_server: minor refactoring of process_request_pdu()
       via  eec2818 pidl-waf: Only install Yapp::Driver if it is not available.
       via  f21b897 pidl-waf: Check for system perl(Parse::Yapp::Driver).
       via  fb992a8 pidl-waf: Add a function to check for a system perl module.
       via  50567ff pidl-waf: Do not glob to install pidl modules.
       via  667a59c pidl-waf: Install pidl modules to the perl vendorlib directory.
       via  10573dd pidl-waf: Remove unused variable pidl_src.
       via  60b8f8f autobuild: Set perl vendorlib direcotry.
       via  f46447a buildtools: Add perl vendorlib configure option.
       via  503d0ff buildtools: Rename perl vendorarch configure option.
       via  cd208b2 dns: Extend tests for records with another type
       via  7bac6e0 bug #10471: Don't respond with NXDOMAIN to records that exist with another type
       via  67fc5bf s3: smbd: Fileserving share access checks.
       via  c96bac8 smbreadline: switch to new-style readline typedef
       via  e53c10d s4:lib/socket: simplify iface_list_wildcard() and its callers
       via  74aa879 s4:lib/socket: use the same logic in iface_list_wildcard() as in smbd
       via  5f4c1bb s3:smbd: s/BUFFER_SIZE/LARGE_WRITEX_BUFFER_SIZE
       via  a42b892 s3:smbd: fix the maxentries calculation depending on the max_send.
       via  03f9c61 s3:smbd: simplify maxentries calculation in reply_search()
       via  00a60ed s3:smbd: fix the read numtoread calculation depending on the max_send.
       via  e915655 s3:smbd: fix the lockread numtoread calculation depending on the max_send.
       via  93e5454 s3:smbd: pass the final numtoread reply_outbuf() for the lockread reply.
       via  e6b365a s3:smbd: fix lockread numtoread calculation to match reply_outbuf() arguments.
       via  9da034e s3:smbd: take less than SMB_BUFFER_SIZE_MIN ('500') as header overhead in ipc.c
       via  1039e5f s3:smbd: reject a MaxBufferSize < SMB_BUFFER_SIZE_MIN (500) in a session setup request
       via  a5ce91c s3:smbd: use sconn->smb1.sessions.max_send = SMB_BUFFER_SIZE_MAX
       via  1c13590 s3:smbd: use SMB_BUFFER_SIZE_MIN/MAX to limit lp_max_xmit()
       via  e06ff86 s3:include: let CLI_BUFFER_SIZE be an alias of SMB_BUFFER_SIZE_MAX
       via  b6ee584 libcli/smb: add SMB_BUFFER_SIZE_MIN/MAX defines
       via  1fac62c s3:param: avoid using BUFFER_SIZE to limit the lp_min_receive_file_size()
       via  ab7c46c s3:client: only limit the buffer by the given length 'n'
       via  eeb901b s3:torture: use CLI_BUFFER_SIZE instead of BUFFER_SIZE
       via  e98e7b0 s3:utils/smbfilter: use a local variable for the packet buffer
       via  57cd00c s3:smbd: avoid invalid lock_order panic triggered by "CTDB_SRVID_RELEASE_IP"
       via  f850683 s3:lib/ctdbd_conn: let release_ip_handler return bool
       via  95b04d7 s3:smbd: maintain smbd_server_connection->status
       via  c759f09 s3:smbd: simplify exit_server_common()
       via  1560850 s3:smbd: s/EVENT_FD/TEVENT_FD
       via  626fc22 doc: add "spoolss: architecture" parameter usage
       via  33419d8 s4: smbtorture: Add a proper change_notify going async followed by tdis test.
       via  25464e3 s4: smbtorture: Update the torture_smb2_notify_ulogoff test to demonstrate the problem.
       via  77d1158 s3:smb2_tcon: cancel and wait for pending requests on tdis
       via  e736677 s3:smb2_sesssetup: cancel and wait for pending requests on logoff
       via  37b51d7 s3:smb2_tcon: split smbd_smb2_tdis into an async *_send/recv pair.
       via  5f8bc31 s3:smb2_sesssetup: split smbd_smb2_logoff into an async *_send/recv pair.
       via  f7cc9d0 s3:smb2_lock: return RANGE_NOT_LOCKED instead of CANCELLED for logoff and tdis
       via  53ae5fb s3:smb2_lock: fix whitespaces/tabs in smbd_smb2_lock_cancel()
       via  6896d0c s4:torture/smb2: accept NT_STATUS_RANGE_NOT_LOCKED after smb2_logoff/tdis
       via  b86c4fa s3: lib: Back-port tevent_queue_wait_send/recv -> smbd_tevent_queue_wait_send/recv
       via  87a0240 tevent: fix crash bug in tevent_queue_immediate_trigger()
      from  e42fd53 Merge tag 'samba-4.0.16' into v4-0-test

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit fc185a5f4cb34f4a2488eb336844c32812f930e7
Author: Stefan Metzmacher <metze at samba.org>
Date:   Sat Jan 11 08:58:05 2014 +0100

    tevent: fix crash bug in tevent_queue_immediate_trigger()
    
    Assume we we have a queue with 2 entries (A and B with triggerA() and triggerB()).
    If triggerA() removes itself tevent_queue_entry_destructor() will be called
    for A, this schedules the immediate event to call triggerB().
    If triggerA() then also removes B by an explicit of implizit talloc_free(),
    q->list is NULL, but the immediate event is still scheduled and can't be unscheduled.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    (cherry picked from commit 7fe5584e2a59584431cb2ddf8a4da22bfb924454)
    
    Autobuild-User(v4-0-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-0-test): Tue Apr  1 11:33:36 CEST 2014 on sn-devel-104

commit f9e8a9ef616f025e02bab6f4847a8e424c9625e6
Author: Alexander Bokovoy <ab at samba.org>
Date:   Tue Mar 18 19:41:38 2014 +0200

    lsa.idl: define lsa.ForestTrustCollisionInfo and ForestTrustCollisionRecord as public structs
    
    For Python bindings PIDL wants the struct to be defined as public if we
    want to use __ndr_print/pack/unpack.
    
    Define the [public] attribute to ForestTrustCollisionInfo/Record to
    allow easier debugging when there is collision in establishing a trust.
    
    This change does not affect C code as NDR functions are always
    generated, only not exposed in Python bindings.
    
    https://bugzilla.samba.org/show_bug.cgi?id=10504
    
    Signed-off-by: Alexander Bokovoy <ab at samba.org>
    Reviewed-by: Jelmer Vernooij <jelmer at samba.org>
    
    Autobuild-User(master): Alexander Bokovoy <ab at samba.org>
    Autobuild-Date(master): Mon Mar 24 12:44:50 CET 2014 on sn-devel-104
    
    (cherry picked from commit 59767911bded48388c27d5f9cd2ff1346a1c01a6)

commit ecfe72f19e64e2e253c52e96e13fd29fd2ac36bb
Author: Andreas Schneider <asn at cryptomilk.org>
Date:   Thu Mar 20 14:45:01 2014 +0100

    s3-rpc_server: Fix handling of fragmented rpc requests.
    
    We need to call pipe_init_outgoing_data() as the first thing in
    process_complete_pdu(). Otherwise the caller may use uninitialized
    memory and tries to write a response into the socket.
    
    The problem happens only if a real socket is used, which means
    in all cases for master and only with external rpc daemons in v4-0
    and v4-1.
    
    The problem looks like this in the logs.
    
        [2014/03/20 14:49:35.531663, 10, pid=7309, effective(0, 0), real(0, 0), class=rpc_srv] ../source3/rpc_server/srv_pipe.c:1627(process_complete_pdu)
          Processing packet type 0
        [2014/03/20 14:49:35.531695, 10, pid=7309, effective(0, 0), real(0, 0), class=rpc_srv] ../source3/rpc_server/srv_pipe.c:1472(dcesrv_auth_request)
          Checking request auth.
        [2014/03/20 14:49:35.531738, 10, pid=7309, effective(0, 0), real(0, 0)] ../source3/rpc_server/rpc_server.c:521(named_pipe_packet_process)
          Sending 1 fragments in a total of 0 bytes
        [2014/03/20 14:49:35.531769, 10, pid=7309, effective(0, 0), real(0, 0)] ../source3/rpc_server/rpc_server.c:526(named_pipe_packet_process)
          Sending PDU number: 0, PDU Length: 4294967228
        [2014/03/20 14:49:35.531801,  2, pid=7309, effective(0, 0), real(0, 0)] ../source3/rpc_server/rpc_server.c:565(named_pipe_packet_done)
          Writev failed!
        [2014/03/20 14:49:35.531845,  2, pid=7309, effective(0, 0), real(0, 0)] ../source3/rpc_server/rpc_server.c:595(named_pipe_packet_done)
          Fatal error(Message too long). Terminating client(127.0.0.1) connection!
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10481
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    Signed-off-by: Andreas Schneider <asn at cryptomilk.org>
    Reviewed-by: Guenther Deschner <gd at samba.org
    
    Autobuild-User(master): Günther Deschner <gd at samba.org>
    Autobuild-Date(master): Thu Mar 20 18:30:17 CET 2014 on sn-devel-104
    
    (cherry picked from commit 5277fc4d0393ffe2e415ad26610b36d2986c62d7)

commit 2170b8cf6bf0cbda7d5c83981eeccb834e03931c
Author: Gregor Beck <gbeck at sernet.de>
Date:   Thu Jan 9 10:15:31 2014 +0100

    s3:rpc_server: minor refactoring of process_request_pdu()
    
    Signed-off-by: Gregor Beck <gbeck at sernet.de>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>
    (cherry picked from commit b5f30205931a4b9d0b3b257d5855869e606f8b63)

commit eec2818e0f92c84cebdc5bd3cd50ad9aea677b7d
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Feb 28 16:00:54 2014 +0100

    pidl-waf: Only install Yapp::Driver if it is not available.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Thu Mar  6 23:30:47 CET 2014 on sn-devel-104
    
    The last 9 patches address bug #10472 - pidl: waf should have an option
    for the dir to install perl files and do not glob.

commit f21b897357e94675b5228618421ce7d3aafb659b
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Feb 28 15:59:45 2014 +0100

    pidl-waf: Check for system perl(Parse::Yapp::Driver).
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit fb992a82291628bd40b0bf7d232f417605aa77f1
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Feb 28 15:59:41 2014 +0100

    pidl-waf: Add a function to check for a system perl module.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit 50567ff57847bff2f4d72cd563a3d517d4de51c3
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Feb 28 15:55:46 2014 +0100

    pidl-waf: Do not glob to install pidl modules.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit 667a59c35448dd69d1c5e5c9feedc243490cf44d
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Feb 28 15:53:10 2014 +0100

    pidl-waf: Install pidl modules to the perl vendorlib directory.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit 10573dd7cbd54dc85efd6ae54c18290b542559d2
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Feb 28 15:54:09 2014 +0100

    pidl-waf: Remove unused variable pidl_src.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit 60b8f8f61db0fd85e20a009d7274d19b470fbd65
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Mar 5 16:27:15 2014 +0100

    autobuild: Set perl vendorlib direcotry.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit f46447a3400bb17fc194485bedcf6ee1c281dff1
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Feb 28 15:50:02 2014 +0100

    buildtools: Add perl vendorlib configure option.
    
    After this patch has been pushed, we need to change autobuild to compile
    with this option or we will not be able to install pidl.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit 503d0ff6173a815872ffb1117ebca2c3808df398
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Feb 28 15:47:45 2014 +0100

    buildtools: Rename perl vendorarch configure option.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit cd208b2605d9b68ab37cba1ab64798c05fb59357
Author: Kai Blin <kai at samba.org>
Date:   Fri Feb 28 10:35:07 2014 +0100

    dns: Extend tests for records with another type
    
    Add another check to the one added for bug #10471, for added paranoia
    
    Signed-off-by: Kai Blin <kai at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Kai Blin <kai at samba.org>
    Autobuild-Date(master): Tue Mar  4 15:47:10 CET 2014 on sn-devel-104
    
    (cherry picked from commit 5bd47bb563c3736b9de1a3a93bdf46a498928643)

commit 7bac6e022a1bc966c4b7128048d7faa48c524348
Author: Kai Blin <kai at samba.org>
Date:   Thu Feb 27 23:49:24 2014 +0100

    bug #10471: Don't respond with NXDOMAIN to records that exist with another type
    
    DNS queries for records with the wrong type need to trigger an empty
    response with RCODE_OK instead of returning NXDOMAIN.
    
    This adds a test and fixes bug #10471
    
    Signed-off-by: Kai Blin <kai at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit d9829df13317b38677d92a499134727ab31fbb0e)

commit 67fc5bff3761225223d03a44a5069f6a759aa828
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Mar 17 14:48:30 2014 -0700

    s3: smbd: Fileserving share access checks.
    
    Git commit 86d1e1db8e2747e30c89627cda123fde1e84f579
    fixed share_access not being reset between users,
    by changing make_connection_snum() to call a common
    function check_user_share_access() in the same way
    that change_to_user() (which can be called on any
    incoming packet) does.
    
    Unfortunately that bugfix was incorrect and
    broke "force user" and "force group" as it
    called check_user_share_access() inside
    make_connection_snum() using the conn->session_info
    pointer instead of the vuser->session_info pointer.
    
    conn->session_info represents the token to use
    when actually accessing the file system, and so
    is modified by force user and force group.
    
    vuser->session_info represents the "pristine"
    token of the user logging in, and is never modified
    by force user and force group.
    
    Samba 3.6.x checked the share access based on
    the "pristine" token of the user logging in,
    not the token modified by force user and force group.
    This change restores the expected behavior.
    
    Fixes bug #9878 - force user does not work as expected
    
    https://bugzilla.samba.org/show_bug.cgi?id=9878
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit c96bac899e5ae40bb65c60c9aab767a04dd4ff0f
Author: Gustavo Zacarias <gustavo at zacarias.com.ar>
Date:   Thu Mar 6 18:57:40 2014 -0300

    smbreadline: switch to new-style readline typedef
    
    Function, CPFunction, CPPFunction and VFunction typedefs are considered
    old-style (deprecated) starting from readline 4.2 (circa 2001).
    Compatibility typedefs have been in place up to readline 6.2 but were
    removed with the 6.3 release thus causing builds to break.
    Switch to the new-style specific prototyped typedef.
    
    Return value is unused so the callback should still be void (see
    readline/input.c around line 456 in version 6.3).
    
    Signed-off-by: Gustavo Zacarias <gustavo at zacarias.com.ar>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Thu Mar 13 00:21:47 CET 2014 on sn-devel-104
    
    (cherry picked from commit 29d779c7029f89e530994c45ae065707ffd62c43)
    
    Fix bug #10506 - smbreadline doesn't build with readline 6.3.

commit e53c10dcf9df032b8a3d0cafa9411e0f16b652a6
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Feb 27 10:28:23 2014 +0100

    s4:lib/socket: simplify iface_list_wildcard() and its callers
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10464
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    
    Change-Id: Ib317d71dea01fc8ef6b6a26455f15a8a175d59f6
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Fri Mar  7 02:18:17 CET 2014 on sn-devel-104
    (cherry picked from commit f7883ae02a4e8935a44396f776712cebfd411e52)

commit 74aa879af2c20feda1b3f94de0317bac8e89002a
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Feb 27 10:18:35 2014 +0100

    s4:lib/socket: use the same logic in iface_list_wildcard() as in smbd
    
    If we have ipv6 support we should listen on "::" too.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10464
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    
    Change-Id: I8ce185d5070280149bee9fd33010443be9031089
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit a571fe520d09a00273a58b1fb0fa9aab8e0aefce)

commit 5f4c1bbc6cc127a03e53f60ebefeeb20a7d79bff
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Dec 6 13:56:12 2013 +0100

    s3:smbd: s/BUFFER_SIZE/LARGE_WRITEX_BUFFER_SIZE
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Wed Mar  5 22:53:34 CET 2014 on sn-devel-104
    (cherry picked from commit 032621d5bf842e60dc9cd1cd0d3acc90482462a6)

commit a42b892a7188e995a62f34f451098d11e2db1f7c
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Mar 5 14:03:42 2014 +0100

    s3:smbd: fix the maxentries calculation depending on the max_send.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit c899d4fd9c5a337ab82acdf11866df50fb0629e0)

commit 03f9c6123ac5c283c4933cd292c68ea55b6b27c1
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Mar 5 14:00:40 2014 +0100

    s3:smbd: simplify maxentries calculation in reply_search()
    
    Using helper variables make it much easier to understand.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 734e1b65044a33eba01b41695502c2257c1a4d9e)

commit 00a60edb2ecea5c9d98ef1010f403d05842a1dc0
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Mar 4 14:07:26 2014 +0100

    s3:smbd: fix the read numtoread calculation depending on the max_send.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 8b746f5a2137b74e28bce5370f5aa9d4bcdac6c2)

commit e9156554b4f044710826281330bcda09ede64c13
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Mar 4 14:07:26 2014 +0100

    s3:smbd: fix the lockread numtoread calculation depending on the max_send.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit f69be2c28e097c66907df264794706006fe0ae7f)

commit 93e54547d95d386f36ab3b8b8cd06bd10cc13813
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Mar 4 14:07:26 2014 +0100

    s3:smbd: pass the final numtoread reply_outbuf() for the lockread reply.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit b86f90611820bcf7826bd1de3c7b05488a8f1b0e)

commit e6b365a56582999dd6ef856fc00e777a82e2b4ea
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Mar 4 14:07:26 2014 +0100

    s3:smbd: fix lockread numtoread calculation to match reply_outbuf() arguments.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 3dac00b568613f5a1322883237e40b98ddd1d71d)

commit 9da034e1d453ea9136d13a4036862317ec2526c1
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Dec 6 13:53:45 2013 +0100

    s3:smbd: take less than SMB_BUFFER_SIZE_MIN ('500') as header overhead in ipc.c
    
    We're now sure that sconn->smb1.sessions.max_send is >= SMB_BUFFER_SIZE_MIN.
    in order to garantee some progress we need to make sure our assumed
    header overhead is less than SMB_BUFFER_SIZE_MIN.
    
    Assuming 372 bytes for the SMBtrans headers should still be more than
    enough.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 2ec49cf57c88735be962b0681b487df5efe7ed6b)

commit 1039e5fd2b02a9062e1b38f868a5cf1ce6b00116
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Dec 6 13:52:09 2013 +0100

    s3:smbd: reject a MaxBufferSize < SMB_BUFFER_SIZE_MIN (500) in a session setup request
    
    This makes sure sconn->smb1.sessions.max_send is always >= SMB_BUFFER_SIZE_MIN.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit cce1eaea91088efd742891befdaafade0c1fdce6)

commit a5ce91c1deda58de4820451d27365dead2af6ef0
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Dec 6 13:50:49 2013 +0100

    s3:smbd: use sconn->smb1.sessions.max_send = SMB_BUFFER_SIZE_MAX
    
    SMB_BUFFER_SIZE_MAX is UINT16_MAX and the largest value a client
    can possibly specify in the session setup request.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 5cd5c1613996ecebdcd632e932957947f4c27308)

commit 1c135902213239d04b97449dc3011983a54a683d
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Dec 6 13:45:35 2013 +0100

    s3:smbd: use SMB_BUFFER_SIZE_MIN/MAX to limit lp_max_xmit()
    
    The current limit of 128*1024 causes problems as the value has to be
    <= UINT16_MAX otherwise some clients get confused, as they want to
    use the MaxBufferSize value from the negprot response (uint32_t)
    for the MaxBufferSize value in thet session setup request (uint16_t).
    E.g. Windows 7 (as client) sends MaxBufferSize = 0 if the server value
    is > UINT16_MAX.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit a349b0bef9085fd139640ec92399bc63d8029cb9)

commit e06ff86a1a3d2f828da88d613f5fe262165671e5
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Dec 6 13:57:15 2013 +0100

    s3:include: let CLI_BUFFER_SIZE be an alias of SMB_BUFFER_SIZE_MAX
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 7f3faa1f1837870195352253fe220e0677565d9e)

commit b6ee584b48cd9635de127962f0e5408cc44e2970
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Dec 6 13:28:35 2013 +0100

    libcli/smb: add SMB_BUFFER_SIZE_MIN/MAX defines
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 900839e2216048a614f2f0aeb1f79092fc93334f)

commit 1fac62c518402ca2bf321be68280c6820a63c425
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Feb 19 13:59:07 2014 +0100

    s3:param: avoid using BUFFER_SIZE to limit the lp_min_receive_file_size()
    
    There's really no reason to add such limit.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 74f8c3568a5dcdee108a0526cefac9d282361044)

commit ab7c46cc04abf5cc9380ca499462cd4257b96281
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Feb 19 13:57:28 2014 +0100

    s3:client: only limit the buffer by the given length 'n'
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit f0f245f4c8b1a506e8d06c72d3d6680b95738714)

commit eeb901b60cb489548e38fd7c429d4a1946684e1d
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Feb 19 13:56:06 2014 +0100

    s3:torture: use CLI_BUFFER_SIZE instead of BUFFER_SIZE
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 05e821b220328b88dd9eece919b8adee3e4281ac)

commit e98e7b0c8edbbec4b78a67f4393c2f89b7403aca
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Feb 19 13:54:44 2014 +0100

    s3:utils/smbfilter: use a local variable for the packet buffer
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 3667a2eee388915fca2b894ae37375eeed46e941)

commit 57cd00c570102f43c56e6b16f74c32ee16bf3af4
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Feb 13 15:36:27 2014 +0100

    s3:smbd: avoid invalid lock_order panic triggered by "CTDB_SRVID_RELEASE_IP"
    
    If smbd_server_connection_terminate("CTDB_SRVID_RELEASE_IP") is triggered from
    within ctdbd_migrate(), we got a smb_panic complaining about invalid
    lock_order, as ctdbd_migrate is called from dbwrap_fetch_locked().
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10444
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Fri Feb 21 14:51:51 CET 2014 on sn-devel-104
    (cherry picked from commit 33f10d06baf44e31d558bc5bd926c886915322cc)

commit f850683502a45489110b1240c6f94dc6ddb373fe
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Feb 17 11:57:52 2014 +0100

    s3:lib/ctdbd_conn: let release_ip_handler return bool
    
    If it returns true the passed ip address matched and we
    let a nested ctdb operation fail with NT_STATUS_ADDRESS_CLOSED.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    (cherry picked from commit 9677fae6aab26d2bf0884dc31516d2dcd8840c03)

commit 95b04d7fec1662e806ed1a1506a469c80540a31a
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Feb 17 12:01:12 2014 +0100

    s3:smbd: maintain smbd_server_connection->status
    
    If this isn't NT_STATUS_OK, we skip any io on the socket.
    
    This avoids possible problems during shutdown.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    (cherry picked from commit 52ccb40d595fc80bfa53b0b9cd75ffb902369681)

commit c759f0964e69d87dae5ec4f59820f8c278ad9597
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Feb 17 12:05:42 2014 +0100

    s3:smbd: simplify exit_server_common()
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    (cherry picked from commit 58c71bee40bb91868fc69d8f7fa640db0e33efae)

commit 15608504ac1ca78cd54fa42056600cb2299b94b1
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Feb 18 10:18:57 2013 +0100

    s3:smbd: s/EVENT_FD/TEVENT_FD
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    (cherry picked from commit 2672c37a8fbc9ff4e5b74e9a5ae55a3e08beed43)

commit 626fc22cfc766ab9033c7d313821aed15e4933d2
Author: David Disseldorp <ddiss at samba.org>
Date:   Mon Oct 14 12:01:58 2013 +0200

    doc: add "spoolss: architecture" parameter usage
    
    Windows spoolss print clients only allow association of server-side
    drivers with printers when the driver architecture matches the
    advertised print server architecture. Samba's spoolss print server
    architecture can be changed using this parameter.
    
    Signed-off-by: David Disseldorp <ddiss at samba.org>
    Reviewed-by: Günther Deschner <gd at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Günther Deschner <gd at samba.org>
    Autobuild-Date(master): Wed Oct 16 17:12:34 CEST 2013 on sn-devel-104
    
    (cherry picked from commit b92937e64ed7ce3c7cdd4da0e263c7a53da45c49)
    
    Fix bug #10188 - spoolss: architecture is undocumented.

commit 33419d8790dbc3e233f8f8f377fb534f5b376a95
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Feb 24 10:44:59 2014 -0800

    s4: smbtorture: Add a proper change_notify going async followed by tdis test.
    
    [Bug 10344] SessionLogoff on a signed connection with an outstanding notify request crashes smbd.
    
    https://bugzilla.samba.org/show_bug.cgi?id=10344
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Wed Mar 12 20:12:58 CET 2014 on sn-devel-104
    
    (cherry picked from commit 9c677fff0bb0abc8d19dd67c33b3e044b1a9862e)

commit 25464e3bcb59e59d506a6b364adf039854d238bf
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Jan 28 14:07:26 2014 -0800

    s4: smbtorture: Update the torture_smb2_notify_ulogoff test to demonstrate the problem.
    
    [Bug 10344] SessionLogoff on a signed connection with an outstanding notify request crashes smbd.
    
    https://bugzilla.samba.org/show_bug.cgi?id=10344
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit 3a727d5d39bab05fa7237e32ffe244ddfebb0ee0)

commit 77d1158c6638c86a7fd2376ac1589b87f2c5abaa
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Mar 10 09:53:18 2014 +0100

    s3:smb2_tcon: cancel and wait for pending requests on tdis
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10344
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 95f96a81083be578ee638c0cebd590228d9a4424)

commit e73667715d3cfc63c003c251e1387ddecf16c186
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Mar 10 09:53:18 2014 +0100

    s3:smb2_sesssetup: cancel and wait for pending requests on logoff
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10344
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 7c26475d58a003888b7ba6f17f649cca6d93f6f3)

commit 37b51d777646f85eca1a66754d7848943408a4c1
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Mar 10 09:53:18 2014 +0100

    s3:smb2_tcon: split smbd_smb2_tdis into an async *_send/recv pair.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10344
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit 195c2d84807a7580e90e288cc813a6c6ca596055)
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit 5f8bc313622eb36bf74d19bd33cb6c25a1784195
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Mar 10 09:53:18 2014 +0100

    s3:smb2_sesssetup: split smbd_smb2_logoff into an async *_send/recv pair.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10344
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit 506817dfc9d18c2c5c35d60a6e61a82917665e2d)
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit f7cc9d095afeef4adde6ba7c07ef6b3d4885f3a9
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Mar 10 09:47:11 2014 +0100

    s3:smb2_lock: return RANGE_NOT_LOCKED instead of CANCELLED for logoff and tdis
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 4d1d288b89d259f1b69eb3ed643b86d39e03f6bf)

commit 53ae5fb4fcbf91f7d71a43f40c4f0bcfe758afe2
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Mar 10 09:43:35 2014 +0100

    s3:smb2_lock: fix whitespaces/tabs in smbd_smb2_lock_cancel()
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit b49893776167460d921822362e1b55abdd5cc751)

commit 6896d0c164105ff6c7b06430bd716f2fd6599ee7
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Mar 7 12:31:19 2014 +0100

    s4:torture/smb2: accept NT_STATUS_RANGE_NOT_LOCKED after smb2_logoff/tdis
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 0e4f23991f33bed708e99210e5940abc050e5933)

commit b86c4faa19a85b4bd34d36e96fc7f10d9f1fccfc
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Mar 13 10:06:48 2014 -0700

    s3: lib: Back-port tevent_queue_wait_send/recv -> smbd_tevent_queue_wait_send/recv
    
    Required for bugfix:
    
    [Bug 10344] SessionLogoff on a signed connection with an outstanding notify request crashes smbd.
    
    https://bugzilla.samba.org/show_bug.cgi?id=10344
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit 87a02403ee4fcc404dc3b887a851c421660cb4d8
Author: Stefan Metzmacher <metze at samba.org>
Date:   Sat Jan 11 08:58:05 2014 +0100

    tevent: fix crash bug in tevent_queue_immediate_trigger()
    
    Assume we we have a queue with 2 entries (A and B with triggerA() and triggerB()).
    If triggerA() removes itself tevent_queue_entry_destructor() will be called
    for A, this schedules the immediate event to call triggerB().
    If triggerA() then also removes B by an explicit of implizit talloc_free(),
    q->list is NULL, but the immediate event is still scheduled and can't be unscheduled.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    (cherry picked from commit 7fe5584e2a59584431cb2ddf8a4da22bfb924454)

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

Summary of changes:
 buildtools/wafadmin/Tools/perl.py                  |   23 ++-
 .../smbdotconf/printing/spoolssarchitecture.xml    |   15 ++
 lib/tevent/tevent_queue.c                          |    8 +
 libcli/smb/smb_constants.h                         |    8 +
 libcli/smbreadline/smbreadline.c                   |    2 +-
 librpc/idl/lsa.idl                                 |    4 +-
 pidl/lib/wscript_build                             |   35 ++++-
 pidl/wscript                                       |   30 +++-
 python/samba/tests/dns.py                          |   30 ++++
 script/autobuild.py                                |    7 +-
 source3/Makefile.in                                |    2 +-
 source3/client/client.c                            |    2 +-
 source3/include/client.h                           |    2 +-
 source3/include/ctdbd_conn.h                       |    2 +-
 source3/include/smb.h                              |    4 +-
 source3/lib/ctdbd_conn.c                           |   36 ++++-
 .../lib/smbd_tevent_queue.c                        |   59 ++++---
 .../kerberos.h => source3/lib/smbd_tevent_queue.h  |   31 ++--
 source3/param/loadparm.c                           |    2 +-
 source3/rpc_server/srv_pipe.c                      |   40 ++---
 source3/smbd/globals.h                             |    1 +
 source3/smbd/ipc.c                                 |   10 +-
 source3/smbd/process.c                             |   91 +++++++++--
 source3/smbd/reply.c                               |   54 +++---
 source3/smbd/server_exit.c                         |   17 ++-
 source3/smbd/service.c                             |   12 +-
 source3/smbd/sesssetup.c                           |   19 ++-
 source3/smbd/smb2_lock.c                           |   42 ++++--
 source3/smbd/smb2_server.c                         |   16 ++
 source3/smbd/smb2_sesssetup.c                      |  183 ++++++++++++++++++--
 source3/smbd/smb2_tcon.c                           |  180 ++++++++++++++++++--
 source3/torture/torture.c                          |    2 +-
 source3/utils/smbfilter.c                          |    2 +-
 source3/wscript_build                              |    1 +
 source4/cldap_server/cldap_server.c                |    2 +-
 source4/dns_server/dns_query.c                     |   14 +-
 source4/dns_server/dns_server.c                    |    8 +-
 source4/kdc/kdc.c                                  |    2 +-
 source4/ldap_server/ldap_server.c                  |    4 +-
 source4/lib/socket/interface.c                     |   26 +---
 source4/rpc_server/dcerpc_server.c                 |    4 +-
 source4/smb_server/service_smb.c                   |    4 +-
 source4/torture/smb2/lock.c                        |   24 ++--
 source4/torture/smb2/notify.c                      |   88 +++++++++-
 source4/web_server/web_server.c                    |    4 +-
 45 files changed, 896 insertions(+), 256 deletions(-)
 create mode 100644 docs-xml/smbdotconf/printing/spoolssarchitecture.xml
 copy lib/tevent/tevent_wakeup.c => source3/lib/smbd_tevent_queue.c (53%)
 copy lib/replace/system/kerberos.h => source3/lib/smbd_tevent_queue.h (61%)


Changeset truncated at 500 lines:

diff --git a/buildtools/wafadmin/Tools/perl.py b/buildtools/wafadmin/Tools/perl.py
index a6787a8..8f13e28 100644
--- a/buildtools/wafadmin/Tools/perl.py
+++ b/buildtools/wafadmin/Tools/perl.py
@@ -98,12 +98,27 @@ def check_perl_ext_devel(conf):
 	conf.env.EXTUTILS_TYPEMAP  = read_out('print "$Config{privlib}/ExtUtils/typemap"')
 	conf.env.perlext_PATTERN   = '%s.' + read_out('print $Config{dlext}')[0]
 
-	if getattr(Options.options, 'perlarchdir', None):
-		conf.env.ARCHDIR_PERL = Options.options.perlarchdir
+	if getattr(Options.options, 'perl_vendorarch_dir', None):
+		conf.env.PERL_VENDORARCH_DIR = Options.options.perl_vendorarch_dir
 	else:
-		conf.env.ARCHDIR_PERL = read_out('print $Config{sitearch}')[0]
+		conf.env.PERL_VENDORARCH_DIR = read_out('print $Config{vendorarch}')[0]
+
+	if getattr(Options.options, 'perl_vendorlib_dir', None):
+		conf.env.PERL_VENDORLIB_DIR = Options.options.perl_vendorlib_dir
+	else:
+		conf.env.PERL_VENDORLIB_DIR = read_out('print $Config{vendorlib}')[0]
 
 def set_options(opt):
 	opt.add_option("--with-perl-binary", type="string", dest="perlbinary", help = 'Specify alternate perl binary', default=None)
-	opt.add_option("--with-perl-archdir", type="string", dest="perlarchdir", help = 'Specify directory where to install arch specific files', default=None)
 
+	opt.add_option("--with-perl-vendorarch",
+		       type="string",
+		       dest="perl_vendorarch_dir",
+		       help = ('Specify directory where to install arch specific files'),
+		       default=None)
+
+	opt.add_option("--with-perl-vendorlib",
+		       type="string",
+		       dest="perl_vendorlib_dir",
+		       help = ('Specify directory where to install vendor specific files'),
+		       default=None)
diff --git a/docs-xml/smbdotconf/printing/spoolssarchitecture.xml b/docs-xml/smbdotconf/printing/spoolssarchitecture.xml
new file mode 100644
index 0000000..5ce9f13
--- /dev/null
+++ b/docs-xml/smbdotconf/printing/spoolssarchitecture.xml
@@ -0,0 +1,15 @@
+<samba:parameter name="spoolss: architecture"
+		 context="G"
+		 type="string"
+		 advanced="1"
+		 developer="1"
+		 xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
+<description>
+	<para>Windows spoolss print clients only allow association of server-side drivers
+	with printers when the driver architecture matches the advertised print server
+	architecture. Samba's spoolss print server architecture can be changed using
+	this parameter.</para>
+</description>
+<value type="default">Windows NT x86</value>
+<value type="example">Windows x64</value>
+</samba:parameter>
diff --git a/lib/tevent/tevent_queue.c b/lib/tevent/tevent_queue.c
index 4750675..e324680 100644
--- a/lib/tevent/tevent_queue.c
+++ b/lib/tevent/tevent_queue.c
@@ -140,6 +140,14 @@ static void tevent_queue_immediate_trigger(struct tevent_context *ev,
 		return;
 	}
 
+	if (!q->list) {
+		return;
+	}
+
+	if (!q->list) {
+		return;
+	}
+
 	q->list->triggered = true;
 	q->list->trigger(q->list->req, q->list->private_data);
 }
diff --git a/libcli/smb/smb_constants.h b/libcli/smb/smb_constants.h
index bcfd84e..639bd7c 100644
--- a/libcli/smb/smb_constants.h
+++ b/libcli/smb/smb_constants.h
@@ -208,6 +208,14 @@ enum smb_signing_setting {
 #define NEGOTIATE_SECURITY_SIGNATURES_ENABLED	0x04
 #define NEGOTIATE_SECURITY_SIGNATURES_REQUIRED	0x08
 
+/*
+ * The negotiated buffer size for non LARGE_READX/WRITEX
+ * should be limited to uint16_t and has to be at least
+ * 500, which is the default for MinClientBufferSize on Windows.
+ */
+#define SMB_BUFFER_SIZE_MIN 500
+#define SMB_BUFFER_SIZE_MAX 65535
+
 /* Capabilities.  see ftp.microsoft.com/developr/drg/cifs/cifs/cifs4.txt */
 
 #define CAP_RAW_MODE		0x00000001
diff --git a/libcli/smbreadline/smbreadline.c b/libcli/smbreadline/smbreadline.c
index cff25a7..80e10b0 100644
--- a/libcli/smbreadline/smbreadline.c
+++ b/libcli/smbreadline/smbreadline.c
@@ -141,7 +141,7 @@ char *smb_readline(const char *prompt, void (*callback)(void),
 
 #if HAVE_DECL_RL_EVENT_HOOK
 	if (callback)
-		rl_event_hook = (Function *)callback;
+		rl_event_hook = (rl_hook_func_t *)callback;
 #endif
 	ret = readline(prompt);
 	if (ret && *ret)
diff --git a/librpc/idl/lsa.idl b/librpc/idl/lsa.idl
index d8f2649..80efbd5 100644
--- a/librpc/idl/lsa.idl
+++ b/librpc/idl/lsa.idl
@@ -1328,14 +1328,14 @@ import "misc.idl", "security.idl";
 		[default] uint32 flags;
 	} lsa_ForestTrustCollisionFlags;
 
-	typedef struct {
+	typedef [public] struct {
 		uint32 index;
 		lsa_ForestTrustCollisionRecordType type;
 		[switch_is(type)] lsa_ForestTrustCollisionFlags flags;
 		lsa_String name;
 	} lsa_ForestTrustCollisionRecord;
 
-	typedef struct {
+	typedef [public] struct {
 		uint32 count;
 		[size_is(count)] lsa_ForestTrustCollisionRecord **entries;
 	} lsa_ForestTrustCollisionInfo;
diff --git a/pidl/lib/wscript_build b/pidl/lib/wscript_build
index eb5f1e0..5023e07 100644
--- a/pidl/lib/wscript_build
+++ b/pidl/lib/wscript_build
@@ -1,4 +1,37 @@
 #!/usr/bin/env python
 
 # install the pidl modules
-bld.INSTALL_WILDCARD('${DATAROOTDIR}/perl5', '**/*.pm', flat=False)
+bld.INSTALL_FILES(bld.env.PERL_VENDORLIB_DIR,
+                  '''
+                  Parse/Pidl.pm
+                  Parse/Pidl/Samba4.pm
+                  Parse/Pidl/CUtil.pm
+                  Parse/Pidl/Expr.pm
+                  Parse/Pidl/Wireshark/Conformance.pm
+                  Parse/Pidl/Wireshark/NDR.pm
+                  Parse/Pidl/ODL.pm
+                  Parse/Pidl/Dump.pm
+                  Parse/Pidl/Util.pm
+                  Parse/Pidl/Samba4/Header.pm
+                  Parse/Pidl/Samba4/COM/Header.pm
+                  Parse/Pidl/Samba4/COM/Proxy.pm
+                  Parse/Pidl/Samba4/COM/Stub.pm
+                  Parse/Pidl/Samba4/TDR.pm
+                  Parse/Pidl/Samba4/NDR/Server.pm
+                  Parse/Pidl/Samba4/NDR/Client.pm
+                  Parse/Pidl/Samba4/NDR/Parser.pm
+                  Parse/Pidl/Samba4/Python.pm
+                  Parse/Pidl/Samba4/Template.pm
+                  Parse/Pidl/IDL.pm
+                  Parse/Pidl/Typelist.pm
+                  Parse/Pidl/Samba3/ClientNDR.pm
+                  Parse/Pidl/Samba3/ServerNDR.pm
+                  Parse/Pidl/Compat.pm
+                  Parse/Pidl/NDR.pm
+                  ''',
+                  flat=False)
+
+if not bld.CONFIG_SET('USING_SYSTEM_PARSE_YAPP_DRIVER'):
+    bld.INSTALL_FILES(bld.env.PERL_VENDORLIB_DIR,
+                      'Parse/Yapp/Driver.pm',
+                      flat=False)
diff --git a/pidl/wscript b/pidl/wscript
index 7a25734..4965870 100644
--- a/pidl/wscript
+++ b/pidl/wscript
@@ -3,11 +3,38 @@
 import os, sys, Logs
 from samba_utils import MODE_755
 
+# This function checks if a perl module is installed on the system.
+def check_system_perl_module(conf, module, version=None):
+    bundle_name = module.replace('::', '_')
+    module_check = module
+    found = False
+
+    # Create module string with version
+    if version:
+        module_check = module + ' ' + str(version)
+
+    # Check if we have to bundle it.
+    if conf.LIB_MUST_BE_BUNDLED(bundle_name.lower()):
+        return False
+
+    # Check for system perl module
+    if not conf.check_perl_module(module_check):
+        return False
+
+    conf.define('USING_SYSTEM_%s' % bundle_name.upper(), 1)
+
+    return True
+
 def set_options(opt):
     opt.tool_options('perl')
 
 def configure(conf):
     conf.check_tool('perl')
+    conf.check_perl_ext_devel()
+
+    # Check if perl(Parse::Yapp::Driver) is available.
+    check_system_perl_module(conf, "Parse::Yapp::Driver", 1.05)
+
     # we need a recent version of MakeMaker to get the right man page names
     if conf.CHECK_PERL_MANPAGE():
         conf.env.PERLMAN1EXT = conf.CHECK_PERL_MANPAGE(section='1')
@@ -26,9 +53,6 @@ def build(bld):
     if not bld.CONFIG_SET('HAVE_PERL_MAKEMAKER'):
         return
 
-    pidl_src = ['pidl']
-    pidl_src.extend(bld.path.ant_glob('lib/**/*.pm').split())
-
     pidl_manpages = {
         'pidl': 'man1/pidl.${PERLMAN1EXT}',
         'lib/Parse/Pidl/NDR.pm': 'man3/Parse::Pidl::NDR.${PERLMAN3EXT}',
diff --git a/python/samba/tests/dns.py b/python/samba/tests/dns.py
index 0ac9cf4..f2c5685 100644
--- a/python/samba/tests/dns.py
+++ b/python/samba/tests/dns.py
@@ -171,6 +171,36 @@ class TestSimpleQueries(DNSTest):
         self.assertEquals(response.answers[0].rdata,
                           os.getenv('SERVER_IP'))
 
+    def test_one_mx_query(self):
+        "create a query packet causing an empty RCODE_OK answer"
+        p = self.make_name_packet(dns.DNS_OPCODE_QUERY)
+        questions = []
+
+        name = "%s.%s" % (os.getenv('SERVER'), self.get_dns_domain())
+        q = self.make_name_question(name, dns.DNS_QTYPE_MX, dns.DNS_QCLASS_IN)
+        print "asking for ", q.name
+        questions.append(q)
+
+        self.finish_name_packet(p, questions)
+        response = self.dns_transaction_udp(p)
+        self.assert_dns_rcode_equals(response, dns.DNS_RCODE_OK)
+        self.assert_dns_opcode_equals(response, dns.DNS_OPCODE_QUERY)
+        self.assertEquals(response.ancount, 0)
+
+        p = self.make_name_packet(dns.DNS_OPCODE_QUERY)
+        questions = []
+
+        name = "invalid-%s.%s" % (os.getenv('SERVER'), self.get_dns_domain())
+        q = self.make_name_question(name, dns.DNS_QTYPE_MX, dns.DNS_QCLASS_IN)
+        print "asking for ", q.name
+        questions.append(q)
+
+        self.finish_name_packet(p, questions)
+        response = self.dns_transaction_udp(p)
+        self.assert_dns_rcode_equals(response, dns.DNS_RCODE_NXDOMAIN)
+        self.assert_dns_opcode_equals(response, dns.DNS_OPCODE_QUERY)
+        self.assertEquals(response.ancount, 0)
+
     def test_two_queries(self):
         "create a query packet containing two query records"
         p = self.make_name_packet(dns.DNS_OPCODE_QUERY)
diff --git a/script/autobuild.py b/script/autobuild.py
index 1182d7f..cb822ff 100755
--- a/script/autobuild.py
+++ b/script/autobuild.py
@@ -59,7 +59,7 @@ tasks = {
                       ("clean", "make clean", "text/plain") ],
 
     # We have 'test' before 'install' because, 'test' should work without 'install'
-    "samba" : [ ("configure", "./configure.developer ${PREFIX} --with-selftest-prefix=./bin/ab", "text/plain"),
+    "samba" : [ ("configure", "./configure.developer ${PREFIX} ${PERL_VENDOR_LIB} --with-selftest-prefix=./bin/ab", "text/plain"),
                 ("make", "make -j", "text/plain"),
                 ("test", "make test FAIL_IMMEDIATELY=1", "text/plain"),
                 ("install", "make install", "text/plain"),
@@ -77,7 +77,7 @@ tasks = {
                      ("ctdb-header-install", "cp ./ctdb/include/* ${PREFIX_DIR}/include", "text/plain"),
                      ("ctdb-header-ls", "ls ${PREFIX_DIR}/include/ctdb.h", "text/plain"),
 
-                     ("configure", "PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure.developer ${PREFIX} --with-selftest-prefix=./bin/ab --with-cluster-support --with-ctdb-dir=${PREFIX_DIR} --bundled-libraries=!tdb", "text/plain"),
+                     ("configure", "PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure.developer ${PREFIX} ${PERL_VENDOR_LIB} --with-selftest-prefix=./bin/ab --with-cluster-support --with-ctdb-dir=${PREFIX_DIR} --bundled-libraries=!tdb", "text/plain"),
                      ("make", "make", "text/plain"),
                      ("check", "./bin/smbd -b | grep CLUSTER_SUPPORT", "text/plain"),
                      ("install", "make install", "text/plain"),
@@ -102,7 +102,7 @@ tasks = {
                       ("ldb-make", "cd lib/ldb && make", "text/plain"),
                       ("ldb-install", "cd lib/ldb && make install", "text/plain"),
 
-                      ("configure", "PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=!talloc,!tdb,!pytdb,!ldb,!pyldb,!tevent,!pytevent --abi-check --enable-debug -C ${PREFIX}", "text/plain"),
+                      ("configure", "PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=!talloc,!tdb,!pytdb,!ldb,!pyldb,!tevent,!pytevent --abi-check --enable-debug -C ${PREFIX} ${PERL_VENDOR_LIB}", "text/plain"),
                       ("make", "make", "text/plain"),
                       ("install", "make install", "text/plain")],
 
@@ -232,6 +232,7 @@ class builder(object):
         self.cmd = self.cmd.replace("${PYTHON_PREFIX}", get_python_lib(standard_lib=1, prefix=self.prefix))
         self.cmd = self.cmd.replace("${PREFIX}", "--prefix=%s" % self.prefix)
         self.cmd = self.cmd.replace("${PREFIX_DIR}", "%s" % self.prefix)
+        self.cmd = self.cmd.replace("${PERL_VENDOR_LIB}", "--with-perl-vendorlib=%s/share/perl5" % self.prefix)
 #        if self.output_mime_type == "text/x-subunit":
 #            self.cmd += " | %s --immediate" % (os.path.join(os.path.dirname(__file__), "selftest/format-subunit"))
         print '%s: [%s] Running %s' % (self.name, self.stage, self.cmd)
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 96727fc..ad3112c 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -495,7 +495,7 @@ LIB_OBJ = $(LIBSAMBAUTIL_OBJ) $(UTIL_OBJ) $(CRYPTO_OBJ) $(LIBTSOCKET_OBJ) \
 	  lib/fncall.o \
 	  libads/krb5_errs.o lib/system_smbd.o lib/audit.o $(LIBNDR_OBJ) \
 	  lib/file_id.o lib/idmap_cache.o \
-	  lib/tevent_wait.o \
+	  lib/tevent_wait.o lib/smbd_tevent_queue.o \
 	  ../libcli/security/dom_sid.o ../libcli/security/security_descriptor.o \
 	  ../libcli/security/security_token.o ../libcli/security/util_sid.o \
 	  ../libcli/smb/util.o ../lib/util/idtree.o
diff --git a/source3/client/client.c b/source3/client/client.c
index 49519af..a3a1d0a 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -235,7 +235,7 @@ static int readfile(uint8_t *b, int n, XFILE *f)
 		return x_fread(b,1,n,f);
 
 	i = 0;
-	while (i < (n - 1) && (i < BUFFER_SIZE)) {
+	while (i < (n - 1)) {
 		if ((c = x_getc(f)) == EOF) {
 			break;
 		}
diff --git a/source3/include/client.h b/source3/include/client.h
index f6aacea..6ba843c 100644
--- a/source3/include/client.h
+++ b/source3/include/client.h
@@ -22,7 +22,7 @@
 #ifndef _CLIENT_H
 #define _CLIENT_H
 
-#define CLI_BUFFER_SIZE (0xFFFF)
+#define CLI_BUFFER_SIZE SMB_BUFFER_SIZE_MAX
 
 /*
  * These definitions depend on smb.h
diff --git a/source3/include/ctdbd_conn.h b/source3/include/ctdbd_conn.h
index 5778a92..426c1ac 100644
--- a/source3/include/ctdbd_conn.h
+++ b/source3/include/ctdbd_conn.h
@@ -74,7 +74,7 @@ NTSTATUS ctdbd_traverse(uint32_t db_id,
 NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn,
 			    const struct sockaddr_storage *server,
 			    const struct sockaddr_storage *client,
-			    void (*release_ip_handler)(const char *ip_addr,
+			    bool (*release_ip_handler)(const char *ip_addr,
 						       void *private_data),
 			    void *private_data);
 
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 0057b44..e2603aa 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -32,11 +32,9 @@
 /* logged when starting the various Samba daemons */
 #define COPYRIGHT_STARTUP_MESSAGE	"Copyright Andrew Tridgell and the Samba Team 1992-2012"
 
-
-#define BUFFER_SIZE (128*1024)
-
 #define SAFETY_MARGIN 1024
 #define LARGE_WRITEX_HDR_SIZE 65
+#define LARGE_WRITEX_BUFFER_SIZE (128*1024)
 
 #define NMB_PORT 137
 #define DGRAM_PORT 138
diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c
index 84f26e0..e826685 100644
--- a/source3/lib/ctdbd_conn.c
+++ b/source3/lib/ctdbd_conn.c
@@ -59,7 +59,7 @@ struct ctdbd_connection {
 	struct ctdb_packet_context *pkt;
 	struct fd_event *fde;
 
-	void (*release_ip_handler)(const char *ip_addr, void *private_data);
+	bool (*release_ip_handler)(const char *ip_addr, void *private_data);
 	void *release_ip_priv;
 };
 
@@ -427,10 +427,23 @@ static NTSTATUS ctdb_read_req(struct ctdbd_connection *conn, uint32_t reqid,
 
 		if ((conn->release_ip_handler != NULL)
 		    && (msg->srvid == CTDB_SRVID_RELEASE_IP)) {
+			bool ret;
+
 			/* must be dispatched immediately */
 			DEBUG(10, ("received CTDB_SRVID_RELEASE_IP\n"));
-			conn->release_ip_handler((const char *)msg->data,
-						 conn->release_ip_priv);
+			ret = conn->release_ip_handler((const char *)msg->data,
+						       conn->release_ip_priv);
+			if (ret) {
+				/*
+				 * We need to release the ip,
+				 * so return an error to the upper layers.
+				 *
+				 * We make sure we don't trigger this again.
+				 */
+				conn->release_ip_handler = NULL;
+				conn->release_ip_priv = NULL;
+				return NT_STATUS_ADDRESS_CLOSED;
+			}
 			TALLOC_FREE(hdr);
 			goto next_pkt;
 		}
@@ -629,10 +642,21 @@ static NTSTATUS ctdb_handle_message(uint8_t *buf, size_t length,
 
 	if ((conn->release_ip_handler != NULL)
 	    && (msg->srvid == CTDB_SRVID_RELEASE_IP)) {
+		bool ret;
+
 		/* must be dispatched immediately */
 		DEBUG(10, ("received CTDB_SRVID_RELEASE_IP\n"));
-		conn->release_ip_handler((const char *)msg->data,
-					 conn->release_ip_priv);
+		ret = conn->release_ip_handler((const char *)msg->data,
+					       conn->release_ip_priv);
+		if (ret) {
+			/*
+			 * We need to release the ip.
+			 *
+			 * We make sure we don't trigger this again.
+			 */
+			conn->release_ip_handler = NULL;
+			conn->release_ip_priv = NULL;
+		}
 		TALLOC_FREE(buf);
 		return NT_STATUS_OK;
 	}
@@ -1693,7 +1717,7 @@ static void smbd_ctdb_canonicalize_ip(const struct sockaddr_storage *in,
 NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn,
 			    const struct sockaddr_storage *_server,
 			    const struct sockaddr_storage *_client,
-			    void (*release_ip_handler)(const char *ip_addr,
+			    bool (*release_ip_handler)(const char *ip_addr,
 						       void *private_data),
 			    void *private_data)
 {
diff --git a/lib/tevent/tevent_wakeup.c b/source3/lib/smbd_tevent_queue.c
similarity index 53%
copy from lib/tevent/tevent_wakeup.c
copy to source3/lib/smbd_tevent_queue.c
index 82c3942..421f77d 100644
--- a/lib/tevent/tevent_wakeup.c
+++ b/source3/lib/smbd_tevent_queue.c
@@ -22,49 +22,60 @@
    License along with this library; if not, see <http://www.gnu.org/licenses/>.
 */
 
+/* Back-port of missing API from 4.2.x for tevent_queues. */
+
 #include "replace.h"
-#include "tevent.h"
-#include "tevent_internal.h"
-#include "tevent_util.h"
+#include <tevent.h>
+#include "source3/lib/smbd_tevent_queue.h"
 
-struct tevent_wakeup_state {
-	struct timeval wakeup_time;
+struct tevent_queue_wait_state {
+	uint8_t dummy;
 };
 
-struct tevent_req *tevent_wakeup_send(TALLOC_CTX *mem_ctx,
-				      struct tevent_context *ev,
-				      struct timeval wakeup_time)
+static void tevent_queue_wait_trigger(struct tevent_req *req,
+				      void *private_data);
+
+struct tevent_req *smbd_tevent_queue_wait_send(TALLOC_CTX *mem_ctx,
+					  struct tevent_context *ev,
+					  struct tevent_queue *queue)
 {
 	struct tevent_req *req;
-	struct tevent_wakeup_state *state;
+	struct tevent_queue_wait_state *state;
+	bool ok;
 
 	req = tevent_req_create(mem_ctx, &state,
-				struct tevent_wakeup_state);
-	if (!req) {
+				struct tevent_queue_wait_state);
+	if (req == NULL) {
 		return NULL;
 	}
-	state->wakeup_time = wakeup_time;
 
-	if (!tevent_req_set_endtime(req, ev, wakeup_time)) {
-		goto post;
+	ok = tevent_queue_add(queue, ev, req,
+			      tevent_queue_wait_trigger,


-- 
Samba Shared Repository


More information about the samba-cvs mailing list