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

Stefan Metzmacher metze at samba.org
Mon Oct 24 12:25:04 UTC 2016


The branch, v4-4-test has been updated
       via  5a0b28a lib: Fix bug 12291
       via  46780e3 s3:libads: don't use MEMORY:ads_sasl_spnego_bind nor set "KRB5CCNAME"
       via  f2a0f86 s3:libads: don't use MEMORY:ads_sasl_gssapi_do_bind nor set "KRB5CCNAME"
       via  3b98cde HEIMDAL:lib/krb5: destroy a memory ccache on reinit
       via  60ffbab s3-printing: fix migrate printer code (bug 8618)
       via  cc3b76b s3: cldap: cldap_multi_netlogon_send() fails with one bad IPv6 address.
       via  9ecc6ac s3-utils: Fix loading smb.conf in smbcquotas
       via  ab1c3d4 ctdb-scripts: Fix incorrect variable reference
       via  bf7e0fb ctdb-scripts: Avoid dividing by zero in memory calculation
       via  0fcbce8 s3/winbindd: using default domain with user at domain.com format fails
       via  0790769 Add a blackbox tests for id & getent to test domain at realm type credentials
       via  6e12cac s3-lib: Fix %G substitution in AD member environment
       via  dba617a torture/ioctl: test compression responses when unsupported
       via  3af480f smbd/ioctl: match WS2016 ReFS get compression behaviour
       via  15a8ee6 vfs_glusterfs: Fix a memory leak in connect path
       via  17e61a1 spoolss: Fix caching of printername->sharename
       via  49d4c63 s4:samba_spnupdate: do not attempt to parse log level, use parsed value
       via  4c54612 python/join: do not attempt to parse log level, use parsed value
       via  430e9d2 python/drs_utils: do not attempt to parse log level, use parsed value
       via  4fe66b5 tests/param add a test for LoadParm.log_level
       via  cfa3e0f s4:param add log_level function to retrieve log level in Python code
       via  ad96251 glusterfs: Avoid tevent_internal.h
       via  3170f53 s3: events. Move events.c to util_event.c
       via  fc82907 s3: server: s3_tevent_context_init() -> samba_tevent_context_init()
       via  a60c9ce s3: winbind: Remove dump_event_list() calls.
       via  ed6b8bc s3: nmbd: Final changeover to stock tevent for nmbd.
       via  95401c5 s3: nmbd: Change over to using tevent functions from direct poll.
       via  e9cf61d s3: nmbd: Add a talloc_stackframe().
       via  f8d8ed5 s3: nmbd: Add (currently unused) timeout and fd handlers.
       via  1ccbb07 s3: nmbd: Now attrs array mirrors fd's array use it in preference.
       via  b8ae31c s3: nmbd: Ensure attrs array mirrors fd's array for dns.
       via  5d160ee s3: nmbd: Add fd, triggered elements to struct socket_attributes.
       via  e4c48c9 s3:nmbd: fix talloc_zero_array() check in nmbd_packets.c
       via  257644f s3: winbind: Ensure we store name2sid with the correct cache sequence number.
       via  47ab4a0 s3: winbind: Trust name2sid mappings from the PAC.
       via  1d28a24 s3: winbind: refresh_sequence_number is only ever called with 'false'.
       via  275ae03 s3: auth: Use wbcAuthenticateUserEx to prime the caches.
       via  2dfbdc5 s3: winbind: Make WBC_AUTH_USER_LEVEL_PAC prime the name2sid cache.
       via  ba1356d ctdb-scripts: ctdbd_wrapper should never remove the PID file
      from  0708007 Merge tag 'samba-4.4.6' into v4-4-test

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-4-test


- Log -----------------------------------------------------------------
commit 5a0b28a30d8e4187e184e86ef7f1cf0abe625678
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Oct 21 14:38:49 2016 -0700

    lib: Fix bug 12291
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12291
    
    Back-ported from f92590d10aaf9a289b5f6aac8ffc79129b83a517 in master.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(v4-4-test): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(v4-4-test): Mon Oct 24 14:24:42 CEST 2016 on sn-devel-144

commit 46780e34aa43e24f7354ee463f3b11891ffacdf9
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Oct 10 17:07:12 2016 +0200

    s3:libads: don't use MEMORY:ads_sasl_spnego_bind nor set "KRB5CCNAME"
    
    Most callers just set "KRB5CCNAME", but leave ads->auth.ccache_name = NULL.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12369
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Günther Deschner <gd at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Thu Oct 13 00:35:21 CEST 2016 on sn-devel-144
    
    (cherry picked from commit a5f895a53016af71db53967062728fec5bc307ca)

commit f2a0f86b3facc22a9ce873e16e18106330d88ffb
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Oct 10 17:07:12 2016 +0200

    s3:libads: don't use MEMORY:ads_sasl_gssapi_do_bind nor set "KRB5CCNAME"
    
    Most callers just set "KRB5CCNAME", but leave ads->auth.ccache_name = NULL.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12369
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Günther Deschner <gd at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 890b1bbdb8e965c4ff6e35214acc96ffbbff5dfd)

commit 3b98cde692939559dd5e8de830938c3ad29e2f5a
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Oct 10 15:53:26 2016 +0200

    HEIMDAL:lib/krb5: destroy a memory ccache on reinit
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12369
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Günther Deschner <gd at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 2abc3710a8a63327a769ba0482c553ed274b2113)

