[SCM] SAMBA-CTDB repository - branch v3-4-ctdb updated - 3.4.7-ctdb-1-82-gad8b573

Michael Adam obnox at samba.org
Mon May 3 03:33:50 MDT 2010


The branch, v3-4-ctdb has been updated
       via  ad8b573e6b2a0df0dadadbe8d2395b8212a940f6 (commit)
       via  969ed788505ea1ce75a73a7a38d4560c3acaa72f (commit)
       via  5f69b0021bfabca7f6c93a5113f2c41b72981fe4 (commit)
       via  61f9e5513db8584c0dbc2bfbdf4a1509c84e8a09 (commit)
       via  e6e9ba373f396a52f00e5275203889dcd5e14b3a (commit)
       via  a457c6216ff8c5e42d5e56118867d9acb619087a (commit)
       via  1cd08027fe5e3d66221c38d99d8e907771c6bb01 (commit)
       via  79bcb74445729ddc23f7ef7884dd0cc600755171 (commit)
       via  a0264b98482843c20fec04959c7a04d86ceaa6c1 (commit)
       via  97405a00556bc21ae21b2b6db236bb13bc8c5a9d (commit)
       via  a36e6bd85ab94853c3411c8bba869cc86e46c61a (commit)
       via  83e7c624da575aeeb285c78585fb6641a4bf44cf (commit)
       via  9fc3eb68e029c67bb876084558a1439a2e36f5d4 (commit)
       via  e27b1f357f2cf7e45ccfd0be7cf35c0a17728d07 (commit)
       via  c3c3e7aeb104e6fc806c10385423856ca39d9c12 (commit)
       via  93ae6d5db1f45e3469888b17216e8a25b78415ea (commit)
       via  cf7c6e759d97535e9c7b2ffd9f35a90627dd641f (commit)
       via  8a534963993302613adc75f8504d45724ee70ccb (commit)
       via  1b7cd7367c173f08c57b8856372daeab5613678c (commit)
       via  2628b81a5a4b1fb0ec43f3dd865680dfad0fec4a (commit)
       via  b638e42e63eea2e55f669dcac951eafc5bb99228 (commit)
       via  66fad494092695d7467950b0f34f5c6117230922 (commit)
       via  cefa8e1a55329787787c3613f15f234ae31f85f3 (commit)
       via  adaadefe263d8cd192b67a63d1f1c13ba9bf748c (commit)
       via  ed858a25f24d5217167a5f91d4f938b3593d2987 (commit)
       via  5f873b82d6065a98eefdbed544941c8daa4aed0b (commit)
       via  9fbf94738fe8f385178cbca048983c4ff5493bae (commit)
       via  296364f71f4378faff1e5427e0f6e5324ba2b4a2 (commit)
       via  edb7d8aba47d1d6a6cb26ba345f589af9dd0cdb8 (commit)
       via  a46e20db5c1354150db71f23f37614e4703c2cc7 (commit)
       via  3b73fb01bb429094314f95989ee9e0201a94e980 (commit)
       via  bebbc24e83ae645cc20b91c37300eec4fccab17a (commit)
       via  0089b40a0257ae5e819c0766817c5355f553dc2e (commit)
       via  baa12b3ba2d53d65a25920e293d34484f811ebb9 (commit)
       via  9498d95c02b5b596821df7438efe7900c9b52283 (commit)
       via  fb8415561b9a21c31b1a6dd721902d16725e158f (commit)
       via  20d9eb2892791064844a8dcc64c477fbd864a743 (commit)
       via  632c20879069244db4ba400ee98ed80ed543fe57 (commit)
       via  f6d3cf3d41d5342066e247f908439aba2f2807db (commit)
       via  e7b7fb1fa73fa255c2958773738bf19e68992b61 (commit)
       via  ce174393d5850687ba76d6f6349a174751733987 (commit)
       via  ae76673b11eae2fd1c50224faf68d90bc680dc08 (commit)
       via  711485723b2f723a9ad32b1b753f73a3d771c2a2 (commit)
       via  a22cfb021e43382f9109972acbe4b9e2faefe3ab (commit)
       via  d6d932f6d1cc3b780e038f87a269fc667caab7b0 (commit)
       via  c9d70a39238af9a01a91dd9c0b7fafaf8e45c841 (commit)
       via  1ef1f096624e524915a91ec404b5dd5b4f0259c4 (commit)
       via  2cdf8941421aaca50e20c8b86d0d292c2d66115d (commit)
       via  3673ee1c58887657ae2f1fef284603cf16c8f843 (commit)
       via  3bff8467f25213dec7510fe2f598a711996dc94b (commit)
       via  0a0fce820ea5ad1fc10c0244225a32b50281e6d4 (commit)
       via  a44f88228d0750c0c00eb07916e51d07c0e04135 (commit)
       via  c6d52808bfbb450709ea3e7c66d7f0671cbb4e70 (commit)
       via  80dbcf7462ada909a7621ec5f5c111b79d076305 (commit)
       via  f8e58ec71738ff65aebd06ac978a6c5e9c4751d1 (commit)
       via  766c2cfbd3475a8d2e79dc04d9e4b5a162eae7a1 (commit)
       via  06f3fa0dbb0cb72e779b8aa135e0caa8180b9d54 (commit)
       via  e8c646f7aacf76f1198cc240a39b24cbf209b65c (commit)
       via  ba83b5baaa80e4a0af45d98fe3e7dbd7da2355a2 (commit)
       via  1fab5128f3a9dbaee732ceff08e602a1b18d28af (commit)
       via  2fd97052653be9398bfd6a313e4c53f993280e10 (commit)
       via  8ed6ad7a2be28b50ce5a2f8a57956c1b1591adf5 (commit)
       via  690dc634738c2b49e19edeeedc51ad419a8e610f (commit)
       via  35bb8f6ba49677a6f18883d80b36af366d7e3880 (commit)
       via  d48d9346214221fa9645585f4123ea772a9b47ba (commit)
       via  e7cba4c7a341d1143d80dd4afc68c3eea3ca8456 (commit)
       via  00ed3e25c53801b0d87703b166ab56780fe05d23 (commit)
       via  89f6668c275a201d5a6b332e4b794b3c04889162 (commit)
       via  8766b0e65dd53185a4241c791db01e2ac85d6b51 (commit)
       via  65e0aa4afa15f50107bcb8c32a7bf1d82cdda6a2 (commit)
       via  05edb033a5b5acf22c83bc0deae0450e8a744d9d (commit)
       via  5a04e1903ab4a6e89f50b242fd12b16848b151ba (commit)
       via  431d216b909568eb27956df94ae817c5c12ebf6c (commit)
       via  55d99ed57949bde35ea7ba885cbcc82e837d123b (commit)
       via  68a4ea3e0f0e6962a046ede48943659552a2571b (commit)
       via  dc283b25461deb3a6a7ecbba68a29ad884c18351 (commit)
       via  3def05bc63165f7a797dc5589bfe14967a1dc657 (commit)
       via  981fb414e198602662f6d57a70c9d67be0ad2764 (commit)
      from  f7bf72eac2918ab558211d76c491b8481925273f (commit)

http://gitweb.samba.org/?p=obnox/samba-ctdb.git;a=shortlog;h=v3-4-ctdb


- Log -----------------------------------------------------------------
commit ad8b573e6b2a0df0dadadbe8d2395b8212a940f6
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Apr 29 12:14:08 2010 +0200

    s3: range-check idmap script output
    
    Not doing so results in the id mapping succeeding once unchecked and later on
    being refused, because when reading from the tdb we do the checks.

commit 969ed788505ea1ce75a73a7a38d4560c3acaa72f
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Apr 29 12:11:04 2010 +0200

    s3: Fix an uninitialized variable in idmap_tdb2_sid_to_id()
    
    When we find an invalid record in the database, there's no point in checking
    the non-existing value against the range limits.

commit 5f69b0021bfabca7f6c93a5113f2c41b72981fe4
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Apr 29 12:09:48 2010 +0200

    s3: Fix some nonempty blank lines

commit 61f9e5513db8584c0dbc2bfbdf4a1509c84e8a09
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Apr 26 16:30:34 2010 +0200

    v3-4-ctdb: Bump up the vendor patch level to 4

commit e6e9ba373f396a52f00e5275203889dcd5e14b3a
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Apr 26 16:44:34 2010 +0200

    s3: Implement "net rpc user setprimarygroup"

commit a457c6216ff8c5e42d5e56118867d9acb619087a
Author: Christian Ambach <christian.ambach at de.ibm.com>
Date:   Wed Apr 14 10:05:56 2010 +0200

    fix snapshot content display with hide unreadable
    
    With the hide unreadable option set, snapshots are be displayed
    as empty with shadow_copy2 and a NFSv4 ACL module.
    
    To prevent multiple conversions of the paths when the acl call
    does a VFS_STAT (as the nfs4acl code does), a check was added
    to convert_shadow2_name() so it will not touch paths any more
    that look like they have already been converted.
    
    Signed-off-by: Christian Ambach <christian.ambach at de.ibm.com>

commit 1cd08027fe5e3d66221c38d99d8e907771c6bb01
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Apr 13 12:09:21 2010 +0200

    libwbclient: Re-Fix a bug that was fixed with e5741e27c4c
    
    > r21878: Fix a bug with smbd serving a windows terminal server: If winbind
    > decides smbd to be idle it might happen that smbd needs to do a winbind
    > operation (for example sid2name) as non-root. This then fails to get the
    > privileged pipe. When later on on the same connection another authentication
    > request comes in, we try to do the CRAP auth via the non-privileged pipe.
    >
    > This adds a winbindd_priv_request_response() request that kills the existing
    > winbind pipe connection if it's not privileged.
    
    The fix for this was lost during the conversion to libwbclient.
    
    Thanks to Ira Cooper <samba at ira.wakeful.net> for pointing this out!
    
    Volker

commit 79bcb74445729ddc23f7ef7884dd0cc600755171
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Apr 9 17:19:13 2010 +0200

    s3: Cache the username map in gencache
    
    This is for uses with a heavy-weight username map script

commit a0264b98482843c20fec04959c7a04d86ceaa6c1
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Apr 9 14:30:54 2010 +0200

    s3: Little refactoring: Factor out skip_space

commit 97405a00556bc21ae21b2b6db236bb13bc8c5a9d
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Apr 9 14:28:44 2010 +0200

    s3: Remove a bogus 0-check, "isspace" can not return true for \0

commit a36e6bd85ab94853c3411c8bba869cc86e46c61a
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Apr 12 10:34:29 2010 +0200

    s3: Cache the result of the username map script

commit 83e7c624da575aeeb285c78585fb6641a4bf44cf
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Apr 9 14:09:20 2010 +0200

    s3: Use talloc_tos() as talloc ctx for fd_lines_load() in map_username()

commit 9fc3eb68e029c67bb876084558a1439a2e36f5d4
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Apr 9 14:05:09 2010 +0200

    s3: TALLOC_FREE(command) correctly in map_username()

commit e27b1f357f2cf7e45ccfd0be7cf35c0a17728d07
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Apr 8 15:24:02 2010 +0200

    v3-4-ctdb: Bump up the vendor patch level to 3

commit c3c3e7aeb104e6fc806c10385423856ca39d9c12
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Apr 7 17:45:12 2010 +0200

    s3: Fork multiple children per domain

commit 93ae6d5db1f45e3469888b17216e8a25b78415ea
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Apr 7 17:44:18 2010 +0200

    s3: Introduce winbindd_child_busy()

commit cf7c6e759d97535e9c7b2ffd9f35a90627dd641f
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Apr 7 17:43:37 2010 +0200

    s3: Remove the separate "child" argument from setup_domain_child()