commit 60ffbabcb6d6997ccbc95d7d84efb19f53876a49
Author: Björn Baumbach <bb at sernet.de>
Date:   Fri Nov 18 18:54:56 2011 +0100

    s3-printing: fix migrate printer code (bug 8618)
    
    Removed path from driver files.
    We only need the basenames.
    (cherry picked from commit d61993043fcb7676a58658476421f5f4ff1a3fea)
    (cherry picked from commit 9f07ef2249dc21eab37cd5888623e6edc84b2b59)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=8618
    
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Günther Deschner <gd at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Wed Oct  5 19:19:39 CEST 2016 on sn-devel-144
    
    (cherry picked from commit eb7555397fd4e9f66e041179aadff59f2a39d14f)

commit cc3b76b5167c7890ba1c2da6ac6de6fa533542b5
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Oct 17 10:07:23 2016 -0700

    s3: cldap: cldap_multi_netlogon_send() fails with one bad IPv6 address.
    
    Analysis by: Rebecca Gellman <rebecca at starfleet-net.co.uk>
    
    Ignore cldap_socket_init() failure when sending
    multiple cldap netlogon requests. Allow cldap_netlogon_send()
    to catch the bad address and correctly return through a
    tevent subreq.
    
    Make sure cldap_search_send() copes with cldap parameter == NULL.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12381
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Ralph Böhme <slow at samba.org>
    Autobuild-Date(master): Tue Oct 18 02:16:20 CEST 2016 on sn-devel-144
    
    (cherry picked from commit 44a7040500d74551b48eba04f5d0bedb1ec35ba6)

commit 9ecc6acd7d6206290720ba4c118298506849f57c
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Oct 5 08:22:54 2016 +0200

    s3-utils: Fix loading smb.conf in smbcquotas
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12364
    
    Pair-Programmed-With: Uri Simchoni <uri at samba.org>
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit c7bcbd166d23b6ebcc2d968b76b0640b9a9beebb)

commit ab1c3d4c1a24d103de89894212551e4f8cfc863c
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Jun 29 17:47:12 2016 +1000

    ctdb-scripts: Fix incorrect variable reference
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12362
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit eabeecb45322747d7daeb2a79ac213f17eb049da)

commit bf7e0fb72d418a69e7cc12877b5b9cb5b6b2a45b
Author: Jose A. Rivera <jarrpa at samba.org>
Date:   Thu Apr 21 13:09:21 2016 -0500

    ctdb-scripts: Avoid dividing by zero in memory calculation
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12362
    
    Don't do a percentage calculation for either memtotal or swaptotal if they
    are zero.
    
    Signed-off-by: Jose A. Rivera <jarrpa at samba.org>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit bf3f22315a281fb44a5cd9b075b7915138145d6e)

commit 0fcbce8aa7ad4f7f39cbe24ad70204f6b95d3272
Author: Noel Power <noel.power at suse.com>
Date:   Tue Sep 20 11:49:49 2016 +0100

    s3/winbindd: using default domain with user at domain.com format fails
    
    For example for samba client joined to a windows AD DC the following
    commands fail if 'winbind use default domain = yes'
       getent passwd user at domain.com
       ssh -o user=user at domain.com localhost
    
    The same commands succeed if the setting above has the default 'no' value
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12298
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Mon Oct  3 23:37:44 CEST 2016 on sn-devel-144
    
    (cherry picked from commit 7c786f89820dc1f8e2a7e8da1b80042dd69b7188)

commit 0790769c09bcf5100770b7fadf076f74b9970323
Author: Noel Power <noel.power at suse.com>
Date:   Thu Sep 29 16:50:58 2016 +0100

    Add a blackbox tests for id & getent to test domain at realm type credentials
    
    Using domain at realm credentials has been problematic when
    global conf setting "winbind use default domain" is enabled, this patch
    creates a new s4member_dflt_domain environment (where
    "winbind use default domain" is enabled) and runs getent & id against the
    normal s4member & and new s4member_dflt_domain environments
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12298
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    (cherry picked from commit ebfe3c85d0bbdf5d5f7459ddd61e3b44c3ec2bd3)

commit 6e12cac25a3c1db56633f4d4a22fdd85a892401b
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Sep 19 13:59:54 2016 +0200

    s3-lib: Fix %G substitution in AD member environment
    
    If we are a domain member we should look up the user with the domain
    name specified else it will only work if we have
    'winbind use default domain' set.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12276
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    (cherry picked from commit 619ca5f63c47ff8b021692aaa756dcb0d883b8dd)

commit dba617aec0936f197b016818e9c7d83277d01768
Author: David Disseldorp <ddiss at samba.org>
Date:   Tue Oct 4 01:15:20 2016 +0200

    torture/ioctl: test compression responses when unsupported
    
    Confirm that Samba matches Windows Server 2016 ReFS behaviour here.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12144
    
    Reported-by: Nick Barrett
    Signed-off-by: David Disseldorp <ddiss at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Thu Oct  6 06:14:34 CEST 2016 on sn-devel-144
    
    (cherry picked from commit f6f6263f1f03db965b64b5d7858e44ab5ffb0aeb)

commit 3af480fa54d55db5033dd8ead0ea8edd7fb84d36
Author: David Disseldorp <ddiss at samba.org>
Date:   Tue Oct 4 01:09:37 2016 +0200

    smbd/ioctl: match WS2016 ReFS get compression behaviour
    
    ReFS doesn't support compression, but responds to get-compression FSCTLs
    with a successful COMPRESSION_FORMAT_NONE response. set-compression
    results in NT_STATUS_NOT_SUPPORTED.
    
    This commit modifies Samba to match the ReFS behaviour, when run atop
    a VFS that doesn't expose compression support.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12144
    
    Reported-by: Nick Barrett
    Signed-off-by: David Disseldorp <ddiss at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 7a1000222877cdbc8967122b9de29021a42f4c8a)

commit 15a8ee6ff29e498a2c19f7112b583975cea82146
Author: Anoop C S <anoopcs at redhat.com>
Date:   Fri Oct 7 16:05:29 2016 +0530

    vfs_glusterfs: Fix a memory leak in connect path
    
    Early return in case of failure to set snapdir-entry-path xlator option
    leaks talloced tmp_ctx.
    
    Signed-off-by: Anoop C S <anoopcs at redhat.com>
    Reviewed-by: Guenther 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): Fri Oct  7 19:39:11 CEST 2016 on sn-devel-144
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12377
    
    (cherry picked from commit 06281e8f1b912540a8cc2a79497b074dbe559d53)

commit 17e61a14efdae6fd780b4d0ae95e47c8a7797af1
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Oct 12 11:06:51 2016 +0200

    spoolss: Fix caching of printername->sharename
    
    time_mono() gives seconds since boot, gencache expects seconds since epoch.
    With time_mono(), the values are always expired immediately.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12374
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>
    
    Autobuild-User(master): Günther Deschner <gd at samba.org>
    Autobuild-Date(master): Thu Oct 13 13:48:52 CEST 2016 on sn-devel-144

commit 49d4c63b5642007976369f01b89ab4f71d0f94b1
Author: Christian Ambach <ambi at samba.org>
Date:   Tue Sep 13 10:49:47 2016 +0200

    s4:samba_spnupdate: do not attempt to parse log level, use parsed value
    
    The log level parameter can contain debug class specific entries.
    Do not attempt to parse this as int, but use the values that the
    debugging system already parsed
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=9945
    Signed-off-by: Christian Ambach <ambi at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Christian Ambach <ambi at samba.org>
    Autobuild-Date(master): Wed Sep 14 23:15:18 CEST 2016 on sn-devel-144
    
    (cherry picked from commit 064d24032398c8896da15246be81fdd4b1588e18)

commit 4c54612734bb22f6f2376e235d7375467a8da60e
Author: Christian Ambach <ambi at samba.org>
Date:   Tue Sep 13 10:49:47 2016 +0200

    python/join: do not attempt to parse log level, use parsed value
    
    The log level parameter can contain debug class specific entries.
    Do not attempt to parse this as int, but use the values that the
    debugging system already parsed
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=9945
    Signed-off-by: Christian Ambach <ambi at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit 92178f02bd09277f783eb68b476cfd1452c7f9ef)

commit 430e9d2b2a70e3784c42d776740636d471b25bce
Author: Christian Ambach <ambi at samba.org>
Date:   Tue Sep 13 10:49:47 2016 +0200

    python/drs_utils: do not attempt to parse log level, use parsed value
    
    The log level parameter can contain debug class specific entries.
    Do not attempt to parse this as int, but use the values that the
    debugging system already parsed
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=9945
    Signed-off-by: Christian Ambach <ambi at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit dd25aa129b6d799853312134628402f77b492eab)

commit 4fe66b567de1caf4d2d1c8c1400a87499b8f2264
Author: Christian Ambach <ambi at samba.org>
Date:   Tue Sep 13 11:22:38 2016 +0200

    tests/param add a test for LoadParm.log_level
    
    Signed-off-by: Christian Ambach <ambi at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit fa56dbf6706872c5287eab082bb6ba7b5bd3ccd2)

commit cfa3e0f415754c74d62268339711336b510522d5
Author: Christian Ambach <ambi at samba.org>
Date:   Tue Sep 13 10:48:03 2016 +0200

    s4:param add log_level function to retrieve log level in Python code
    
    Signed-off-by: Christian Ambach <ambi at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit 7ba50a200924119ac1a66759e4c1419ece03ba41)

commit ad96251e7e2e0624219f93ed3f1fbe0b4df89985
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Sep 24 10:45:13 2016 -0700

    glusterfs: Avoid tevent_internal.h
    
    Günther confirmed it still compiles :-)
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12283
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Günther Deschner <gd at samba.org>
    
    Autobuild-User(master): Volker Lendecke <vl at samba.org>
    Autobuild-Date(master): Sat Sep 24 23:41:56 CEST 2016 on sn-devel-144
    
    (cherry picked from commit c60ea2c17814f9f7b55514e0d0a553accaa54b15)

commit 3170f53ad46184ebc7725f311a178b95bad4c94d
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Sep 23 20:00:33 2016 -0700

    s3: events. Move events.c to util_event.c
    
    Remove all tevent internal code.
    
    Everything is now stock tevent.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12283
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    (similar to commit 4ed790ebbf474c4e4ef9b4f0f3aeca65118796df)

commit fc82907471e61cba0637c35f1c5c682bdda78129
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Sep 23 19:11:17 2016 -0700

    s3: server: s3_tevent_context_init() -> samba_tevent_context_init()
    
    We can now remove source3/lib/events.c
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12283
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    (cherry picked from commit fbfea52e1ce8f22d8d020a2bf3aebd1bc69faceb)

commit a60c9cef3dc22bde05307a371928c878258dfaf2
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Sep 23 19:07:39 2016 -0700

    s3: winbind: Remove dump_event_list() calls.
    
    If needed we can add this into actual tevent.
    
    Preparing to remove source3/lib/events.c
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12283
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    (cherry picked from commit 72785309aa2d1bed7abc6dd7c6475ff0f78411da)

commit ed6b8bc4ed9206c4253d358de818400881563e57
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Sep 23 12:37:52 2016 -0700

    s3: nmbd: Final changeover to stock tevent for nmbd.
    
    Removes unused references to fds array used for (removed)
    poll call. Renames create_listen_pollfds() to
    create_listen_array().
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12283
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    (cherry picked from commit 6e8bd13660d7795df429dbf852345124db38ea96)