commit 8a534963993302613adc75f8504d45724ee70ccb
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Apr 8 12:45:54 2010 +0200

    s3:winbindd: make "smbcontrol winbindd validate-cache" reliable again
    
    commit 73577205cf81644e7fe853eaf3e6459f7f443096
    (s3:winbindd: fix problems with SIGCHLD handling (bug #7317))
    broke this.
    
    metze
    (cherry picked from commit eb9b7d0363669574de8ec380089407890f15eac2)

commit 1b7cd7367c173f08c57b8856372daeab5613678c
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Apr 8 10:41:15 2010 +0200

    v3-4-ctdb: Bump up the vender patch level to 2

commit 2628b81a5a4b1fb0ec43f3dd865680dfad0fec4a
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Mar 30 09:50:09 2010 +0200

    s3:libads: retry with signing after getting LDAP_STRONG_AUTH_REQUIRED
    
    If server requires LDAP signing we're getting LDAP_STRONG_AUTH_REQUIRED,
    if "client ldap sasl wrapping = plain", instead of failing we now
    autoupgrade to "client ldap sasl wrapping = sign" for the given connection.
    
    metze
    (cherry picked from commit cc2ef27e369f0950ec931bf15cba4665c053ac53)

commit b638e42e63eea2e55f669dcac951eafc5bb99228
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Apr 1 18:10:47 2010 +0200

    s3:winbindd: remove unused variables
    
    metze
    (cherry picked from commit e18ddb6036f5e0a2211e89a7c9b5514c30a653cf)

commit 66fad494092695d7467950b0f34f5c6117230922
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Apr 1 16:23:06 2010 +0200

    s3:winbindd: fix problems with SIGCHLD handling (bug #7317)
    
    The main problem is that we call CatchChild() within the
    parent winbindd, which overwrites the signal handler
    that was registered by winbindd_setup_sig_chld_handler().
    
    That means winbindd_sig_chld_handler() and winbind_child_died()
    are never triggered when a winbindd domain child dies.
    As a result will get "broken pipe" for all requests to that domain.
    
    To reduce the risk of similar bugs in future we call
    CatchChild() in winbindd_reinit_after_fork() now.
    
    We also use a full winbindd_reinit_after_fork() in the
    cache validation child now instead instead of just resetting
    the SIGCHLD handler by hand. This will also fix possible
    tdb problems on systems without pread/pwrite and disabled mmap
    as we now correctly reopen the tdb handle for the child.
    
    metze
    (cherry picked from commit 73577205cf81644e7fe853eaf3e6459f7f443096)

commit cefa8e1a55329787787c3613f15f234ae31f85f3
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Apr 1 09:29:38 2010 +0200

    s3:winbindd: make sure we don't try rpc requests against unaccessable domains
    
    This makes sure we don't crash while trying to dereference domain->conn.cli->foo
    while trying to establish a rpc connection to the server.
    
    This fixes bug #7316.
    
    metze
    (cherry picked from commit d930904b997d310aeff781bde1e7e3ce47dde8a1)
    (cherry picked from commit 01b60b113869f526dcf3bb478d70df21dbb207c8)

commit adaadefe263d8cd192b67a63d1f1c13ba9bf748c
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Feb 23 08:42:41 2010 +0100

    s3:winbindd: never mark external domains as internal!
    
    This way we can endup with silently using builtin_passdb_methods
    for an ad domain without an inbound trust.
    
    This fixes bug #7170.
    
    metze
    (cherry picked from commit f924b7749280b31ece19885de1c3ad1bd71942ac)
    (cherry picked from commit 1ea768baa9bb38533d4bd273d6c4e7b1f5fd12bd)

commit ed858a25f24d5217167a5f91d4f938b3593d2987
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Mar 29 22:03:55 2010 +0200

    s3:winbindd: correctly retry if the netlogon pipe gets disconnected during a logon call
    
    This fixes hopefully the last part of bug #7295.
    
    metze
    (cherry picked from commit 4c6cde99c0751a073120d8bc36d40922d8027344)
    (cherry picked from commit 482518fcafb18bda1f084ebf1906a2ad02436b80)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 5f873b82d6065a98eefdbed544941c8daa4aed0b
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Apr 6 14:45:19 2010 +0200

    s3:winbindd_reconnect: don't only reconnect on NT_STATUS_UNSUCCESSFUL
    
    metze
    (cherry picked from commit 6bd5a2a3739938f95fce23ab2da652c9b5a48111)
    (cherry picked from commit 169628fcb656ba5987a99bd50c7f588b731eae51)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 9fbf94738fe8f385178cbca048983c4ff5493bae
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Mar 25 15:25:47 2010 +0100

    s3:winbindd_cm: invalidate connection if cm_connect_netlogon() fails
    
    metze
    (cherry picked from commit 94a4bcd2f0c0464e192556679c6636639cb307ea)
    (cherry picked from commit c046ae8428fb62ff2749689e7c738f1a2e8f8251)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 296364f71f4378faff1e5427e0f6e5324ba2b4a2
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Mar 25 15:17:07 2010 +0100

    s3:winbindd: consistently use TALLOC_FREE(conn->foo_pipe) is we create a new connection
    
    metze
    (cherry picked from commit 4f391fedac7111683d13f2d79fee7c0dbc27f86e)
    (cherry picked from commit c462e54142c00fdd81c2847d16a75119b1cc89fc)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit edb7d8aba47d1d6a6cb26ba345f589af9dd0cdb8
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Apr 6 14:42:04 2010 +0200

    s3:winbindd_cm: use rpccli_is_connected() helper function
    
    metze
    (cherry picked from commit d980c06a994d032a833adc8d56d2f2c037f8fdaf)
    (cherry picked from commit aa7d54ed04585a183a88363406ed7f3244b24d85)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit a46e20db5c1354150db71f23f37614e4703c2cc7
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Mar 25 15:14:02 2010 +0100

    s3:winbindd_cm: use cli_state_is_connected() helper function
    
    metze
    (cherry picked from commit 408a3eb35a0e61b5d66a3b48ebbd1a6796672d0f)
    (cherry picked from commit 00a93190d2cae31cd2213b810ea348c055670399)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 3b73fb01bb429094314f95989ee9e0201a94e980
Author: Stefan Metzmacher <metze at samba.org>
Date:   Sun Mar 28 19:34:34 2010 +0200

    s3:rpc_client: return at least 10 sec as old timeout in rpccli_set_timeout() instead of 0
    
    metze
    (cherry picked from commit 3e70da3f470eeb122f95477fb48d89939f501b3e)
    (cherry picked from commit 60861fba533027b6c9a0ff704b95dcf631ea3ca3)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit bebbc24e83ae645cc20b91c37300eec4fccab17a
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Apr 6 14:31:17 2010 +0200

    s3:rpc_client: add set_timeout hook to rpc_cli_transport
    
    metze
    (cherry picked from commit 99664ad15460530b6fb44957b6c57823f09884bf)
    (cherry picked from commit 89164eb8363ffc0b951256578be48d37ddba46b1)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 0089b40a0257ae5e819c0766817c5355f553dc2e
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Apr 6 14:26:29 2010 +0200

    s3:rpc_client: add rpccli_is_connected()
    
    metze
    (cherry picked from commit 4f41b53487ac9bc96c7960e8edab464558656373)
    (similar to commit 958b49323968740e2cbf69dc2a0a5dd57d5bcf87)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit baa12b3ba2d53d65a25920e293d34484f811ebb9
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Mar 29 14:58:19 2010 +0200

    s3:rpc_client: don't mix layers and keep a reference to cli_state in the caller
    
    We should not rely on the backend to have a reference to the cli_state.
    This will make it possible for the backend to set its cli_state reference
    to NULL, when the transport is dead.
    
    metze
    (cherry picked from commit dc09b12681ea0e6d4c2b0f1c99dfeb1f23019c65)
    (cherry picked from commit 1e2e47da82aeb249dce431541738a62cb139aebb)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 9498d95c02b5b596821df7438efe7900c9b52283
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Apr 6 12:23:39 2010 +0200

    s3:rpc_transport_np: use cli_state_is_connected() helper
    
    metze
    (cherry picked from commit b862351da8624df893ec77e020a456c1d23c58ed)
    (cherry picked from commit 8c2f4426ce178ac33748cfba01532ec2fd205710)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit fb8415561b9a21c31b1a6dd721902d16725e158f
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Mar 25 13:20:56 2010 +0100

    s3:libsmb: add cli_state_is_connected() function
    
    metze
    (cherry picked from commit d7bf30ef92031ffddcde3680b38e602510bcae24)
    (cherry picked from commit 589f73924273e8a9b54669f42a92381661dcb33f)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 20d9eb2892791064844a8dcc64c477fbd864a743
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Mar 29 18:23:40 2010 +0200

    s3:libsmb: don't let cli_shutdown() segfault with a NULL cli_state
    
    metze
    (similar to commit 47e10ab9a85960c78af807b66b99bcd139713644)
    (cherry picked from commit 957c0d4a5ee67ac70e576155a0f2f6f84cdb1596)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 632c20879069244db4ba400ee98ed80ed543fe57
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Apr 6 12:22:54 2010 +0200

    s3:rpc_transport_np: handle trans rdata like the output of a normal read
    
    Inspired by bug #7159.
    
    metze
    (cherry picked from commit 911287285cc4c8485b75edfad3c1ece901a69b0b)
    (cherry picked from commit e2739a2bf37e654c37cbea6e510f63a7ce4adfea)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit f6d3cf3d41d5342066e247f908439aba2f2807db
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Apr 6 14:14:53 2010 +0200

    s3: Fix infinite loop in NCACN_IP_TCP asa there is no timeout. Assume lsa_pipe_tcp is ok but network is down, then send request is ok, but select() on writeable fds loops forever since there is no response.
    
    Signed-off-by: Bo Yang <boyang at samba.org>
    (cherry picked from commit 36493bf2f6634b84c57107bcb86bcbf3e82e80fc)
    (similar to commit b58b359881c91ec382cfa1d6ba3007b8354b29cb)
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit e7b7fb1fa73fa255c2958773738bf19e68992b61
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Apr 6 14:06:39 2010 +0200

    Fix broken pipe handling
    
    Metze is right: If we have *any* error at the socket level, we just can
    not continue.
    
    Also, apply some defensive programming: With this async stuff someone else
    might already have closed the socket.
    (cherry picked from commit f140bf2e6578e45b8603d4a6c5feef9a3b735804)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit ce174393d5850687ba76d6f6349a174751733987
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Apr 6 14:04:33 2010 +0200

    s3:rpc_client: close the socket when pipe is broken
    
    Signed-off-by: Bo Yang <boyang at samba.org>
    (similar to commit aa70e44cd0576e5280e24cf35000369a47dd958f)
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit ae76673b11eae2fd1c50224faf68d90bc680dc08
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Apr 6 11:53:33 2010 +0200

    s3: fix crash in winbindd (similar to commit f8cc0e88fbbb082ead023e0cb437b1e12cf35459)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 711485723b2f723a9ad32b1b753f73a3d771c2a2
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Feb 19 14:24:17 2010 -0800

    Second part of fix for bug #7159 - client rpc_transport doesn't cope with bad server data returns.
    
    If server returns zero on a NP read. Report pipe broken.
    Prevents client from looping if it thinks there should be
    more data.
    
    Jeremy.
    (cherry picked from commit 0055e33dbed0e81548464d01bcf864255bab3159)
    (cherry picked from commit f5ca9f84e9b511c2ba7a4280b1997daa441f9877)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit a22cfb021e43382f9109972acbe4b9e2faefe3ab
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Apr 6 12:20:02 2010 +0200

    First part of fix for bug #7159 - client rpc_transport doesn't cope with bad server data returns.
    
    Ensure that subreq is *always* talloc_free'd in the _done
    function, as it has an event timeout attached. If the
    read requests look longer than the cli->timeout, then
    the timeout fn is called with already freed data.
    
    Jeremy.
    (cherry picked from commit ad77ae1d5870e06f8587ecf634e0b6bdcbb950d7)
    (similar to commit 6e5b6b5acb30869eb63b25ed1406014101a5e89d)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit d6d932f6d1cc3b780e038f87a269fc667caab7b0
Author: Christian Ambach <christian.ambach at de.ibm.com>
Date:   Mon Apr 5 14:12:52 2010 +0200

    fix a segfault in the notify subsystem
    
    When the notify_array cannot be loaded correctly,
    do not keep the half-baked parsing results in the global variable.
    
    This can lead to segfaults next time notify_load is entered and
    the seqnum has not changed. This has been seen in a case
    where mixed smbd versions were running in a CTDB cluster
    (versions with and w/o commit c216d1e6 that changed the
    notify_entry structure).
    There will be missed notifications until all smbds are at the
    same software level, but this should be acceptable and is better
    than crashing and interrupting client operations.
    
    This fix cleans up the notify_array, removes the unparseable data
    from the TDB and returns a fresh notify_array that can be worked
    with.
    
    The NDR_PRINT_DEBUG had to be moved to only be called when the
    parsing succeeded, it was seen to cause additional segfaults.
    
    The status variable is intentionally left to NT_STATUS_OK to not
    make callers abort and report errors to the clients and make them
    disconnect.
    
    Signed-off-by: Christian Ambach <christian.ambach at de.ibm.com>

commit c9d70a39238af9a01a91dd9c0b7fafaf8e45c841
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Mar 26 13:18:52 2010 +0100

    s3: Use tdb_transaction_start_nonblock in gencache_stabilize
    
    This avoids the thundering herd problem when 5000 smbds exit simultaneously
    because the network went down.

commit 1ef1f096624e524915a91ec404b5dd5b4f0259c4
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Mar 26 13:30:28 2010 +0100

    tdb: Add a non-blocking version of tdb_transaction_start

commit 2cdf8941421aaca50e20c8b86d0d292c2d66115d
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Mar 26 13:20:34 2010 +0100

    Revert "s3: Optimize gencache for smbd exit"
    
    This reverts commit e5a63346ecbfff1058c08402c40df927dbac51b8.
    
    That does not fully fix the problem, adding a tdb_transaction_start_nonblock to
    fix it.

commit 3673ee1c58887657ae2f1fef284603cf16c8f843
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Mar 23 19:46:07 2010 +0100

    s3:passdb: avoid sid_to_gid() if the sid is "domain users"
    
    If the call fails we would use the "domain users" sid anyway.
    
    metze
    (cherry picked from commit 9fbbaa560ae74f015e404cfa700753c0b5909519)

commit 3bff8467f25213dec7510fe2f598a711996dc94b
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Mar 18 12:50:22 2010 +0100

    s3: Implement an asynchronous echo responder process
    
    This replies to echo requests when the main smbd is stuck somewhere
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit cad0c004ad54d80dcb25803f0ebb317344a42792)

commit 0a0fce820ea5ad1fc10c0244225a32b50281e6d4
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Mar 19 15:47:11 2010 +0100

    s3:smbd: disable SMB encryption when the echo handler is active
    
    metze
    (cherry picked from commit 5a069f7209855e69082a176969533cc0d0ac0f55)

commit a44f88228d0750c0c00eb07916e51d07c0e04135
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Mar 22 09:11:05 2010 +0100

    s3:smbd: disallow readbraw and writebraw if the echo handler is active
    
    metze
    (cherry picked from commit d663b4c6c03450366375eb0951209bc374835935)

commit c6d52808bfbb450709ea3e7c66d7f0671cbb4e70
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Mar 19 12:08:13 2010 +0100

    s3:smbd: disable sendfile if the echo handler is active
    
    metze
    (cherry picked from commit fbf112bd1684acf420b104e0e7d66721af47c676)

commit 80dbcf7462ada909a7621ec5f5c111b79d076305
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Mar 18 20:22:26 2010 +0100

    s3:smbd: don't use recvfile if the echo handler is active
    
    metze
    (cherry picked from commit 453e6af5b81c8f206d87ec2e62fd79172f695950)

commit f8e58ec71738ff65aebd06ac978a6c5e9c4751d1
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Mar 22 09:45:43 2010 +0100

    s3:smbd: setup a shared memory area for the signing state
    
    metze
    (cherry picked from commit 79e5e3dda7178c4d3c5952a48474d6dcafba91ec)

commit 766c2cfbd3475a8d2e79dc04d9e4b5a162eae7a1
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Mar 22 09:43:48 2010 +0100

    s3:smbd: add echo handler information to struct smbd_server_connection
    
    metze
    (cherry picked from commit 44d655b33fecb7a543ff957940716ba93fec12cd)

commit 06f3fa0dbb0cb72e779b8aa135e0caa8180b9d54
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Mar 22 09:36:41 2010 +0100

    s3:param: add "async smb echo handler" option
    
    This will enable an extra forked process that will reply
    to SMBecho requests, while the main process is blocked by another
    request.
    
    metze
    (cherry picked from commit 752240ccdc4dcdce7a2270ee5544e007c44bcf4d)

commit e8c646f7aacf76f1198cc240a39b24cbf209b65c
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Mar 18 15:36:19 2010 +0100

    s3:smbd: pass down trusted_channel via receive_smb_talloc()
    
    metze
    (cherry picked from commit b2c107ffbcd067ccc42f81a2d0969f7f88b63ae7)

commit ba83b5baaa80e4a0af45d98fe3e7dbd7da2355a2
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Mar 19 12:04:32 2010 +0100

    s3:smbd: let reply_readbraw_error use the locked socket
    
    metze
    (cherry picked from commit 1e7086e5ce0924687d657de583adb63a9f0c1bfb)

commit 1fab5128f3a9dbaee732ceff08e602a1b18d28af
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Mar 19 12:02:27 2010 +0100

    s3:smbd: send keepalive packets under the socket lock
    
    metze
    (cherry picked from commit c1653e3b0e536e835faf82a5aadadaec1cd38d1a)

commit 2fd97052653be9398bfd6a313e4c53f993280e10
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Mar 18 09:23:48 2010 +0100

    s3:smbd: smbd_[un]lock_socket() while accessing the socket to the client
    
    metze
    (cherry picked from commit 977aa660f452d8ebc8f3a2f4bfbf0dda0bc230a2)

commit 8ed6ad7a2be28b50ce5a2f8a57956c1b1591adf5
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Mar 22 09:34:07 2010 +0100

    s3:smbd: add smbd_[un]lock_socket() dummies
    
    metze
    (cherry picked from commit 8de8554628bd3b16d9e488adfc31c8014c2eb1db)

commit 690dc634738c2b49e19edeeedc51ad419a8e610f
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Mar 22 09:31:57 2010 +0100

    s3:smbd: add an option to skip signings checks srv_check_sign_mac for trusted channels
    
    metze
    (cherry picked from commit 0b7da43da0bd5c7e0986854cda63103f082a26ee)

commit 35bb8f6ba49677a6f18883d80b36af366d7e3880
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Mar 17 15:07:07 2010 +0100

    s3:libsmb: add a smb_signing_init_ex() function
    
    Make it possible to overload memory handling functions.
    
    metze
    (cherry picked from commit 048c919dc0b7bc038becad34c2861c43c72c43c9)

commit d48d9346214221fa9645585f4123ea772a9b47ba
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Mar 22 09:30:39 2010 +0100

    lib/util: add allocate_anonymous_shared()
    
    metze
    (cherry picked from commit 01f2c023f7d2a4b0e016676638a062a5ba29ec0b)

commit e7cba4c7a341d1143d80dd4afc68c3eea3ca8456
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Mar 22 10:12:42 2010 +0100

    lib/async_sock: handle queue = NULL in writev_send()
    
    metze

commit 00ed3e25c53801b0d87703b166ab56780fe05d23
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Mar 15 15:40:34 2010 +0100

    s3:smbd: use new simplified smb_signing code in the server
    
    We keep the seqnum/mid mapping in the smb_request structure.
    
    This also moves one global variable into the
    smbd_server_connection struct.
    
    metze
    (cherry picked from commit c16c90a1cb3b0e2ceadd3dea835a4e69acfc2fae)

commit 89f6668c275a201d5a6b332e4b794b3c04889162
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Mar 9 08:42:05 2009 +0100

    s3:libsmb: add a much simplified smb_siging infrastructure
    
    It's the job of the caller to maintain the seqnum/mid mapping.
    
    Hopefully we can use this code in s4 later too.
    
    metze
    (cherry picked from commit 2654653f55ed5744cc9fca6a79127386f55425e1)

commit 8766b0e65dd53185a4241c791db01e2ac85d6b51
Author: Stefan Metzmacher <metze at samba.org>
Date:   Sun Mar 8 17:47:08 2009 +0100

    s3:libsmb: rename smb_signing.c => clisigning.c
    
    This prepares a large simplification of the smb_signing code
    
    metze
    (cherry picked from commit 1a48d0793b9d3a76aff76580661626e5cd95f427)

commit 65e0aa4afa15f50107bcb8c32a7bf1d82cdda6a2
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Mar 25 16:45:02 2010 +0100

    s3: Add a comment to notify_internal_parent_init, this is pretty confusing

commit 05edb033a5b5acf22c83bc0deae0450e8a744d9d
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Mar 25 16:44:41 2010 +0100

    s3: Add a comment to serverid_parent_init, this is pretty confusing

commit 5a04e1903ab4a6e89f50b242fd12b16848b151ba
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Mar 25 16:44:02 2010 +0100

    s3: Add a comment to messaging_tdb_parent_init, this is pretty confusing

commit 431d216b909568eb27956df94ae817c5c12ebf6c
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Mar 25 16:02:54 2010 +0100

    s3: Make sure our CLEAR_IF_FIRST optimization works for serverid.tdb
    
    In the child, we fully re-open serverid.tdb, which leads to one fcntl lock for
    CLEAR_IF_FIRST detection per smbd. This opens the tdb in the parent and holds
    it, so that tdb_reopen_all correctly catches the CLEAR_IF_FIRST bit.

commit 55d99ed57949bde35ea7ba885cbcc82e837d123b
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Mar 25 16:01:54 2010 +0100

    s3: Make sure our CLEAR_IF_FIRST optimization works for the notify tdbs
    
    The notify tdb files are opened at tconX time, which leads to one fcntl lock
    for CLEAR_IF_FIRST detection per smbd. This opens the tdbs in the parent and
    holds it, so that tdb_reopen_all correctly catches the CLEAR_IF_FIRST bit.

commit 68a4ea3e0f0e6962a046ede48943659552a2571b
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Mar 25 15:59:41 2010 +0100

    s3: Make sure our CLEAR_IF_FIRST optimization works for messaging.tdb
    
    In the child, we fully re-open messaging.tdb, which leads to one fcntl lock for
    CLEAR_IF_FIRST detection per smbd. This opens the tdb in the parent and holds
    it, so that tdb_reopen_all correctly catches the CLEAR_IF_FIRST bit.

commit dc283b25461deb3a6a7ecbba68a29ad884c18351
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Mar 24 10:28:46 2010 +0100

    v3-4-ctdb: Use connections_forall_read() in smbstatus
    
    This avoids a dmaster migration for every record when smbstatus is run

commit 3def05bc63165f7a797dc5589bfe14967a1dc657
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Mar 24 10:28:44 2010 +0100

    v3-4-ctdb: Add connections_forall_read()

commit 981fb414e198602662f6d57a70c9d67be0ad2764
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Mar 23 18:36:55 2010 +0100

    s3: Optimize gencache for smbd exit
    
    If thousands of smbds try to gencache_stabilize at the same time because the
    network died, all of them might be sitting in transaction_start. Don't do the
    stabilize transaction if nothing has changed in gencache_notrans.tdb.
    
    Volker

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

Summary of changes:
 lib/async_req/async_sock.c               |    7 +
 lib/tdb/common/lock.c                    |    8 +-
 lib/tdb/common/tdb_private.h             |    2 +-
 lib/tdb/common/transaction.c             |   16 +-
 lib/tdb/common/traverse.c                |    4 +-
 lib/tdb/include/tdb.h                    |    1 +
 lib/util/util.c                          |   28 +
 lib/util/util.h                          |    5 +
 nsswitch/libwbclient/wbc_idmap.c         |   32 +-
 nsswitch/libwbclient/wbc_pam.c           |   13 +-
 nsswitch/libwbclient/wbclient.c          |   31 +-
 nsswitch/libwbclient/wbclient_internal.h |    3 +
 source3/Makefile.in                      |    5 +-
 source3/VERSION                          |    2 +-
 source3/include/client.h                 |    4 +
 source3/include/includes.h               |    1 +
 source3/include/messages.h               |    2 +
 source3/include/proto.h                  |   44 +-
 source3/include/serverid.h               |    5 +
 source3/include/smb.h                    |    2 +
 source3/include/smb_signing.h            |   51 ++
 source3/lib/conn_tdb.c                   |   42 ++
 source3/lib/gencache.c                   |   11 +-
 source3/lib/messages_local.c             |   22 +
 source3/lib/serverid.c                   |   22 +
 source3/libads/sasl.c                    |   10 +
 source3/libsmb/async_smb.c               |   11 +-
 source3/libsmb/clientgen.c               |    4 +
 source3/libsmb/clierror.c                |   18 +
 source3/libsmb/clisigning.c              |  673 +++++++++++++++++++
 source3/libsmb/smb_signing.c             | 1051 +++++++-----------------------
 source3/modules/vfs_shadow_copy2.c       |    9 +-
 source3/param/loadparm.c                 |   46 ++-
 source3/passdb/pdb_get_set.c             |   11 +-
 source3/rpc_client/cli_pipe.c            |   58 ++-
 source3/rpc_client/rpc_transport_np.c    |  128 ++++
 source3/rpc_client/rpc_transport_smbd.c  |  101 +++-
 source3/rpc_client/rpc_transport_sock.c  |   87 +++-
 source3/smbd/aio.c                       |   12 +-
 source3/smbd/blocking.c                  |    5 +-
 source3/smbd/globals.h                   |   23 +
 source3/smbd/ipc.c                       |    4 +
 source3/smbd/map_username.c              |   69 ++-
 source3/smbd/negprot.c                   |    2 +-
 source3/smbd/notify.c                    |    7 +-
 source3/smbd/notify_internal.c           |   54 ++-
 source3/smbd/nttrans.c                   |    3 +-
 source3/smbd/open.c                      |    9 -
 source3/smbd/oplock.c                    |   27 +-
 source3/smbd/password.c                  |    8 +-
 source3/smbd/pipes.c                     |    1 +
 source3/smbd/process.c                   |  584 ++++++++++++++++-
 source3/smbd/reply.c                     |   56 ++-
 source3/smbd/server.c                    |   12 +
 source3/smbd/service.c                   |    2 +-
 source3/smbd/sesssetup.c                 |   25 -
 source3/smbd/signing.c                   |  260 ++++++++
 source3/smbd/trans2.c                    |   15 +-
 source3/utils/net_rpc.c                  |   59 ++
 source3/utils/status.c                   |    5 +-
 source3/winbindd/idmap_tdb2.c            |   42 +-
 source3/winbindd/winbindd.c              |   17 +-
 source3/winbindd/winbindd.h              |    2 +-
 source3/winbindd/winbindd_cm.c           |   73 ++-
 source3/winbindd/winbindd_domain.c       |   12 +-
 source3/winbindd/winbindd_dual.c         |   44 ++-
 source3/winbindd/winbindd_ndr.c          |    5 +-
 source3/winbindd/winbindd_pam.c          |    4 +-
 source3/winbindd/winbindd_proto.h        |    3 +-
 source3/winbindd/winbindd_reconnect.c    |   73 ++-
 source3/winbindd/winbindd_util.c         |   29 +-
 71 files changed, 2987 insertions(+), 1129 deletions(-)
 create mode 100644 source3/include/smb_signing.h
 create mode 100644 source3/libsmb/clisigning.c
 create mode 100644 source3/smbd/signing.c


Changeset truncated at 500 lines:

diff --git a/lib/async_req/async_sock.c b/lib/async_req/async_sock.c
index 39705f4..09ab7d0 100644
--- a/lib/async_req/async_sock.c
+++ b/lib/async_req/async_sock.c
@@ -404,6 +404,13 @@ struct tevent_req *writev_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
 		goto fail;
 	}
 
+	if (queue == NULL) {
+		writev_trigger(result, NULL);
+		if (!tevent_req_is_in_progress(result)) {
+			return tevent_req_post(result, ev);
+		}
+		return result;
+	}
 	if (!tevent_queue_add(queue, ev, result, writev_trigger, NULL)) {
 		goto fail;
 	}
diff --git a/lib/tdb/common/lock.c b/lib/tdb/common/lock.c
index f156c0f..16c93f3 100644
--- a/lib/tdb/common/lock.c
+++ b/lib/tdb/common/lock.c
@@ -299,13 +299,17 @@ int tdb_unlock(struct tdb_context *tdb, int list, int ltype)
 /*
   get the transaction lock
  */
-int tdb_transaction_lock(struct tdb_context *tdb, int ltype)
+int tdb_transaction_lock(struct tdb_context *tdb, int ltype, bool block)
 {
 	if (tdb->have_transaction_lock || tdb->global_lock.count) {
 		return 0;
 	}
 	if (tdb->methods->tdb_brlock(tdb, TRANSACTION_LOCK, ltype, 
-				     F_SETLKW, 0, 1) == -1) {
+				     block ? F_SETLKW : F_SETLK,
+				     0, 1) == -1) {
+		if (!block && (errno == EAGAIN)) {
+			return -1;
+		}
 		TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_transaction_lock: failed to get transaction lock\n"));
 		tdb->ecode = TDB_ERR_LOCK;
 		return -1;
diff --git a/lib/tdb/common/tdb_private.h b/lib/tdb/common/tdb_private.h
index ffac89f..562b813 100644
--- a/lib/tdb/common/tdb_private.h
+++ b/lib/tdb/common/tdb_private.h
@@ -180,7 +180,7 @@ int tdb_lock(struct tdb_context *tdb, int list, int ltype);
 int tdb_lock_nonblock(struct tdb_context *tdb, int list, int ltype);
 int tdb_unlock(struct tdb_context *tdb, int list, int ltype);
 int tdb_brlock(struct tdb_context *tdb, tdb_off_t offset, int rw_type, int lck_type, int probe, size_t len);
-int tdb_transaction_lock(struct tdb_context *tdb, int ltype);
+int tdb_transaction_lock(struct tdb_context *tdb, int ltype, bool block);
 int tdb_transaction_unlock(struct tdb_context *tdb);
 int tdb_brlock_upgrade(struct tdb_context *tdb, tdb_off_t offset, size_t len);
 int tdb_write_lock_record(struct tdb_context *tdb, tdb_off_t off);
diff --git a/lib/tdb/common/transaction.c b/lib/tdb/common/transaction.c
index 7acda64..d542a3f 100644
--- a/lib/tdb/common/transaction.c
+++ b/lib/tdb/common/transaction.c
@@ -398,7 +398,7 @@ static const struct tdb_methods transaction_methods = {
   start a tdb transaction. No token is returned, as only a single
   transaction is allowed to be pending per tdb_context
 */
-int tdb_transaction_start(struct tdb_context *tdb)
+static int _tdb_transaction_start(struct tdb_context *tdb, bool block)
 {
 	/* some sanity checks */
 	if (tdb->read_only || (tdb->flags & TDB_INTERNAL) || tdb->traverse_read) {
@@ -446,9 +446,12 @@ int tdb_transaction_start(struct tdb_context *tdb)
 	/* get the transaction write lock. This is a blocking lock. As
 	   discussed with Volker, there are a number of ways we could
 	   make this async, which we will probably do in the future */
-	if (tdb_transaction_lock(tdb, F_WRLCK) == -1) {
+	if (tdb_transaction_lock(tdb, F_WRLCK, block) == -1) {
 		SAFE_FREE(tdb->transaction->blocks);
 		SAFE_FREE(tdb->transaction);
+		if (!block) {
+			tdb->ecode = TDB_ERR_NOLOCK;
+		}
 		return -1;
 	}
 	
@@ -496,6 +499,15 @@ fail:
 	return -1;
 }
 
+int tdb_transaction_start(struct tdb_context *tdb)
+{
+	return _tdb_transaction_start(tdb, true);
+}
+
+int tdb_transaction_start_nonblock(struct tdb_context *tdb)
+{
+	return _tdb_transaction_start(tdb, false);
+}
 
 /*
   cancel the current transaction
diff --git a/lib/tdb/common/traverse.c b/lib/tdb/common/traverse.c
index 69c81e6..9e91c83 100644
--- a/lib/tdb/common/traverse.c
+++ b/lib/tdb/common/traverse.c
@@ -209,7 +209,7 @@ int tdb_traverse_read(struct tdb_context *tdb,
 	/* we need to get a read lock on the transaction lock here to
 	   cope with the lock ordering semantics of solaris10 */
 	if (!in_transaction) {
-		if (tdb_transaction_lock(tdb, F_RDLCK)) {
+		if (tdb_transaction_lock(tdb, F_RDLCK, true)) {
 			return -1;
 		}
 	}
@@ -244,7 +244,7 @@ int tdb_traverse(struct tdb_context *tdb,
 	}
 	
 	if (!in_transaction) {
-		if (tdb_transaction_lock(tdb, F_WRLCK)) {
+		if (tdb_transaction_lock(tdb, F_WRLCK, true)) {
 			return -1;
 		}
 	}
diff --git a/lib/tdb/include/tdb.h b/lib/tdb/include/tdb.h
index 94b5e36..3d76ffd 100644
--- a/lib/tdb/include/tdb.h
+++ b/lib/tdb/include/tdb.h
@@ -129,6 +129,7 @@ int tdb_fd(struct tdb_context *tdb);
 tdb_log_func tdb_log_fn(struct tdb_context *tdb);
 void *tdb_get_logging_private(struct tdb_context *tdb);
 int tdb_transaction_start(struct tdb_context *tdb);
+int tdb_transaction_start_nonblock(struct tdb_context *tdb);
 int tdb_transaction_commit(struct tdb_context *tdb);
 int tdb_transaction_cancel(struct tdb_context *tdb);
 int tdb_transaction_recover(struct tdb_context *tdb);
diff --git a/lib/util/util.c b/lib/util/util.c
index af682ac..09517a9 100644
--- a/lib/util/util.c
+++ b/lib/util/util.c
@@ -25,6 +25,8 @@
 #include "system/network.h"
 #include "system/filesys.h"
 #include "system/locale.h"
+#include "system/shmem.h"
+
 #undef malloc
 #undef strcasecmp
 #undef strncasecmp
@@ -916,4 +918,30 @@ bool next_token_no_ltrim_talloc(TALLOC_CTX *ctx,
 	return next_token_internal_talloc(ctx, ptr, pp_buff, sep, false);
 }
 
+/* Map a shared memory buffer of at least nelem counters. */
+void *allocate_anonymous_shared(size_t bufsz)
+{
+	void *buf;
+	size_t pagesz = getpagesize();
+
+	if (bufsz % pagesz) {
+		bufsz = (bufsz + pagesz) % pagesz; /* round up to pagesz */
+	}
+
+#ifdef MAP_ANON
+	/* BSD */
+	buf = mmap(NULL, bufsz, PROT_READ|PROT_WRITE, MAP_ANON|MAP_SHARED,
+			-1 /* fd */, 0 /* offset */);
+#else
+	buf = mmap(NULL, bufsz, PROT_READ|PROT_WRITE, MAP_FILE|MAP_SHARED,
+			open("/dev/zero", O_RDWR), 0 /* offset */);
+#endif
+
+	if (buf == MAP_FAILED) {
+		return NULL;
+	}
+
+	return buf;
+
+}
 
diff --git a/lib/util/util.h b/lib/util/util.h
index defef12..8bae4d1 100644
--- a/lib/util/util.h
+++ b/lib/util/util.h
@@ -771,4 +771,9 @@ bool unmap_file(void *start, size_t size);
 
 void print_asc(int level, const uint8_t *buf,int len);
 
+/**
+ * Allocate anonymous shared memory of the given size
+ */
+void *allocate_anonymous_shared(size_t bufsz);
+
 #endif /* _SAMBA_UTIL_H_ */
diff --git a/nsswitch/libwbclient/wbc_idmap.c b/nsswitch/libwbclient/wbc_idmap.c
index 5b2ab87..318e963 100644
--- a/nsswitch/libwbclient/wbc_idmap.c
+++ b/nsswitch/libwbclient/wbc_idmap.c
@@ -222,8 +222,8 @@ wbcErr wbcAllocateUid(uid_t *puid)
 
 	/* Make request */
 
-	wbc_status = wbcRequestResponse(WINBINDD_ALLOCATE_UID,
-					   &request, &response);
+	wbc_status = wbcRequestResponsePriv(WINBINDD_ALLOCATE_UID,
+					    &request, &response);
 	BAIL_ON_WBC_ERROR(wbc_status);
 
 	/* Copy out result */
@@ -252,8 +252,8 @@ wbcErr wbcAllocateGid(gid_t *pgid)
 
 	/* Make request */
 
-	wbc_status = wbcRequestResponse(WINBINDD_ALLOCATE_GID,
-					   &request, &response);
+	wbc_status = wbcRequestResponsePriv(WINBINDD_ALLOCATE_GID,
+					    &request, &response);
 	BAIL_ON_WBC_ERROR(wbc_status);
 
 	/* Copy out result */
@@ -298,8 +298,8 @@ wbcErr wbcSetUidMapping(uid_t uid, const struct wbcDomainSid *sid)
 		sizeof(request.data.dual_idmapset.sid)-1);
 	wbcFreeMemory(sid_string);
 
-	wbc_status = wbcRequestResponse(WINBINDD_SET_MAPPING,
-					&request, &response);
+	wbc_status = wbcRequestResponsePriv(WINBINDD_SET_MAPPING,
+					    &request, &response);
 	BAIL_ON_WBC_ERROR(wbc_status);
 
  done:
@@ -335,8 +335,8 @@ wbcErr wbcSetGidMapping(gid_t gid, const struct wbcDomainSid *sid)
 		sizeof(request.data.dual_idmapset.sid)-1);
 	wbcFreeMemory(sid_string);
 
-	wbc_status = wbcRequestResponse(WINBINDD_SET_MAPPING,
-					&request, &response);
+	wbc_status = wbcRequestResponsePriv(WINBINDD_SET_MAPPING,
+					    &request, &response);
 	BAIL_ON_WBC_ERROR(wbc_status);
 
  done:
@@ -372,8 +372,8 @@ wbcErr wbcRemoveUidMapping(uid_t uid, const struct wbcDomainSid *sid)
 		sizeof(request.data.dual_idmapset.sid)-1);
 	wbcFreeMemory(sid_string);
 
-	wbc_status = wbcRequestResponse(WINBINDD_REMOVE_MAPPING,
-					&request, &response);
+	wbc_status = wbcRequestResponsePriv(WINBINDD_REMOVE_MAPPING,
+					    &request, &response);
 	BAIL_ON_WBC_ERROR(wbc_status);
 
  done:
@@ -409,8 +409,8 @@ wbcErr wbcRemoveGidMapping(gid_t gid, const struct wbcDomainSid *sid)
 		sizeof(request.data.dual_idmapset.sid)-1);
 	wbcFreeMemory(sid_string);
 
-	wbc_status = wbcRequestResponse(WINBINDD_REMOVE_MAPPING,
-					&request, &response);
+	wbc_status = wbcRequestResponsePriv(WINBINDD_REMOVE_MAPPING,
+					    &request, &response);
 	BAIL_ON_WBC_ERROR(wbc_status);
 
  done:
@@ -434,8 +434,8 @@ wbcErr wbcSetUidHwm(uid_t uid_hwm)
 	request.data.dual_idmapset.id = uid_hwm;
 	request.data.dual_idmapset.type = _ID_TYPE_UID;
 
-	wbc_status = wbcRequestResponse(WINBINDD_SET_HWM,
-					&request, &response);
+	wbc_status = wbcRequestResponsePriv(WINBINDD_SET_HWM,
+					    &request, &response);
 	BAIL_ON_WBC_ERROR(wbc_status);
 
  done:
@@ -459,8 +459,8 @@ wbcErr wbcSetGidHwm(gid_t gid_hwm)
 	request.data.dual_idmapset.id = gid_hwm;
 	request.data.dual_idmapset.type = _ID_TYPE_GID;
 
-	wbc_status = wbcRequestResponse(WINBINDD_SET_HWM,
-					&request, &response);
+	wbc_status = wbcRequestResponsePriv(WINBINDD_SET_HWM,
+					    &request, &response);
 	BAIL_ON_WBC_ERROR(wbc_status);
 
  done:
diff --git a/nsswitch/libwbclient/wbc_pam.c b/nsswitch/libwbclient/wbc_pam.c
index 02dc700..e2a61f1 100644
--- a/nsswitch/libwbclient/wbc_pam.c
+++ b/nsswitch/libwbclient/wbc_pam.c
@@ -459,9 +459,11 @@ wbcErr wbcAuthenticateUserEx(const struct wbcAuthUserParams *params,
 		request.flags |= params->flags;
 	}
 
-	wbc_status = wbcRequestResponse(cmd,
-					&request,
-					&response);
+	if (cmd == WINBINDD_PAM_AUTH_CRAP) {
+		wbc_status = wbcRequestResponsePriv(cmd, &request, &response);
+	} else {
+		wbc_status = wbcRequestResponse(cmd, &request, &response);
+	}
 	if (response.data.auth.nt_status != 0) {
 		if (error) {
 			wbc_status = wbc_create_error_info(NULL,
@@ -513,9 +515,8 @@ wbcErr wbcCheckTrustCredentials(const char *domain,
 
 	/* Send request */
 
-	wbc_status = wbcRequestResponse(WINBINDD_CHECK_MACHACC,
-					&request,
-					&response);
+	wbc_status = wbcRequestResponsePriv(WINBINDD_CHECK_MACHACC,
+					    &request, &response);
 	if (response.data.auth.nt_status != 0) {
 		if (error) {
 			wbc_status = wbc_create_error_info(NULL,
diff --git a/nsswitch/libwbclient/wbclient.c b/nsswitch/libwbclient/wbclient.c
index f5c7231..a4ef0be 100644
--- a/nsswitch/libwbclient/wbclient.c
+++ b/nsswitch/libwbclient/wbclient.c
@@ -29,6 +29,9 @@
 NSS_STATUS winbindd_request_response(int req_type,
 				     struct winbindd_request *request,
 				     struct winbindd_response *response);
+NSS_STATUS winbindd_priv_request_response(int req_type,
+					  struct winbindd_request *request,
+					  struct winbindd_response *response);
 
 /** @brief Wrapper around Winbind's send/receive API call
  *
@@ -52,16 +55,20 @@ NSS_STATUS winbindd_request_response(int req_type,
  --Volker
 **********************************************************************/
 
-wbcErr wbcRequestResponse(int cmd,
-			  struct winbindd_request *request,
-			  struct winbindd_response *response)
+static wbcErr wbcRequestResponseInt(
+	int cmd,
+	struct winbindd_request *request,
+	struct winbindd_response *response,
+	NSS_STATUS (*fn)(int req_type,
+			 struct winbindd_request *request,
+			 struct winbindd_response *response))
 {
 	wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
 	NSS_STATUS nss_status;
 
 	/* for some calls the request and/or response can be NULL */
 
-	nss_status = winbindd_request_response(cmd, request, response);
+	nss_status = fn(cmd, request, response);
 
 	switch (nss_status) {
 	case NSS_STATUS_SUCCESS:
@@ -81,6 +88,22 @@ wbcErr wbcRequestResponse(int cmd,
 	return wbc_status;
 }
 
+wbcErr wbcRequestResponse(int cmd,
+			  struct winbindd_request *request,
+			  struct winbindd_response *response)
+{
+	return wbcRequestResponseInt(cmd, request, response,
+				     winbindd_request_response);
+}
+
+wbcErr wbcRequestResponsePriv(int cmd,
+			      struct winbindd_request *request,
+			      struct winbindd_response *response)
+{
+	return wbcRequestResponseInt(cmd, request, response,
+				     winbindd_priv_request_response);
+}
+
 /** @brief Translate an error value into a string
  *
  * @param error
diff --git a/nsswitch/libwbclient/wbclient_internal.h b/nsswitch/libwbclient/wbclient_internal.h
index fc03c54..5ce8207 100644
--- a/nsswitch/libwbclient/wbclient_internal.h
+++ b/nsswitch/libwbclient/wbclient_internal.h
@@ -28,5 +28,8 @@ wbcErr wbcRequestResponse(int cmd,
 			  struct winbindd_request *request,
 			  struct winbindd_response *response);
 
+wbcErr wbcRequestResponsePriv(int cmd,
+			      struct winbindd_request *request,
+			      struct winbindd_response *response);
 
 #endif      /* _WBCLIENT_INTERNAL_H */
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 3b9ff02..e052667 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -381,7 +381,8 @@ LIB_OBJ = $(LIBSAMBAUTIL_OBJ) $(UTIL_OBJ) $(CRYPTO_OBJ) \
 	  lib/util.o lib/util_sock.o lib/sock_exec.o lib/util_sec.o \
 	  lib/substitute.o lib/dbwrap_util.o \
 	  lib/ms_fnmatch.o lib/select.o lib/errmap_unix.o \
-	  lib/tallocmsg.o lib/dmallocmsg.o libsmb/smb_signing.o \
+	  lib/tallocmsg.o lib/dmallocmsg.o \
+	  libsmb/clisigning.o libsmb/smb_signing.o \
 	  lib/iconv.o lib/pam_errors.o intl/lang_tdb.o \
 	  lib/conn_tdb.o lib/adt_tree.o lib/gencache.o \
 	  lib/module.o lib/events.o @LIBTEVENT_OBJ0@ \
@@ -740,7 +741,7 @@ SMBD_OBJ_SRV = smbd/files.o smbd/chgpasswd.o smbd/connection.o \
 	       smbd/change_trust_pw.o smbd/fake_file.o \
 	       smbd/quotas.o smbd/ntquotas.o $(AFS_OBJ) smbd/msdfs.o \
 	       $(AFS_SETTOKEN_OBJ) smbd/aio.o smbd/statvfs.o \
-	       smbd/dmapi.o \
+	       smbd/dmapi.o smbd/signing.o \
 	       smbd/file_access.o \
 	       smbd/dnsregister.o smbd/globals.o \
 	       $(MANGLE_OBJ) @VFS_STATIC@
diff --git a/source3/VERSION b/source3/VERSION
index 719f898..661b625 100644
--- a/source3/VERSION
+++ b/source3/VERSION
@@ -85,7 +85,7 @@ SAMBA_VERSION_IS_GIT_SNAPSHOT=
 #                                                      #
 ########################################################
 SAMBA_VERSION_VENDOR_SUFFIX="ctdb"
-SAMBA_VERSION_VENDOR_PATCH=1
+SAMBA_VERSION_VENDOR_PATCH=4
 
 ########################################################
 # This can be set by vendors if they want..            #
diff --git a/source3/include/client.h b/source3/include/client.h
index 1914210..d80989d 100644
--- a/source3/include/client.h
+++ b/source3/include/client.h
@@ -110,6 +110,10 @@ struct rpc_cli_transport {
 	 */
 	NTSTATUS (*trans_recv)(struct async_req *req, TALLOC_CTX *mem_ctx,
 			       uint8_t **prdata, uint32_t *prdata_len);
+
+	bool (*is_connected)(void *priv);
+	unsigned int (*set_timeout)(void *priv, unsigned int timeout);
+
 	void *priv;
 };
 
diff --git a/source3/include/includes.h b/source3/include/includes.h
index 61c8db0..2a0f07c 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -616,6 +616,7 @@ struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx);
 #include "messages.h"
 #include "locking.h"
 #include "smb_perfcount.h"
+#include "smb_signing.h"
 #include "smb.h"
 #include "nameserv.h"
 #include "secrets.h"
diff --git a/source3/include/messages.h b/source3/include/messages.h
index 6063d35..865ffd4 100644
--- a/source3/include/messages.h
+++ b/source3/include/messages.h
@@ -111,6 +111,8 @@ NTSTATUS messaging_tdb_init(struct messaging_context *msg_ctx,
 			    TALLOC_CTX *mem_ctx,
 			    struct messaging_backend **presult);
 
+bool messaging_tdb_parent_init(void);
+
 NTSTATUS messaging_ctdbd_init(struct messaging_context *msg_ctx,
 			      TALLOC_CTX *mem_ctx,
 			      struct messaging_backend **presult);
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 8a8b272..0ec3cc0 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -435,6 +435,10 @@ int connections_forall(int (*fn)(struct db_record *rec,
 				 const struct connections_data *data,
 				 void *private_data),
 		       void *private_data);
+int connections_forall_read(int (*fn)(const struct connections_key *key,
+				      const struct connections_data *data,
+				      void *private_data),
+			    void *private_data);
 bool connections_init(bool rw);
 
 /* The following definitions come from lib/dbwrap_util.c  */
@@ -2466,6 +2470,7 @@ bool cli_is_dos_error(struct cli_state *cli);
 NTSTATUS cli_get_nt_error(struct cli_state *cli);
 void cli_set_nt_error(struct cli_state *cli, NTSTATUS status);
 void cli_reset_error(struct cli_state *cli);
+bool cli_state_is_connected(struct cli_state *cli);
 
 /* The following definitions come from libsmb/clifile.c  */
 
@@ -3191,7 +3196,7 @@ void cli_free_enc_buffer(struct cli_state *cli, char *buf);
 NTSTATUS cli_decrypt_message(struct cli_state *cli);
 NTSTATUS cli_encrypt_message(struct cli_state *cli, char *buf, char **buf_out);
 
-/* The following definitions come from libsmb/smb_signing.c  */
+/* The following definitions come from libsmb/clisigning.c  */
 
 bool cli_simple_set_signing(struct cli_state *cli,
 			    const DATA_BLOB user_session_key,
@@ -3204,16 +3209,22 @@ bool cli_check_sign_mac(struct cli_state *cli, char *buf);
 bool client_set_trans_sign_state_on(struct cli_state *cli, uint16 mid);
 bool client_set_trans_sign_state_off(struct cli_state *cli, uint16 mid);
 bool client_is_signing_on(struct cli_state *cli);


-- 
SAMBA-CTDB repository


More information about the samba-cvs mailing list