commit 95401c5991efdc3f9f04daa01d887e7810749602
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Sep 23 12:31:00 2016 -0700

    s3: nmbd: Change over to using tevent functions from direct poll.
    
    This will allow us to eventually remove source3/lib/events.c
    dependency and make nmbd purely tevent based.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12283
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    (cherry picked from commit b857bf9b3fa3a836647edc40ead92db7b782d367)

commit e9cf61df53f784c88fdc2306a3d9348876f968f3
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Sep 23 12:22:53 2016 -0700

    s3: nmbd: Add a talloc_stackframe().
    
    We will use this to create real tevent timer and fd
    events.
    
    This will allow us to eventually remove source3/lib/events.c
    dependency and make nmbd purely tevent based.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12283
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    (cherry picked from commit 36b67729a6fc8518da71944db3fac6d9236b9348)

commit f8d8ed53a5a1aec5940fc761f862476efd3a3020
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Sep 23 12:18:37 2016 -0700

    s3: nmbd: Add (currently unused) timeout and fd handlers.
    
    This will allow us to eventually remove source3/lib/events.c
    dependency and make nmbd purely tevent based.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12283
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    (cherry picked from commit cca25c8f75147873280464eaf2699ff449f609ad)

commit 1ccbb07b66b79de9febc04f4246df053f7970e98
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Sep 23 12:16:58 2016 -0700

    s3: nmbd: Now attrs array mirrors fd's array use it in preference.
    
    This will allow us to eventually remove source3/lib/events.c
    dependency and make nmbd purely tevent based.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12283
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    (cherry picked from commit 376e04656b6755d1a182430b39273a93495d00b2)

commit b8ae31ce9c4d91dc6066bbae8e7ff94b1ef9f7d8
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Sep 23 12:12:43 2016 -0700

    s3: nmbd: Ensure attrs array mirrors fd's array for dns.
    
    This will allow us to eventually remove source3/lib/events.c
    dependency and make nmbd purely tevent based.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12283
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    (cherry picked from commit 7f0717e751930cd5da029c1852ff9f61f95e40b7)

commit 5d160ee3eb9d6686bbb96be43086d101c5386969
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Sep 23 12:05:59 2016 -0700

    s3: nmbd: Add fd, triggered elements to struct socket_attributes.
    
    Zero the attrs array on allocation, and mirror the fd's.
    
    This will allow us to eventually remove source3/lib/events.c
    dependency and make nmbd purely tevent based.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12283
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    (cherry picked from commit d8ade0730797df22bfe28847e034eb6d116b0e00)

commit e4c48c9da183627b01928ef337272ed926061f6d
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Feb 27 09:29:47 2013 +0100

    s3:nmbd: fix talloc_zero_array() check in nmbd_packets.c
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    Autobuild-User(master): Volker Lendecke <vl at samba.org>
    Autobuild-Date(master): Fri Sep 23 18:08:21 CEST 2016 on sn-devel-144
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12283
    
    (cherry picked from commit 4470f01605a2f09b054550ee5a8f8d3b4ebc2098)

commit 257644f6887f85a46c9bf368256e33caf7a4be3b
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Oct 13 15:01:58 2016 -0700

    s3: winbind: Ensure we store name2sid with the correct cache sequence number.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11259
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 9f6fe5e2c54870abfff48c8a9d96e21bfec2425f)

commit 47ab4a045940799be4b9f633b24e9e96066fb5de
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Sep 28 11:26:04 2016 -0700

    s3: winbind: Trust name2sid mappings from the PAC.
    
    Don't refresh sequence number in parent as the
    mapping comes from a trusted DC.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11259
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Günther Deschner <gd at samba.org>
    (cherry picked from commit 1017b22f68e798a080e0738d3beecf008b2284ef)

commit 1d28a24787a050f4abf98c4cfa658c83f32fe03e
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Sep 28 10:12:36 2016 -0700

    s3: winbind: refresh_sequence_number is only ever called with 'false'.
    
    Remove redundant parameter.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11259
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>
    (cherry picked from commit 32ae6721cf02412af3c5a82d5da4806f4d931bcd)

commit 275ae03e007c51e89405acaf011cc4732b85ff64
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Sep 26 17:07:44 2016 -0700

    s3: auth: Use wbcAuthenticateUserEx to prime the caches.
    
    Idea by Volker - use WBC_AUTH_USER_LEVEL_PAC to pass
    the PAC to winbind from smbd on auth, this allows
    winbind to prime the user info via netsamlogon_cache_store()
    and the name2sid cache *before* smbd looks up the user.
    
    Note that as this is merely a cache prime having
    winbind not available is not an error.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11259
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Günther Deschner <gd at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Wed Sep 28 22:45:27 CEST 2016 on sn-devel-144
    
    (cherry picked from commit ccfba2537d0ea081fbeeee0feecf8e2774850300)

commit 2dfbdc589655584ccee8396ecd9ec5b66d9d45cf
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Sep 27 15:04:49 2016 -0700

    s3: winbind: Make WBC_AUTH_USER_LEVEL_PAC prime the name2sid cache.
    
    In addition to priming the netsamlogon cache.
    
    This prevents a winbind AD-DC lookup for something
    the PAC already told us.
    
    Note we only do this in the case where the PAC successfully
    passed signature verification.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11259
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Günther Deschner <gd at samba.org>
    (cherry picked from commit cf0f28819e771d433af00b3532011de70112b1f8)

commit ba1356d7bac51d65818a7842d190689645504dca
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Oct 10 13:16:01 2016 +1100

    ctdb-scripts: ctdbd_wrapper should never remove the PID file
    
    kill_ctdbd() kills the daemon and then removes the PID file.  This is
    racy because a new daemon could write a new PID file in between the
    kill and the removal.  Reversing these steps would be an improvement.
    
    However, none of the places where kill_ctdbd() is called is a safe
    place to remove the PID file.  There is always a chance that a new
    daemon could start, write a new PID file and then kill_ctdbd() could
    remove the new PID file.
    
    ctdbd is able to overwrite a stale PID file by checking to see if it
    is locked.
    
    Therefore, entirely drop removal of the PID file from ctdbd_wrapper.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12287
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    (cherry picked from commit 56d526c6ea3150a19dd0762b45d23a7c5f96d260)

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

Summary of changes:
 ctdb/config/ctdbd_wrapper                       |   1 -
 ctdb/config/events.d/05.system                  |   6 +-
 libcli/cldap/cldap.c                            |   5 +
 python/samba/drs_utils.py                       |   2 +-
 python/samba/join.py                            |   4 +-
 python/samba/tests/param.py                     |   6 +
 selftest/knownfail                              |   1 +
 selftest/target/Samba.pm                        |   1 +
 selftest/target/Samba4.pm                       |  36 +-
 source3/auth/auth_generic.c                     |  49 ++-
 source3/include/includes.h                      |   4 +-
 source3/include/{event.h => util_event.h}       |  16 +-
 source3/lib/events.c                            | 486 ------------------------
 source3/lib/msghdr.c                            |   2 +-
 source3/lib/server_contexts.c                   |   2 +-
 source3/lib/substitute.c                        |  24 +-
 source3/lib/util_event.c                        | 101 +++++
 source3/libads/cldap.c                          |  17 +-
 source3/libads/sasl.c                           |  11 -
 source3/modules/vfs_glusterfs.c                 |   4 +-
 source3/nmbd/nmbd_packets.c                     | 162 +++++---
 source3/printing/nt_printing_migrate.c          |  27 ++
 source3/rpc_server/rpc_ncacn_np.c               |   8 +-
 source3/rpc_server/spoolss/srv_spoolss_nt.c     |   4 +-
 source3/smbd/process.c                          |   4 +-
 source3/smbd/server.c                           |   1 -
 source3/smbd/smb2_ioctl_filesys.c               |  29 +-
 source3/utils/smbcquotas.c                      |  15 +-
 source3/winbindd/winbindd_cache.c               |  62 ++-
 source3/winbindd/winbindd_dual.c                |   5 +-
 source3/winbindd/winbindd_pam.c                 |  35 +-
 source3/winbindd/winbindd_proto.h               |   5 +
 source3/winbindd/winbindd_util.c                |   5 +-
 source3/wscript_build                           |   2 +-
 source4/heimdal/lib/krb5/mcache.c               |  52 ++-
 source4/param/pyparam.c                         |   9 +
 source4/scripting/bin/samba_spnupdate           |   2 +-
 source4/selftest/tests.py                       |   7 +
 source4/torture/smb2/ioctl.c                    |  76 ++++
 testprogs/blackbox/{nsstest.sh => dom_parse.sh} |  13 +-
 40 files changed, 626 insertions(+), 675 deletions(-)
 rename source3/include/{event.h => util_event.h} (64%)
 delete mode 100644 source3/lib/events.c
 create mode 100644 source3/lib/util_event.c
 copy testprogs/blackbox/{nsstest.sh => dom_parse.sh} (56%)


Changeset truncated at 500 lines:

diff --git a/ctdb/config/ctdbd_wrapper b/ctdb/config/ctdbd_wrapper
index be251e6..7d4304a 100755
--- a/ctdb/config/ctdbd_wrapper
+++ b/ctdb/config/ctdbd_wrapper
@@ -181,7 +181,6 @@ kill_ctdbd ()
 
     if [ -n "$_session" ] ; then
 	pkill -9 -s "$_session" 2>/dev/null
-	rm -f "$pidfile"
     fi
 }
 
diff --git a/ctdb/config/events.d/05.system b/ctdb/config/events.d/05.system
index 69fcec2..603f941 100755
--- a/ctdb/config/events.d/05.system
+++ b/ctdb/config/events.d/05.system
@@ -47,7 +47,7 @@ check_thresholds ()
         fi
     fi
 
-    if validate_percentage "$_warn_threshold" "$_what" ; then
+    if validate_percentage "$_warn_threshold" "$_thing" ; then
         if [ "$_usage" -ge "$_warn_threshold" ] ; then
 	    if [ -r "$_cache" ] ; then
 		read _prev <"$_cache"
@@ -144,8 +144,8 @@ $1 == "SwapFree:"     { swapfree  = $2 }
 $1 == "SwapTotal:"    { swaptotal = $2 }
 END {
     if (memavail != 0) { memfree = memavail ; }
-    print int((memtotal -  memfree)  / memtotal * 100),
-          int((swaptotal - swapfree) / swaptotal * 100)
+    if (memtotal != 0) { print int((memtotal - memfree) / memtotal * 100) ; } else { print 0 ; }
+    if (swaptotal != 0) { print int((swaptotal - swapfree) / swaptotal * 100) ; } else { print 0 ; }
 }')
     _mem_usage="$1"
     _swap_usage="$2"
diff --git a/libcli/cldap/cldap.c b/libcli/cldap/cldap.c
index c5977cc..87f82b9 100644
--- a/libcli/cldap/cldap.c
+++ b/libcli/cldap/cldap.c
@@ -585,6 +585,11 @@ struct tevent_req *cldap_search_send(TALLOC_CTX *mem_ctx,
 
 	talloc_set_destructor(state, cldap_search_state_destructor);
 
+	if (state->caller.cldap == NULL) {
+		tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
+		goto post;
+	}
+
 	if (io->in.dest_address) {
 		if (cldap->connected) {
 			tevent_req_nterror(req, NT_STATUS_PIPE_CONNECTED);
diff --git a/python/samba/drs_utils.py b/python/samba/drs_utils.py
index 87c9a86..d0f9434 100644
--- a/python/samba/drs_utils.py
+++ b/python/samba/drs_utils.py
@@ -44,7 +44,7 @@ def drsuapi_connect(server, lp, creds):
     """
 
     binding_options = "seal"
-    if int(lp.get("log level")) >= 5:
+    if lp.log_level() >= 5:
         binding_options += ",print"
     binding_string = "ncacn_ip_tcp:%s[%s]" % (server, binding_options)
     try:
diff --git a/python/samba/join.py b/python/samba/join.py
index 6df337c..18630a1 100644
--- a/python/samba/join.py
+++ b/python/samba/join.py
@@ -373,7 +373,7 @@ class dc_join(object):
     def drsuapi_connect(ctx):
         '''make a DRSUAPI connection to the naming master'''
         binding_options = "seal"
-        if int(ctx.lp.get("log level")) >= 4:
+        if ctx.lp.log_level() >= 4:
             binding_options += ",print"
         binding_string = "ncacn_ip_tcp:%s[%s]" % (ctx.server, binding_options)
         ctx.drsuapi = drsuapi.drsuapi(binding_string, ctx.lp, ctx.creds)
@@ -810,7 +810,7 @@ class dc_join(object):
                 repl_creds = ctx.creds
 
             binding_options = "seal"
-            if int(ctx.lp.get("log level")) >= 5:
+            if ctx.lp.log_level() >= 5:
                 binding_options += ",print"
             repl = drs_utils.drs_Replicate(
                 "ncacn_ip_tcp:%s[%s]" % (ctx.server, binding_options),
diff --git a/python/samba/tests/param.py b/python/samba/tests/param.py
index f539eba..684c17c 100644
--- a/python/samba/tests/param.py
+++ b/python/samba/tests/param.py
@@ -55,3 +55,9 @@ class LoadParmTestCase(samba.tests.TestCase):
         samba_lp = param.LoadParm()
         samba_lp.load_default()
         self.assertRaises(KeyError, samba_lp.__getitem__, "nonexistent")
+
+    def test_log_level(self):
+        samba_lp = param.LoadParm()
+        samba_lp.set("log level", "5 auth:4")
+        self.assertEquals(5, samba_lp.log_level())
+
diff --git a/selftest/knownfail b/selftest/knownfail
index aab1456..778cb33 100644
--- a/selftest/knownfail
+++ b/selftest/knownfail
@@ -215,6 +215,7 @@
 ^samba3.smb2.replay.replay3
 ^samba3.smb2.replay.replay4
 ^samba3.smb2.lock.*replay
+^samba4.smb2.ioctl.compress_notsup.*\(ad_dc_ntvfs\)
 ^samba3.raw.session.*reauth2 # maybe fix this?
 ^samba3.rpc.lsa.secrets.seal # This gives NT_STATUS_LOCAL_USER_SESSION_KEY
 ^samba3.rpc.samr.passwords.badpwdcount.samr.badPwdCount\(nt4_dc\) # We fail this test currently
diff --git a/selftest/target/Samba.pm b/selftest/target/Samba.pm
index 17a2bbe..64de27c 100644
--- a/selftest/target/Samba.pm
+++ b/selftest/target/Samba.pm
@@ -296,6 +296,7 @@ sub get_interface($)
     $interfaces{"promotedvdc"} = 33;
     $interfaces{"rfc2307member"} = 34;
     $interfaces{"fileserver"} = 35;
+    $interfaces{"s4member_dflt"} = 36;
 
     # update lib/socket_wrapper/socket_wrapper.c
     #  #define MAX_WRAPPED_INTERFACES 40
diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index 836c15d..028df3c 100755
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -936,10 +936,10 @@ $extra_smbconf_shares
 	return $self->provision_raw_step2($ctx, $ret);
 }
 
-sub provision_s4member($$$)
+sub provision_s4member($$$$$)
 {
-	my ($self, $prefix, $dcvars) = @_;
-	print "PROVISIONING MEMBER...";
+	my ($self, $prefix, $dcvars, $hostname, $more_conf) = @_;
+	print "PROVISIONING MEMBER...\n";
 	my $extra_smb_conf = "
         passdb backend = samba_dsdb
 winbindd:use external pipes = true
@@ -954,9 +954,12 @@ rpc_server:spoolss = embedded
 rpc_daemon:spoolssd = embedded
 rpc_server:tcpip = no
 ";
+	if ($more_conf) {
+		$extra_smb_conf = $extra_smb_conf . $more_conf . "\n";
+	}
 	my $ret = $self->provision($prefix,
 				   "member server",
-				   "s4member",
+				   $hostname,
 				   "SAMBADOMAIN",
 				   "samba.example.com",
 				   "2008",
@@ -1893,6 +1896,11 @@ sub setup_env($$$)
 			$self->setup_ad_dc_ntvfs("$path/ad_dc_ntvfs");
 		}
 		return $self->setup_subdom_dc("$path/subdom_dc", $self->{vars}->{ad_dc_ntvfs});
+	} elsif ($envname eq "s4member_dflt_domain") {
+		if (not defined($self->{vars}->{ad_dc_ntvfs})) {
+			$self->setup_ad_dc_ntvfs("$path/ad_dc_ntvfs");
+		}
+		return $self->setup_s4member_dflt_domain("$path/s4member_dflt_domain", $self->{vars}->{ad_dc_ntvfs});
 	} elsif ($envname eq "s4member") {
 		if (not defined($self->{vars}->{ad_dc_ntvfs})) {
 			$self->setup_ad_dc_ntvfs("$path/ad_dc_ntvfs");
@@ -1931,7 +1939,7 @@ sub setup_s4member($$$)
 {
 	my ($self, $path, $dc_vars) = @_;
 
-	my $env = $self->provision_s4member($path, $dc_vars);
+	my $env = $self->provision_s4member($path, $dc_vars, "s4member");
 
 	if (defined $env) {
 	        if (not defined($self->check_or_start($env, "single"))) {
@@ -1944,6 +1952,24 @@ sub setup_s4member($$$)
 	return $env;
 }
 
+sub setup_s4member_dflt_domain($$$)
+{
+	my ($self, $path, $dc_vars) = @_;
+
+	my $env = $self->provision_s4member($path, $dc_vars, "s4member_dflt",
+					    "winbind use default domain = yes");
+
+	if (defined $env) {
+	        if (not defined($self->check_or_start($env, "standard"))) {
+		        return undef;
+		}
+
+		$self->{vars}->{s4member_dflt_domain} = $env;
+	}
+
+	return $env;
+}
+
 sub setup_rpc_proxy($$$)
 {
 	my ($self, $path, $dc_vars) = @_;
diff --git a/source3/auth/auth_generic.c b/source3/auth/auth_generic.c
index 74eb2fa..f9b9184 100644
--- a/source3/auth/auth_generic.c
+++ b/source3/auth/auth_generic.c
@@ -28,6 +28,7 @@
 #include "lib/param/param.h"
 #ifdef HAVE_KRB5
 #include "auth/kerberos/pac_utils.h"
+#include "nsswitch/libwbclient/wbclient.h"
 #endif
 #include "librpc/crypto/gse.h"
 #include "auth/credentials/credentials.h"
@@ -63,6 +64,51 @@ static NTSTATUS auth3_generate_session_info_pac(struct auth4_context *auth_ctx,
 
 	if (pac_blob) {
 #ifdef HAVE_KRB5
+		struct wbcAuthUserParams params = {};
+		struct wbcAuthUserInfo *info = NULL;
+		struct wbcAuthErrorInfo *err = NULL;
+		wbcErr wbc_err;
+
+		/*
+		 * Let winbind decode the PAC.
+		 * This will also store the user
+		 * data in the netsamlogon cache.
+		 *
+		 * We need to do this *before* we
+		 * call get_user_from_kerberos_info()
+		 * as that does a user lookup that
+		 * expects info in the netsamlogon cache.
+		 *
+		 * See BUG: https://bugzilla.samba.org/show_bug.cgi?id=11259
+		 */
+		params.level = WBC_AUTH_USER_LEVEL_PAC;
+		params.password.pac.data = pac_blob->data;
+		params.password.pac.length = pac_blob->length;
+
+		become_root();
+		wbc_err = wbcAuthenticateUserEx(&params, &info, &err);
+		unbecome_root();
+
+		/*
+		 * As this is merely a cache prime
+		 * WBC_ERR_WINBIND_NOT_AVAILABLE
+		 * is not a fatal error, treat it
+		 * as success.
+		 */
+
+		switch (wbc_err) {
+			case WBC_ERR_WINBIND_NOT_AVAILABLE:
+			case WBC_ERR_SUCCESS:
+				break;
+			case WBC_ERR_AUTH_ERROR:
+				status = NT_STATUS(err->nt_status);
+				wbcFreeMemory(err);
+				goto done;
+			default:
+				status = NT_STATUS_LOGON_FAILURE;
+				goto done;
+		}
+
 		status = kerberos_pac_logon_info(tmp_ctx, *pac_blob, NULL, NULL,
 						 NULL, NULL, 0, &logon_info);
 #else
@@ -101,7 +147,7 @@ static NTSTATUS auth3_generate_session_info_pac(struct auth4_context *auth_ctx,
 		goto done;
 	}
 
-	/* save the PAC data if we have it */
+	/* Get the info3 from the PAC data if we have it */
 	if (logon_info) {
 		status = create_info3_from_pac_logon_info(tmp_ctx,
 					logon_info,
@@ -109,7 +155,6 @@ static NTSTATUS auth3_generate_session_info_pac(struct auth4_context *auth_ctx,
 		if (!NT_STATUS_IS_OK(status)) {
 			goto done;
 		}
-		netsamlogon_cache_store(ntuser, info3_copy);
 	}
 
 	/* setup the string used by %U */
diff --git a/source3/include/includes.h b/source3/include/includes.h
index 81bba40..234a564 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -310,8 +310,8 @@ typedef char fstring[FSTRING_LEN];
 #include "../lib/util/dlinklist.h"
 
 #include <talloc.h>
-
-#include "event.h"
+#include <tevent.h>
+#include "util_event.h"
 
 #include "../lib/util/data_blob.h"
 #include "../lib/util/time.h"
diff --git a/source3/include/event.h b/source3/include/util_event.h
similarity index 64%
rename from source3/include/event.h
rename to source3/include/util_event.h
index 108026e..df608a1 100644
--- a/source3/include/event.h
+++ b/source3/include/util_event.h
@@ -18,21 +18,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include <tevent.h>
-
-/* The following definitions come from lib/events.c  */
-struct pollfd;
-struct timeval *get_timed_events_timeout(struct tevent_context *event_ctx,
-					 struct timeval *to_ret);
-void dump_event_list(struct tevent_context *event_ctx);
-struct tevent_context *s3_tevent_context_init(TALLOC_CTX *mem_ctx);
-
-bool event_add_to_poll_args(struct tevent_context *ev, TALLOC_CTX *mem_ctx,
-			    struct pollfd **pfds, int *num_pfds,
-			    int *ptimeout);
-bool run_events_poll(struct tevent_context *ev, int pollrtn,
-		     struct pollfd *pfds, int num_pfds);
-
+/* The following definitions come from lib/util_event.c  */
 struct idle_event *event_add_idle(struct tevent_context *event_ctx,
 				  TALLOC_CTX *mem_ctx,
 				  struct timeval interval,
diff --git a/source3/lib/events.c b/source3/lib/events.c
deleted file mode 100644
index 2e862ca..0000000
--- a/source3/lib/events.c
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
-   Unix SMB/CIFS implementation.
-   Timed event library.
-   Copyright (C) Andrew Tridgell 1992-1998
-   Copyright (C) Volker Lendecke 2005-2007
-
-   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 "lib/tevent/tevent_internal.h"
-#include "../lib/util/select.h"
-#include "system/select.h"
-
-struct tevent_poll_private {
-	/*
-	 * Index from file descriptor into the pollfd array
-	 */
-	int *pollfd_idx;
-
-	/*
-	 * Cache for s3_event_loop_once to avoid reallocs
-	 */
-	struct pollfd *pfds;
-};
-
-static struct tevent_poll_private *tevent_get_poll_private(
-	struct tevent_context *ev)
-{
-	struct tevent_poll_private *state;
-
-	state = (struct tevent_poll_private *)ev->additional_data;
-	if (state == NULL) {
-		state = talloc_zero(ev, struct tevent_poll_private);
-		ev->additional_data = (void *)state;
-		if (state == NULL) {
-			DEBUG(10, ("talloc failed\n"));
-		}
-	}
-	return state;
-}
-
-static void count_fds(struct tevent_context *ev,
-		      int *pnum_fds, int *pmax_fd)
-{
-	struct tevent_fd *fde;
-	int num_fds = 0;
-	int max_fd = 0;
-
-	for (fde = ev->fd_events; fde != NULL; fde = fde->next) {
-		if (fde->flags & (TEVENT_FD_READ|TEVENT_FD_WRITE)) {
-			num_fds += 1;
-			if (fde->fd > max_fd) {
-				max_fd = fde->fd;
-			}
-		}
-	}
-	*pnum_fds = num_fds;
-	*pmax_fd = max_fd;
-}
-
-bool event_add_to_poll_args(struct tevent_context *ev, TALLOC_CTX *mem_ctx,
-			    struct pollfd **pfds, int *pnum_pfds,
-			    int *ptimeout)
-{
-	struct tevent_poll_private *state;
-	struct tevent_fd *fde;
-	int i, num_fds, max_fd, num_pollfds, idx_len;
-	struct pollfd *fds;
-	struct timeval now, diff;
-	int timeout;
-
-	state = tevent_get_poll_private(ev);
-	if (state == NULL) {
-		return false;
-	}
-	count_fds(ev, &num_fds, &max_fd);
-
-	idx_len = max_fd+1;
-
-	if (talloc_array_length(state->pollfd_idx) < idx_len) {
-		state->pollfd_idx = talloc_realloc(
-			state, state->pollfd_idx, int, idx_len);
-		if (state->pollfd_idx == NULL) {
-			DEBUG(10, ("talloc_realloc failed\n"));
-			return false;
-		}
-	}
-
-	fds = *pfds;
-	num_pollfds = *pnum_pfds;
-
-	if (talloc_array_length(fds) < num_pollfds + num_fds) {
-		fds = talloc_realloc(mem_ctx, fds, struct pollfd,
-					   num_pollfds + num_fds);
-		if (fds == NULL) {
-			DEBUG(10, ("talloc_realloc failed\n"));
-			return false;
-		}
-	}
-
-	memset(&fds[num_pollfds], 0, sizeof(struct pollfd) * num_fds);
-
-	/*
-	 * This needs tuning. We need to cope with multiple fde's for a file
-	 * descriptor. The problem is that we need to re-use pollfd_idx across
-	 * calls for efficiency. One way would be a direct bitmask that might
-	 * be initialized quicker, but our bitmap_init implementation is
-	 * pretty heavy-weight as well.
-	 */
-	for (i=0; i<idx_len; i++) {
-		state->pollfd_idx[i] = -1;
-	}
-
-	for (fde = ev->fd_events; fde; fde = fde->next) {
-		struct pollfd *pfd;
-
-		if ((fde->flags & (TEVENT_FD_READ|TEVENT_FD_WRITE)) == 0) {
-			continue;
-		}
-
-		if (state->pollfd_idx[fde->fd] == -1) {
-			/*
-			 * We haven't seen this fd yet. Allocate a new pollfd.
-			 */
-			state->pollfd_idx[fde->fd] = num_pollfds;
-			pfd = &fds[num_pollfds];
-			num_pollfds += 1;
-		} else {
-			/*
-			 * We have already seen this fd. OR in the flags.
-			 */
-			pfd = &fds[state->pollfd_idx[fde->fd]];
-		}
-
-		pfd->fd = fde->fd;
-
-		if (fde->flags & TEVENT_FD_READ) {
-			pfd->events |= (POLLIN|POLLHUP);
-		}
-		if (fde->flags & TEVENT_FD_WRITE) {
-			pfd->events |= POLLOUT;
-		}
-	}
-	*pfds = fds;
-	*pnum_pfds = num_pollfds;
-
-	if (ev->immediate_events != NULL) {
-		*ptimeout = 0;
-		return true;
-	}
-	if (ev->timer_events == NULL) {
-		*ptimeout = MIN(*ptimeout, INT_MAX);
-		return true;


-- 
Samba Shared Repository



More information about the samba-cvs mailing list