[SCM] SAMBA-CTDB repository - branch v3-6-ctdb updated - 8bb66c79838e1104379512a5bd3ad8e0e23478ee

Michael Adam obnox at samba.org
Mon Mar 7 14:16:19 MST 2011


The branch, v3-6-ctdb has been updated
  discards  b7c95dd82d9561ed3b731b4c085c6291b82962e2 (commit)
  discards  4b96e9456dc8791c998f8af7df2417c6022b11b2 (commit)
  discards  4e91bd0ed227bfa50b5da5143c83358088debb3a (commit)
  discards  2de7e11229a183c6568c46ad44bf5994d048310f (commit)
  discards  35c13833ce9e30f4fa13bf08ca6f13d28213d36f (commit)
  discards  0b2c9b07f8fbc2a6ffc661436e15783ae982ad4a (commit)
  discards  eb5409c2cec0b91712be24b30c32cde895603071 (commit)
  discards  222dce31cbe523cdfb8128c08b96f620eb0f4920 (commit)
  discards  f2778696d8854b734cf22ab69ead2db9592ed6e3 (commit)
  discards  ddf368541d2dbf403c320422dc0673ca7c8df697 (commit)
  discards  2369ed2f3183f9bf54f583c0cb3b1fef5dc60c65 (commit)
  discards  fb2522bb90cbe603a48b74477915cd9fb4546e42 (commit)
  discards  8a1154d1baa0bc2d3f3976c93b594f23d68ab951 (commit)
  discards  6e70827ffb9145636d3fcfb8efb4fce17f633c9e (commit)
  discards  539e5b08add7ec84930619b45d861ce0e2664246 (commit)
  discards  f872181335e0e53b5546bf0a82209a5e861b314e (commit)
  discards  d89792e20e3023f0eb7c999f7667b4e45b22e3e8 (commit)
  discards  0f3b94a66564441ddf9a82d3fd6e36b40cdb1abd (commit)
  discards  22972ce019b8bbe4ccf449b9da7dfffec65c9b6a (commit)
  discards  72ff770889e2af27264cf631afa18591b3dafabc (commit)
       via  8bb66c79838e1104379512a5bd3ad8e0e23478ee (commit)
       via  4368966a5e320c116b07c216de87bb3a4c0deec1 (commit)
       via  fb3dec8cf6713c8fb2ed4608b4d7efd2e2575844 (commit)
       via  640200045655a6411f2fc4057631ef85cb66e7e0 (commit)
       via  c04cd88cf78933dde756b31f13e0f78104b3f8ca (commit)
       via  9642f3049663580ffdc901ed1f175f6542d788c0 (commit)
       via  e2c36806f0578450a390d702db3ef333f5cd054a (commit)
       via  208017d45b684fdc61f730b68612ee5304b281fa (commit)
       via  69e3228c20ea5d08bda8a9a1fba3558b4d6dea08 (commit)
       via  01f8a1cfe3f805f726a6001e679d8e429ba9b442 (commit)
       via  2b462ddc2695e09595706da2424762947a7b3fc2 (commit)
       via  3d3a93b2f25fc7999fb1e351a6854088e1e59910 (commit)
       via  dfde1cefc617b4ffed6450f45e229e397da9a274 (commit)
       via  925aeb0bda087fd5ac13228f1af2a6192564739c (commit)
       via  8506b7604b54becde9157f46efd56f3b0a233f6a (commit)
       via  d8f4a071062752bf630c1c846b794ddd7cb7b35f (commit)
       via  154a34fcdd0e621eb7270c0ecb425a200820a7df (commit)
       via  0c6a823f1920629e7366c1814df0e97424a346ec (commit)
       via  46cae09a39be98bee77345afd0adbf62621421f5 (commit)
       via  3d1069f1ae6e1665dddb75f90b4a1f941fb663d2 (commit)
       via  9478dd98f27913b87236e54e0f606c0eda559a6e (commit)
       via  754f980e87f8e8902826dea8735ba0addd13ad0c (commit)
       via  aadf1e6a8cd90903b23fc1d76d0d51cc400380b3 (commit)
       via  b0fe017917bf891d401a9f2a61a4f47805f89281 (commit)
       via  2a791861462977a82b33ad57a4d5203dc9270aff (commit)
       via  b0ad40783e4d04c8cde07baaa84bed4ccf83e9c4 (commit)
       via  ad0afa03a813a26a8e62f15ca7569343804ec8f3 (commit)
       via  bcfbaf937f4e27010cdd5c7cbd378fd1f298664d (commit)
       via  15257836ab70122823aabdb2073e96282d200eab (commit)
       via  c9a0e4bfcb1e3bf226004ce27b99da712c74b233 (commit)
       via  0a65c2324f89b56792403de9b7df042262eccca5 (commit)
       via  684b594b5106353c508cda885e9d00c3c266e6d7 (commit)
       via  00e93ca79b934e4907667494e3ae7471a3b50325 (commit)
       via  4ae3d540f46a87947d48e62838b7b6849e5c5c5b (commit)
       via  472227167df70ac2f77b24114b50d69527ef6fe7 (commit)
       via  50108fb6740fd5f44b29c8dc745fffac37578cac (commit)
       via  b0eb58cc78068c7edc2a09c7fa5c94d04802c124 (commit)
       via  2e0534a7ed886a3e29140d961e2a393856e2c3c6 (commit)
       via  b1a14a2acd594a63740fbafdce7ec6e5de452edc (commit)
       via  2a5e9efc76fbc9e608273007d5447de49b8aec7e (commit)
       via  d64035043053707dde17d97ef082ebe9e653daea (commit)
       via  28fdc60a7f87e0bb6c93c4bfa8a7417abe6745f6 (commit)
       via  8bd0bc2fa2db1e2062ec7acbb9ba30bc8c61fe88 (commit)
       via  14d95151c9aff506dd93da7fcbc8e4e7587a19c8 (commit)
       via  880fb9c4d60cca6e04c3f6252e4020bc9a2f8c5b (commit)
       via  1dc3d730fc9d9ba1b7cc5268fefcd8640252f1e8 (commit)
       via  73807b0ff5696726767800c23b22b57c43b8063c (commit)
       via  c7b72289feba915b24199298d64687e950d4c0e6 (commit)
       via  c2b8134a970d173359bfdca55fbb1ff58f9800a1 (commit)
       via  66d4fcb37013a40b8193978bc204e93ee2a51985 (commit)
       via  79cef6647e09a4a25ce9fa8d9fb96289d58fc00a (commit)
       via  19abfbacd8bea266715c13cce6e2a109ca4eef1e (commit)
       via  c6ddf70a238f2341768afdcd28d7db4218c6dd94 (commit)
       via  1046a5ee40695fab90a724ba99cfde5656d10b52 (commit)
       via  a891f9fda4f58cddf43ddcf8065adbfc128242dd (commit)
       via  e3ac2af0da93075a65a6ef703183615e663a6e7a (commit)
       via  08f0055279b77602ed2c8a3ad3e852d475fbacc2 (commit)
       via  529291bb20db44b9a253ee0183fc40abf6b2fc6c (commit)
       via  faf4b99182c62f43896f74b09947badc215e7d02 (commit)
       via  47b978d4119e797af3c0098e01add503d598eca0 (commit)
       via  1ea17bacdb09d28a12a8b6ddeba3ac285cd9f905 (commit)
       via  ba1a72cb153892e491af91a6bb61e1820135fa12 (commit)
       via  757471a5fcd4f95da28402bae6c9ceccff7d6548 (commit)
       via  9313b5d1da24406dd7d26afb2488fee0cbea44a9 (commit)
       via  0fb64a26b3b35b75f2f548d882bed41aa0386c6b (commit)
       via  6648ce8990a97da739d4be69657e9ace6198068c (commit)
       via  5f8b7f95e9ce5946f048b242dbbaa14897aea919 (commit)
       via  ebd82cc7bb45ee9f0407f6c5415c836bd62b4098 (commit)
       via  83efd14646cb4376eae8a14db8c1cee75785e159 (commit)
       via  5232f3d263ab7e66003cc971c667528635008dc1 (commit)
       via  04ce66bdb196ab01709aa80e93c0dd570ec0f5e2 (commit)
      from  b7c95dd82d9561ed3b731b4c085c6291b82962e2 (commit)

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


- Log -----------------------------------------------------------------
commit 8bb66c79838e1104379512a5bd3ad8e0e23478ee
Author: Michael Adam <obnox at samba.org>
Date:   Thu Feb 10 00:37:30 2011 +0100

    v3-6-ctdb: VERSION bump vendor patch level to 4

commit 4368966a5e320c116b07c216de87bb3a4c0deec1
Author: Michael Adam <obnox at samba.org>
Date:   Thu Feb 10 00:37:30 2011 +0100

    v3-6-ctdb: VERSION bump vendor patch level to 3

commit fb3dec8cf6713c8fb2ed4608b4d7efd2e2575844
Author: Michael Adam <obnox at samba.org>
Date:   Thu Feb 10 00:37:30 2011 +0100

    v3-6-ctdb: VERSION bump vendor patch level to 2

commit 640200045655a6411f2fc4057631ef85cb66e7e0
Author: Michael Adam <obnox at samba.org>
Date:   Thu Feb 10 07:33:56 2011 +0100

    v3-6-ctdb: packaging/RHEL-CTDB: replace Prereq by Requires.
    
    In RHEL6, Prereq is deprecated.

commit c04cd88cf78933dde756b31f13e0f78104b3f8ca
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Dec 15 00:16:56 2008 +0100

    v3-6-ctdb: s3: Add the "net groupfilter" command
    
    This is the start of a bad hack for even worse systems: Many Unix systems still
    have the NGROUPS problem: A user can not be member of more than a very limited
    number of groups. Solaris for example limits this to 16 by default. Many
    Windows environments have a *LOT* more groups per user, some even go to
    hundreds. Whether that is efficient is debatable, but it's there.
    
    This patch implements the
    
    "net groupfilter"
    
    command with the "addsid", "delsid" and "list" subcommands. If any SIDs are
    present according to "net groupfilter list" (they are stored in secrets.tdb),
    then only the SIDs in that list are converted to GIDs for a user at login time.
    
    This gives the Administrator the possibility to define a set of groups that are
    used on the Unix box, making sure that no user is in more than NGROUPS of those
    at a time.
    
    This patch is incomplete in the sense that winbind is not aware of this, only
    smbd. So it is kind of an emergency hack for smbd-only machines.
    
    Volker
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 9642f3049663580ffdc901ed1f175f6542d788c0
Author: Michael Adam <obnox at samba.org>
Date:   Fri Dec 3 02:13:46 2010 -0700

    v3-6-ctdb: packaging/RHEL-CTDB: improve fix for debuginfo builds

commit e2c36806f0578450a390d702db3ef333f5cd054a
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Dec 3 02:13:46 2010 -0700

    v3-6-ctdb: packaging/RHEL-CTDB: Fix debuginfo builds

commit 208017d45b684fdc61f730b68612ee5304b281fa
Author: Michael Adam <obnox at samba.org>
Date:   Fri Jan 21 15:44:53 2011 +0100

    Revert "v3-6-ctdb: s3:vfs: Add a gpfs_prefetch module."
    
    This reverts commit 36713652a1f0ccee3e84c3c58d46f03141e43513.
    
    The gpfs_prefetch module needs to be properly merged:
    The vfs API has changed.

commit 69e3228c20ea5d08bda8a9a1fba3558b4d6dea08
Author: Michael Adam <obnox at samba.org>
Date:   Fri Jan 21 15:44:18 2011 +0100

    Revert "v3-6-ctdb: packaging/RHEL-CTDB: Fix the RPM build: list the gpfs_prefetch vfs module"
    
    This reverts commit 18296ef666202ae15cba6b7a6f25c3692f13f7e4.
    
    The gpfs prefetch mdule needs to be properly merged:
    The vfs api has changed.

commit 01f8a1cfe3f805f726a6001e679d8e429ba9b442
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Mar 5 16:10:49 2010 +0100

    v3-6-ctdb: packaging/RHEL-CTDB: Fix the RPM build: list the gpfs_prefetch vfs module

commit 2b462ddc2695e09595706da2424762947a7b3fc2
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Jan 21 14:07:15 2011 +0100

    v3-6-ctdb: s3:vfs: Add a gpfs_prefetch module.
    
    This can not go upstream yet because it uses the gpfs_fcntl call
    from the non-GPL libgpfs.

commit 3d3a93b2f25fc7999fb1e351a6854088e1e59910
Author: Andrew Tridgell <tridge at samba.org>
Date:   Mon Apr 21 18:41:32 2008 +0200

    v3-6-ctdb: apply patch from v3-0-ctdb to special case root in libnss_winbind
    
    This is needed to ensure the administrator can login to a node even
    when ctdbd and winbindd are stuck

commit dfde1cefc617b4ffed6450f45e229e397da9a274
Author: Michael Adam <obnox at samba.org>
Date:   Tue Jan 18 13:19:55 2011 +0100

    v3-6-ctdb: add README.v3-6-ctdb

commit 925aeb0bda087fd5ac13228f1af2a6192564739c
Author: Michael Adam <obnox at samba.org>
Date:   Tue Jun 23 16:41:38 2009 +0200

    v3-6-ctdb: VERSION: add vendor-suffix "ctdb" and vendor-patch level "1"
    
    Michael
    
    following the versioning scheme of the v3-2-ctdb branch
    
    Michael

commit 8506b7604b54becde9157f46efd56f3b0a233f6a
Author: Michael Adam <obnox at samba.org>
Date:   Wed Apr 8 19:28:52 2009 +0200

    v3-6-ctdb: VERSION: set version to non-snapshot..

commit d8f4a071062752bf630c1c846b794ddd7cb7b35f
Author: Gregor Beck <gbeck at sernet.de>
Date:   Mon Mar 7 09:57:10 2011 +0100

    s3-docs: manpage for "net idmap delete"
    
    Autobuild-User: Michael Adam <obnox at samba.org>
    Autobuild-Date: Mon Mar  7 14:26:42 CET 2011 on sn-devel-104

commit 154a34fcdd0e621eb7270c0ecb425a200820a7df
Author: Gregor Beck <gbeck at sernet.de>
Date:   Mon Mar 7 09:56:48 2011 +0100

    s3-docs: manpage for "smbcontrol xx idmap"

commit 0c6a823f1920629e7366c1814df0e97424a346ec
Author: Michael Adam <obnox at samba.org>
Date:   Fri Mar 4 23:53:44 2011 +0100

    s3:registry: fix invalid write in iconvert_talloc()
    
    For a non-preallocated dest-string and sourcestring of len < 2,
    (one or both of the) final two two zero-bytes would be written
    after the end of the allocated dest-string. The sourcelen did
    not include the source string terminator. For longer strings,
    this was not a problem because the dest-string would have been
    reallocated in the convert-loop. This is fixed now by allocating
    two extra bytes for the terminating 0-bytes that are needed anyways
    in the initial allocation.
    
    Pair-Programmed-With: Gregor Beck <gbeck at sernet.de>

commit 46cae09a39be98bee77345afd0adbf62621421f5
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Mar 7 04:46:20 2011 -0800

    Fix the examples/VFS build.
    (cherry picked from commit 79c6f0d440b30d2c36a50a8ea5735a5a1818b551)

commit 3d1069f1ae6e1665dddb75f90b4a1f941fb663d2
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Mar 7 03:53:11 2011 -0800

    Fix examples/VFS to use correct prototypes for is_offline() and set_offline().
    (cherry picked from commit 0faffd4556438f7add6312e58acca345abfbe7fb)

commit 9478dd98f27913b87236e54e0f606c0eda559a6e
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Mar 4 21:14:27 2011 +0100

    lib/socket_wrapper: try to fix the build on solaris
    
    struct msg does not contain msg_control, msg_controllen and msg_flags
    on solaris.
    
    metze
    (cherry picked from commit 2c7c3d03d5c6b99370f9007aa6fe874d36512be2)

commit 754f980e87f8e8902826dea8735ba0addd13ad0c
Author: David Disseldorp <ddiss at suse.de>
Date:   Fri Mar 4 14:53:39 2011 +0100

    s3: add two missing vfs disconnect calls
    
    The fix for bug 7976 added a vfs connect call to create_conn_struct.
    This change adds two further disconnect calls that were missed by the
    original change.

commit aadf1e6a8cd90903b23fc1d76d0d51cc400380b3
Author: David Disseldorp <ddiss at suse.de>
Date:   Thu Dec 30 15:58:48 2010 +0100

    s3-printing: fix cups pcap reload with no printers
    
    cups_async_callback() is called to receive new printcap data from a
    child process which requests the information from cupsd.
    Newly received printcap information is stored in a temporary printcap
    cache (tmp_pcap_cache). Once the child process closes the printcap IPC
    file descriptor, the system printcap cache is replaced with the newly
    populated tmp_pcap_cache, however this only occurs if tmp_pcap_cache is
    non null (has at least one printer).
    
    If the printcap cache is empty, which is the case when cups is not
    exporting any printers, the printcap cache is not replaced resulting in
    stale data.
    
    https://bugzilla.samba.org/show_bug.cgi?id=7915

commit b0fe017917bf891d401a9f2a61a4f47805f89281
Author: David Disseldorp <ddiss at suse.de>
Date:   Thu Dec 30 14:32:29 2010 +0100

    s3-printing: remove unneeded local_pcap_copy global
    
    The cups local_pcap_copy global served as a temporary buffer during
    asynchronous cups printcap cache updates, as well as indicating when
    the printcap cache had not yet been filled and printcap cache update
    should block.
    
    As smbd printcap reads are now triggered by the parent smbd following
    printcap cache update, the variable and blocking mechanism are no longer
    needed.

commit 2a791861462977a82b33ad57a4d5203dc9270aff
Author: David Disseldorp <ddiss at suse.de>
Date:   Wed Mar 2 14:34:28 2011 +0100

    s3-printing: follow force user/group for driver IO
    
    Configuring force user/group settings for the print$ share currently has
    unexpected results, this is explained by how the driver upload/add
    process takes place. Consider the following example:
    
    [print$]
            path = /print-drv
            write list = $DRIVER_UPLOAD_USER
            force group = ntadmin
    
    - the client connects to the [print$] share and uploads all driver
      files to the /print-drv/W32X86 directory.
    
    - This is permitted, as /print-drv/W32X86 is owned by group ntadmin, and
      the "force group = ntadmin" takes effect for the [print$] session.
    
    - Once all files are uploaded, the client connects to the [ipc$]
      share and issues an AddPrinterDriverEx spoolss request.
    
    - In handling this request move_driver_to_download_area() is called,
      which attempts to create the directory /print-drv/W32X86/3
    
    - The create directory fails, as it is done as the user connected to
      the [ipc$] share which does not have permission to write to the driver
      directory. The [print$] "force group = ntadmin" has no effect.
    
    This is a regression from previous behaviour prior to the commit:
    783ab04 Convert move_driver_to_download_area to use create_conn_struct.
    
    https://bugzilla.samba.org/show_bug.cgi?id=7921

commit b0ad40783e4d04c8cde07baaa84bed4ccf83e9c4
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Mar 6 09:31:40 2011 +0100

    s3: Move EXOP definitions to smbldap.h
    
    This attempts to fix the build on Solaris
    
    Autobuild-User: Volker Lendecke <vlendec at samba.org>
    Autobuild-Date: Sun Mar  6 10:45:16 CET 2011 on sn-devel-104
    (cherry picked from commit f6f8ec8d8bccee5eec05c7f546e306bced897bbb)

commit ad0afa03a813a26a8e62f15ca7569343804ec8f3
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Mar 5 17:37:53 2011 +0100

    s3: Fix uninitialized variables
    
    Autobuild-User: Volker Lendecke <vlendec at samba.org>
    Autobuild-Date: Sat Mar  5 17:25:43 CET 2011 on sn-devel-104
    (cherry picked from commit a40bb91213a321ea08897d7152d9d64defa1a8b1)

commit bcfbaf937f4e27010cdd5c7cbd378fd1f298664d
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Mar 5 12:57:59 2011 +0100

    s3: Fix a memory leak in check_sam_security_info3
    
    Abartlet, this commit makes check_sam_security_info3 use talloc_tos() and also
    cleans up the temporary talloc stackframe.
    
    The old code created a temporary talloc context off "mem_ctx" but failed to
    clean up the tmp_ctx in all but one return paths.
    
    talloc_stackframe()/talloc_tos() is designed as a defense against exactly this
    error: Even if we failed to free the frame when returning from the routine, it
    would be cleaned up very soon, in our main event loop.
    
    Please check this patch!
    
    Thanks,
    
    Volker
    
    Autobuild-User: Volker Lendecke <vlendec at samba.org>
    Autobuild-Date: Sat Mar  5 14:08:37 CET 2011 on sn-devel-104
    (cherry picked from commit dcbfb6fc0b9050168e2010673caccb7ec8807bd1)

commit 15257836ab70122823aabdb2073e96282d200eab
Author: Stefan Metzmacher <metze at samba.org>
Date:   Sat Oct 30 16:23:49 2010 +0200

    socket_wrapper: use swrap_sendmsg_before()/after() in swrap_writev()
    
    metze
    
    Autobuild-User: Stefan Metzmacher <metze at samba.org>
    Autobuild-Date: Thu Mar  3 23:43:39 CET 2011 on sn-devel-104
    (cherry picked from commit a5d54579ea949f4cd7c975c3f5d0006a90777735)

commit c9a0e4bfcb1e3bf226004ce27b99da712c74b233
Author: Stefan Metzmacher <metze at samba.org>
Date:   Sat Oct 30 16:23:49 2010 +0200

    socket_wrapper: use swrap_sendmsg_before()/after() in swrap_sendmsg()
    
    This also adds the same logic for broadcast as in swrap_sendto()
    for SOCK_DGRAM.
    
    metze
    (cherry picked from commit e831376f914d729b9ff3f39c5841846359c712aa)

commit 0a65c2324f89b56792403de9b7df042262eccca5
Author: Stefan Metzmacher <metze at samba.org>
Date:   Sat Oct 30 16:23:49 2010 +0200

    socket_wrapper: use swrap_sendmsg_before()/after() in swrap_send()
    
    metze
    (cherry picked from commit 4a736f0fbe58fabf6c0a0650cbc38882cb0446ab)

commit 684b594b5106353c508cda885e9d00c3c266e6d7
Author: Stefan Metzmacher <metze at samba.org>
Date:   Sat Oct 30 16:23:49 2010 +0200

    socket_wrapper: use swrap_sendmsg_before()/after() in swrap_sendto()
    
    metze
    (cherry picked from commit a2db6b4dba2650c582aa4572276d96dac521a3d8)

commit 00e93ca79b934e4907667494e3ae7471a3b50325
Author: Stefan Metzmacher <metze at samba.org>
Date:   Sat Oct 30 16:08:49 2010 +0200

    socket_wrapper: add swrap_sendmsg_before/after helper functions
    
    Currently have almost the same logic in swrap_send(), swrap_sendto(),
    swrap_writev() and swrap_sendmsg(), this helper functions
    let combine all the logic in 2 places.
    
    metze
    (cherry picked from commit 8c6d7d7b2797c051885e12e3cdf3da158cf4fe25)

commit 4ae3d540f46a87947d48e62838b7b6849e5c5c5b
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Mar 3 15:37:17 2011 +0100

    socket_wrapper: replace recvmsg() correctly
    
    metze
    (cherry picked from commit c9ae8102099ed66c776c79e88f1a582f3e213fbc)

commit 472227167df70ac2f77b24114b50d69527ef6fe7
Author: Stefan Metzmacher <metze at samba.org>
Date:   Sat Oct 30 16:28:23 2010 +0200

    socket_wrapper: readv() should only work on connected sockets
    
    metze
    (cherry picked from commit ec028b555bbca84e1f949c6632099f8407c0d695)

commit 50108fb6740fd5f44b29c8dc745fffac37578cac
Author: Stefan Metzmacher <metze at samba.org>
Date:   Sat Oct 30 16:19:33 2010 +0200

    socket_wrapper: move swrap_ioctl() above the send*/recv* functions
    
    metze
    (cherry picked from commit 7bdc3db9ea5380eeee8d975b3579dcf673a0eafa)

commit b0eb58cc78068c7edc2a09c7fa5c94d04802c124
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Mar 2 20:46:45 2011 +0100

    socket_wrapper: fix compiler warnings
    
    metze
    (cherry picked from commit 0ad8d459c6f47a0d70c8af2b19e6585a38f34cb4)

commit 2e0534a7ed886a3e29140d961e2a393856e2c3c6
Author: Stefan Metzmacher <metze at samba.org>
Date:   Sat Oct 30 16:07:31 2010 +0200

    socket_wrapper: don't allow connect() to the broadcast address
    
    This will simplify other code later.
    
    metze
    (cherry picked from commit e3c0d6611087184b37399df2bf04053c60c9f043)

commit b1a14a2acd594a63740fbafdce7ec6e5de452edc
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Feb 12 12:18:16 2011 +0100

    Fix some nonempty blank lines
    (cherry picked from commit 78525270733a79a6e2def662d7340382cb648414)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 2a5e9efc76fbc9e608273007d5447de49b8aec7e
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Mar 3 17:02:40 2011 +0100

    s3: Use dom_sid_string_buf in sid_to_fstring
    
    Autobuild-User: Volker Lendecke <vlendec at samba.org>
    Autobuild-Date: Thu Mar  3 22:56:57 CET 2011 on sn-devel-104

commit d64035043053707dde17d97ef082ebe9e653daea
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Mar 3 16:59:39 2011 +0100

    Add dom_sid_string_buf
    
    This prints into a fixed buffer with the same overflow semantics as snprintf
    has: Return required string length, regardless of whether it fit or not.

commit 28fdc60a7f87e0bb6c93c4bfa8a7417abe6745f6
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Mar 3 16:20:56 2011 +0100

    s3: Use dom_sid_string in _lsa_lookup_sids_internal

commit 8bd0bc2fa2db1e2062ec7acbb9ba30bc8c61fe88
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Mar 3 15:26:12 2011 +0100

    s3: Remove an obsolete comment

commit 14d95151c9aff506dd93da7fcbc8e4e7587a19c8
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Mar 3 12:51:57 2011 +0100

    s3: Fix some nonempty blank lines

commit 880fb9c4d60cca6e04c3f6252e4020bc9a2f8c5b
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Feb 25 06:55:28 2011 -0700

    s3: Pass the aio_force operation through vfs_gpfs
    
    Autobuild-User: Volker Lendecke <vlendec at samba.org>
    Autobuild-Date: Wed Mar  2 19:24:27 CET 2011 on sn-devel-104

commit 1dc3d730fc9d9ba1b7cc5268fefcd8640252f1e8
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Feb 25 06:50:19 2011 -0700

    s3: Ask GPFS for the IS_OFFLINE operation

commit 73807b0ff5696726767800c23b22b57c43b8063c
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Feb 25 07:18:46 2011 -0700

    s3: Announce HSM in the gpfs module

commit c7b72289feba915b24199298d64687e950d4c0e6
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Feb 25 06:43:52 2011 -0700

    s3: Pass smb_filename through the set_offline vfs op

commit c2b8134a970d173359bfdca55fbb1ff58f9800a1
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Feb 25 06:37:34 2011 -0700

    s3: Pass smb_filename through the is_offline vfs op

commit 66d4fcb37013a40b8193978bc204e93ee2a51985
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Feb 25 06:28:30 2011 -0700

    s3: Fix operation names in vfs_full_audit.c

commit 79cef6647e09a4a25ce9fa8d9fb96289d58fc00a
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Mar 2 09:55:31 2011 -0700

    s3: Print all flags in "smbclient allinfo"

commit 19abfbacd8bea266715c13cce6e2a109ca4eef1e
Author: Michael Adam <obnox at samba.org>
Date:   Wed Mar 2 13:58:37 2011 +0100

    s3:idmap_cache: remove an leftover wip comment
    
    Autobuild-User: Michael Adam <obnox at samba.org>
    Autobuild-Date: Wed Mar  2 14:55:20 CET 2011 on sn-devel-104
    (cherry picked from commit d9945e93694859c9606e17078fabc2e23b5421fe)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit c6ddf70a238f2341768afdcd28d7db4218c6dd94
Author: Gregor Beck <gbeck at sernet.de>
Date:   Tue Mar 1 17:18:31 2011 +0100

    s3: adjust loglevel for idmap_cache
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    (cherry picked from commit 8aa69c1f814b215c1b2e48393373878ba87dad0d)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 1046a5ee40695fab90a724ba99cfde5656d10b52
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Mar 1 16:44:22 2011 +0100

    librpc/idl: remove unused string defines from idl_types.h
    
    metze
    
    Autobuild-User: Stefan Metzmacher <metze at samba.org>
    Autobuild-Date: Wed Mar  2 14:09:44 CET 2011 on sn-devel-104
    (cherry picked from commit 7101f5a8f21875519942d0263efa3221fc23bb22)

commit a891f9fda4f58cddf43ddcf8065adbfc128242dd
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Mar 1 17:41:27 2011 +0100

    librpc/rpc: let ndr_pull_spoolss_EnumPrinterDataEx() use a subcontext
    
    This is not strictly needed, but it's good to have the logic
    in common with the other Enum* calls.
    
    This also allows us to play with the NDR_RELATIVE_REVERSE flag.
    
    metze
    (cherry picked from commit 56df34a6aa336c1f7e6b40a4cc585ae12d9052a6)

commit e3ac2af0da93075a65a6ef703183615e663a6e7a
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Mar 2 10:44:14 2011 +0100

    s3: Attempt to fix the build on IRIX
    
    Autobuild-User: Volker Lendecke <vlendec at samba.org>
    Autobuild-Date: Wed Mar  2 11:33:05 CET 2011 on sn-devel-104
    (cherry picked from commit 8635a3834a50b911aab549ddb5a41952a84dccc3)

commit 08f0055279b77602ed2c8a3ad3e852d475fbacc2
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Feb 24 02:50:46 2011 -0700

    s3: GPFS can't deal with mangled names
    
    In getrealfilename, avoid calling the GPFS function
    (cherry picked from commit 358f031ccf7e5df11416b977965dfbb184e2bd25)

commit 529291bb20db44b9a253ee0183fc40abf6b2fc6c
Author: David Disseldorp <ddiss at suse.de>
Date:   Tue Mar 1 19:17:49 2011 +0100

    s3-printing: vfs_connect prior to driver/dfs IO
    
    samba3.posix_s3.rpc.spoolss.driver fails with the xattr_tdb vfs module
    loaded as a part of make test. The (now checked) create_directory() call
    in move_driver_to_download_area() fails, uncovering another bug in the
    printer driver upload code path.
    
    move_driver_to_download_area() creates a new conn_struct for
    manipulating files in [print$]. The VFS layer is plumbed through with
    the call to create_conn_struct(), however SMB_VFS_CONNECT() is never
    called. Many vfs modules expect state stored at connect time with
    SMB_VFS_HANDLE_SET_DATA() to be available on any IO operation and fail
    if this is not the case.
    
    This fix adds a call to SMB_VFS_CONNECT() in create_conn_struct() prior
    to IO.
    
    https://bugzilla.samba.org/show_bug.cgi?id=7976

commit faf4b99182c62f43896f74b09947badc215e7d02
Author: David Disseldorp <ddiss at suse.de>
Date:   Tue Mar 1 19:17:48 2011 +0100

    s3-printing: clean up get_correct_cversion error paths
    
    Remove an unneeded variable and simplify error paths.

commit 47b978d4119e797af3c0098e01add503d598eca0
Author: David Disseldorp <ddiss at suse.de>
Date:   Tue Mar 1 19:17:47 2011 +0100

    s3-printing: fix move_driver_to_download_area() error paths
    
    WERR_ACCESS_DENIED errors are mapped to WERR_UNKNOWN_PRINTER_DRIVER,
    resulting in incorrect error messages on Windows clients.
    
    move_driver_to_download_area() returns the same error status values
    to the caller via the *perr argument as well as the return value.
    
    The create_directory() call is not checked for error.

commit 1ea17bacdb09d28a12a8b6ddeba3ac285cd9f905
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Mar 1 14:20:32 2011 +0100

    librpc/ndr: handle NOALIGN flag for relative pointers and alignment DATA_BLOBs
    
    metze
    
    Autobuild-User: Stefan Metzmacher <metze at samba.org>
    Autobuild-Date: Tue Mar  1 17:11:03 CET 2011 on sn-devel-104
    (cherry picked from commit ef224aa004d5f1726d8dca020e0ef96d8c58565e)

commit ba1a72cb153892e491af91a6bb61e1820135fa12
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Feb 22 15:56:30 2011 +0100

    spoolss.idl: align spoolss_DriverFileInfo relative pointer to 4 byte
    
    metze
    (cherry picked from commit b6ece01c7922adeb3c9e718bc8cc610cae7c543c)

commit 757471a5fcd4f95da28402bae6c9ceccff7d6548
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Feb 22 19:23:33 2011 +0100

    spoolss.idl: align spoolss_PrinterEnumValues 'data' based on the type
    
    metze
    (cherry picked from commit 341330600aebcec92fba64ea343888c15a0c3d44)

commit 9313b5d1da24406dd7d26afb2488fee0cbea44a9
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Feb 22 15:58:45 2011 +0100

    TODO test/review librpc/ndr: remove align2 hack for relative pointers
    
    metze
    (cherry picked from commit 23f6f449792d889538e0d0028bb8fbd5c807b0da)

commit 0fb64a26b3b35b75f2f548d882bed41aa0386c6b
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Feb 22 15:57:21 2011 +0100

    TODO test/review librpc: align nstring and nstring_array to 2 byte
    
    metze
    (cherry picked from commit 712ef2590d0ee59a4a659926cdf8aac6e968dfa8)

commit 6648ce8990a97da739d4be69657e9ace6198068c
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Feb 22 15:45:44 2011 +0100

    librpc/ndr: ndr align relative pointers based on the given flags
    
    We used to do this only for the reverse relative pointers
    and now we always do it.
    
    metze
    (cherry picked from commit 84b884eb4bec38b721d6c38704f12d1d2c601bcb)

commit 5f8b7f95e9ce5946f048b242dbbaa14897aea919
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Feb 22 18:19:13 2011 +0100

    TODO test/review librpc/ndr: let ndr_push/pull_DATA_BLOB() look at LIBNDR_FLAG_REMAINING before LIBNDR_ALIGN_FLAGS
    
    metze
    (cherry picked from commit 6c3a49ced333988b21d86e47b2b1dd1a5957e15c)

commit ebd82cc7bb45ee9f0407f6c5415c836bd62b4098
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Feb 22 11:00:07 2011 +0100

    Revert "Fix alignment issues in SPOOLSS "BUFFER" marshalling."
    
    This reverts commit 187f695469071d0550613e037b36170facb85460.
    
    This is the wrong fix.
    
    metze
    (cherry picked from commit bd2b0076b4ea0be6e2f6730566736be7e338aafc)

commit 83efd14646cb4376eae8a14db8c1cee75785e159
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Feb 28 14:56:03 2011 -0800

    Fix compiler warning on casting -1 to uint32.
    (cherry picked from commit 87c4ceaf7c9ac98a35b5ed3de31191887d609d79)

commit 5232f3d263ab7e66003cc971c667528635008dc1
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Feb 28 12:25:40 2011 -0800

    Fix "cast from pointer to integer of different size" warnings on a 64-bit machine.
    (cherry picked from commit 30deb3fce96a3c1a5659e3f0011d90de32dc43b3)

commit 04ce66bdb196ab01709aa80e93c0dd570ec0f5e2
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Feb 28 11:23:53 2011 -0800

    Finish the range checking on all FD_SET calls for select().
    (cherry picked from commit 874b2b726af07d95694e4bcc8ad201a2c145a588)

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

Summary of changes:
 docs-xml/manpages-3/net.8.xml               |   17 +
 docs-xml/manpages-3/smbcontrol.1.xml        |   26 +
 examples/VFS/skel_opaque.c                  |   10 +-
 examples/VFS/skel_transparent.c             |   16 +-
 lib/socket_wrapper/socket_wrapper.c         |  688 ++++++++++++++++-----------
 lib/socket_wrapper/socket_wrapper.h         |    6 +
 lib/tevent/tevent_poll.c                    |   14 +-
 lib/tevent/tevent_select.c                  |   10 +
 lib/tevent/tevent_standard.c                |    4 +
 libcli/security/dom_sid.c                   |   49 ++-
 libcli/security/dom_sid.h                   |    3 +
 librpc/idl/idl_types.h                      |   27 +-
 librpc/idl/spoolss.idl                      |    4 +-
 librpc/ndr/ndr.c                            |   34 ++-
 librpc/ndr/ndr_basic.c                      |   20 +-
 librpc/ndr/ndr_spoolss_buf.c                |   37 ++-
 librpc/ndr/ndr_spoolss_buf.h                |    1 +
 nsswitch/wins.c                             |   65 +---
 pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm    |    7 -
 source3/VERSION                             |    2 +-
 source3/auth/check_samsec.c                 |   22 +-
 source3/client/client.c                     |   26 +-
 source3/include/idmap.h                     |    6 +-
 source3/include/nt_printing.h               |    3 +-
 source3/include/proto.h                     |    1 +
 source3/include/smbldap.h                   |   25 +
 source3/lib/idmap_cache.c                   |   22 +-
 source3/lib/util_sid.c                      |    4 +-
 source3/modules/vfs_default.c               |    2 +-
 source3/modules/vfs_gpfs.c                  |   13 +-
 source3/passdb/lookup_sid.c                 |    4 +-
 source3/passdb/pdb_ldap.c                   |   25 -
 source3/printing/nt_printing.c              |  203 +++++----
 source3/printing/print_cups.c               |   89 ++--
 source3/printing/printing.c                 |    6 +-
 source3/registry/reg_parse_internal.c       |    7 +-
 source3/rpc_server/lsa/srv_lsa_nt.c         |    5 +-
 source3/rpc_server/spoolss/srv_spoolss_nt.c |    4 +-
 source3/rpc_server/srvsvc/srv_srvsvc_nt.c   |    4 +
 source3/smbd/msdfs.c                        |   34 +-
 source3/smbd/service.c                      |  127 +++---
 source3/winbindd/winbindd_cm.c              |    3 +-
 42 files changed, 997 insertions(+), 678 deletions(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages-3/net.8.xml b/docs-xml/manpages-3/net.8.xml
index d648d5c..8e5ece0 100644
--- a/docs-xml/manpages-3/net.8.xml
+++ b/docs-xml/manpages-3/net.8.xml
@@ -1278,6 +1278,23 @@ as the password for the user DN used to bind to the ldap server.
 </refsect2>
 
 <refsect2>
+
+<title>IDMAP DELETE [-f] [--db=&lt;DB&gt;] &lt;ID&gt;</title>
+
+<para>
+Delete a mapping sid &lt;-&gt; gid or sid &lt;-&gt; uid from the IDMAP database.
+The mapping is given by &lt;ID&gt; which may either be a sid: S-x-..., a gid: "GID number" or a uid: "UID number".
+Use -f to delete an invalid partial mapping &lt;ID&gt; -&gt; xx
+</para>
+<para>
+  Use "smbcontrol all idmap ..." to notify running smbd instances.
+  See the <citerefentry><refentrytitle>smbcontrol</refentrytitle>
+  <manvolnum>1</manvolnum></citerefentry> manpage for details.
+</para>
+</refsect2>
+
+
+<refsect2>
 <title>USERSHARE</title>
 
 <para>Starting with version 3.0.23, a Samba server now supports the ability for
diff --git a/docs-xml/manpages-3/smbcontrol.1.xml b/docs-xml/manpages-3/smbcontrol.1.xml
index d3707c1..31c3537 100644
--- a/docs-xml/manpages-3/smbcontrol.1.xml
+++ b/docs-xml/manpages-3/smbcontrol.1.xml
@@ -272,6 +272,32 @@
 	</para></listitem>
 	</varlistentry>
 
+	<varlistentry>
+	<term>idmap</term>
+	<listitem><para>Notify about changes of id mapping. Can be sent
+	to <constant>smbd</constant> or (not implemented yet) <constant>winbindd</constant>.
+	</para></listitem>
+
+	<variablelist>
+	  <varlistentry>
+	    <term>flush [uid|gid]</term>
+	    <listitem><para>Flush caches for sid &lt;-&gt; gid and/or sid &lt;-&gt; uid mapping.
+	    </para></listitem>
+	  </varlistentry>
+	  <varlistentry>
+	    <term>delete &lt;ID&gt;</term>
+	    <listitem><para>Remove a mapping from cache. The mapping is given by &lt;ID&gt;
+	    which may either be a sid: S-x-..., a gid: "GID number" or a uid: "UID number".
+	    </para></listitem>
+	  </varlistentry>
+	  <varlistentry>
+	    <term>kill &lt;ID&gt;</term>
+	    <listitem><para>Remove a mapping from cache. Terminate <constant>smbd</constant> if
+	    the id is currently in use.</para></listitem>
+	  </varlistentry>
+	</variablelist>
+	</varlistentry>
+
 </variablelist>
 </refsect1>
 
diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index da126e3..ef7c3af 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -477,19 +477,19 @@ static NTSTATUS skel_translate_name(struct vfs_handle_struct *handle,
 }
 
 static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
-	uint32 security_info, SEC_DESC **ppdesc)
+	uint32 security_info, struct security_descriptor **ppdesc)
 {
 	return NT_STATUS_NOT_IMPLEMENTED;
 }
 
 static NTSTATUS skel_get_nt_acl(vfs_handle_struct *handle,
-	const char *name, uint32 security_info, SEC_DESC **ppdesc)
+	const char *name, uint32 security_info, struct security_descriptor **ppdesc)
 {
 	return NT_STATUS_NOT_IMPLEMENTED;
 }
 
 static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
-	uint32 security_info_sent, const SEC_DESC *psd)
+	uint32 security_info_sent, const struct security_descriptor *psd)
 {
 	return NT_STATUS_NOT_IMPLEMENTED;
 }
@@ -760,13 +760,13 @@ static bool skel_aio_force(struct vfs_handle_struct *handle, struct files_struct
 	return false;
 }
 
-static bool skel_is_offline(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf)
+static bool skel_is_offline(struct vfs_handle_struct *handle, const struct smb_filename *fname, SMB_STRUCT_STAT *sbuf)
 {
 	errno = ENOSYS;
 	return false;
 }
 
-static int skel_set_offline(struct vfs_handle_struct *handle, const char *path)
+static int skel_set_offline(struct vfs_handle_struct *handle, const struct smb_filename *fname)
 {
 	errno = ENOSYS;
 	return -1;
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index 0ffdc11..403e28d 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -298,7 +298,7 @@ static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_
 }
 
 static int skel_fallocate(vfs_handle_struct *handle, files_struct *fsp,
-			enum vfs_fallocate_mode,
+			enum vfs_fallocate_mode mode,
 			SMB_OFF_T offset,
 			SMB_OFF_T len)
 {
@@ -468,19 +468,19 @@ static NTSTATUS skel_translate_name(struct vfs_handle_struct *handle,
 }
 
 static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
-	uint32 security_info, SEC_DESC **ppdesc)
+	uint32 security_info, struct security_descriptor **ppdesc)
 {
 	return SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, ppdesc);
 }
 
 static NTSTATUS skel_get_nt_acl(vfs_handle_struct *handle,
-	const char *name, uint32 security_info, SEC_DESC **ppdesc)
+	const char *name, uint32 security_info, struct security_descriptor **ppdesc)
 {
 	return SMB_VFS_NEXT_GET_NT_ACL(handle, name, security_info, ppdesc);
 }
 
 static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
-	uint32 security_info_sent, const SEC_DESC *psd)
+	uint32 security_info_sent, const struct security_descriptor *psd)
 {
 	return SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd);
 }
@@ -706,14 +706,14 @@ static bool skel_aio_force(struct vfs_handle_struct *handle, struct files_struct
         return SMB_VFS_NEXT_AIO_FORCE(handle, fsp);
 }
 
-static bool skel_is_offline(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf)
+static bool skel_is_offline(struct vfs_handle_struct *handle, const struct smb_filename *fname, SMB_STRUCT_STAT *sbuf)
 {
-	return SMB_VFS_NEXT_IS_OFFLINE(handle, path, sbuf);
+	return SMB_VFS_NEXT_IS_OFFLINE(handle, fname, sbuf);
 }
 
-static int skel_set_offline(struct vfs_handle_struct *handle, const char *path)
+static int skel_set_offline(struct vfs_handle_struct *handle, const struct smb_filename *fname)
 {
-	return SMB_VFS_NEXT_SET_OFFLINE(handle, path);
+	return SMB_VFS_NEXT_SET_OFFLINE(handle, fname);
 }
 
 /* VFS operations structure */
diff --git a/lib/socket_wrapper/socket_wrapper.c b/lib/socket_wrapper/socket_wrapper.c
index 594b807..cd91327 100644
--- a/lib/socket_wrapper/socket_wrapper.c
+++ b/lib/socket_wrapper/socket_wrapper.c
@@ -296,8 +296,8 @@ static int convert_un_in(const struct sockaddr_un *un, struct sockaddr *in, sock
 	switch(type) {
 	case SOCKET_TYPE_CHAR_TCP:
 	case SOCKET_TYPE_CHAR_UDP: {
-		struct sockaddr_in *in2 = (struct sockaddr_in *)in;
-		
+		struct sockaddr_in *in2 = (struct sockaddr_in *)(void *)in;
+
 		if ((*len) < sizeof(*in2)) {
 		    errno = EINVAL;
 		    return -1;
@@ -314,8 +314,8 @@ static int convert_un_in(const struct sockaddr_un *un, struct sockaddr *in, sock
 #ifdef HAVE_IPV6
 	case SOCKET_TYPE_CHAR_TCP_V6:
 	case SOCKET_TYPE_CHAR_UDP_V6: {
-		struct sockaddr_in6 *in2 = (struct sockaddr_in6 *)in;
-		
+		struct sockaddr_in6 *in2 = (struct sockaddr_in6 *)(void *)in;
+
 		if ((*len) < sizeof(*in2)) {
 			errno = EINVAL;
 			return -1;
@@ -352,7 +352,7 @@ static int convert_in_un_remote(struct socket_info *si, const struct sockaddr *i
 	switch (inaddr->sa_family) {
 	case AF_INET: {
 		const struct sockaddr_in *in = 
-		    (const struct sockaddr_in *)inaddr;
+		    (const struct sockaddr_in *)(const void *)inaddr;
 		unsigned int addr = ntohl(in->sin_addr.s_addr);
 		char u_type = '\0';
 		char b_type = '\0';
@@ -395,8 +395,8 @@ static int convert_in_un_remote(struct socket_info *si, const struct sockaddr *i
 #ifdef HAVE_IPV6
 	case AF_INET6: {
 		const struct sockaddr_in6 *in = 
-		    (const struct sockaddr_in6 *)inaddr;
-		struct in6_addr cmp;
+		    (const struct sockaddr_in6 *)(const void *)inaddr;
+		struct in6_addr cmp1, cmp2;
 
 		switch (si->type) {
 		case SOCK_STREAM:
@@ -411,9 +411,10 @@ static int convert_in_un_remote(struct socket_info *si, const struct sockaddr *i
 
 		prt = ntohs(in->sin6_port);
 
-		cmp = in->sin6_addr;
-		cmp.s6_addr[15] = 0;
-		if (IN6_ARE_ADDR_EQUAL(swrap_ipv6(), &cmp)) {
+		cmp1 = *swrap_ipv6();
+		cmp2 = in->sin6_addr;
+		cmp2.s6_addr[15] = 0;
+		if (IN6_ARE_ADDR_EQUAL(&cmp1, &cmp2)) {
 			iface = in->sin6_addr.s6_addr[15];
 		} else {
 			errno = ENETUNREACH;
@@ -460,7 +461,7 @@ static int convert_in_un_alloc(struct socket_info *si, const struct sockaddr *in
 	switch (si->family) {
 	case AF_INET: {
 		const struct sockaddr_in *in = 
-		    (const struct sockaddr_in *)inaddr;
+		    (const struct sockaddr_in *)(const void *)inaddr;
 		unsigned int addr = ntohl(in->sin_addr.s_addr);
 		char u_type = '\0';
 		char d_type = '\0';
@@ -511,8 +512,8 @@ static int convert_in_un_alloc(struct socket_info *si, const struct sockaddr *in
 #ifdef HAVE_IPV6
 	case AF_INET6: {
 		const struct sockaddr_in6 *in = 
-		    (const struct sockaddr_in6 *)inaddr;
-		struct in6_addr cmp;
+		    (const struct sockaddr_in6 *)(const void *)inaddr;
+		struct in6_addr cmp1, cmp2;
 
 		switch (si->type) {
 		case SOCK_STREAM:
@@ -527,11 +528,12 @@ static int convert_in_un_alloc(struct socket_info *si, const struct sockaddr *in
 
 		prt = ntohs(in->sin6_port);
 
-		cmp = in->sin6_addr;
-		cmp.s6_addr[15] = 0;
+		cmp1 = *swrap_ipv6();
+		cmp2 = in->sin6_addr;
+		cmp2.s6_addr[15] = 0;
 		if (IN6_IS_ADDR_UNSPECIFIED(&in->sin6_addr)) {
 			iface = socket_wrapper_default_iface();
-		} else if (IN6_ARE_ADDR_EQUAL(swrap_ipv6(), &cmp)) {
+		} else if (IN6_ARE_ADDR_EQUAL(&cmp1, &cmp2)) {
 			iface = in->sin6_addr.s6_addr[15];
 		} else {
 			errno = EADDRNOTAVAIL;
@@ -614,7 +616,7 @@ static int sockaddr_convert_to_un(struct socket_info *si, const struct sockaddr
 	default:
 		break;
 	}
-	
+
 	errno = EAFNOSUPPORT;
 	return -1;
 }
@@ -1504,7 +1506,7 @@ _PUBLIC_ int swrap_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
 	memset(&un_addr, 0, sizeof(un_addr));
 	memset(&un_my_addr, 0, sizeof(un_my_addr));
 
-	ret = real_accept(s, (struct sockaddr *)&un_addr, &un_addrlen);
+	ret = real_accept(s, (struct sockaddr *)(void *)&un_addr, &un_addrlen);
 	if (ret == -1) {
 		free(my_addr);
 		return ret;
@@ -1542,7 +1544,8 @@ _PUBLIC_ int swrap_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
 	    *addrlen = 0;
 	}
 
-	ret = real_getsockname(fd, (struct sockaddr *)&un_my_addr, &un_my_addrlen);
+	ret = real_getsockname(fd, (struct sockaddr *)(void *)&un_my_addr,
+			       &un_my_addrlen);
 	if (ret == -1) {
 		free(child_si);
 		close(fd);
@@ -1669,8 +1672,9 @@ static int swrap_auto_bind(struct socket_info *si, int family)
 			 "%s/"SOCKET_FORMAT, socket_wrapper_dir(),
 			 type, socket_wrapper_default_iface(), port);
 		if (stat(un_addr.sun_path, &st) == 0) continue;
-		
-		ret = real_bind(si->fd, (struct sockaddr *)&un_addr, sizeof(un_addr));
+
+		ret = real_bind(si->fd, (struct sockaddr *)(void *)&un_addr,
+				sizeof(un_addr));
 		if (ret == -1) return ret;
 
 		si->tmp_path = strdup(un_addr.sun_path);
@@ -1695,6 +1699,7 @@ _PUBLIC_ int swrap_connect(int s, const struct sockaddr *serv_addr, socklen_t ad
 	int ret;
 	struct sockaddr_un un_addr;
 	struct socket_info *si = find_socket_info(s);
+	int bcast = 0;
 
 	if (!si) {
 		return real_connect(s, serv_addr, addrlen);
@@ -1710,16 +1715,22 @@ _PUBLIC_ int swrap_connect(int s, const struct sockaddr *serv_addr, socklen_t ad
 		return -1;
 	}
 
-	ret = sockaddr_convert_to_un(si, (const struct sockaddr *)serv_addr, addrlen, &un_addr, 0, NULL);
+	ret = sockaddr_convert_to_un(si, serv_addr,
+				     addrlen, &un_addr, 0, &bcast);
 	if (ret == -1) return -1;
 
+	if (bcast) {
+		errno = ENETUNREACH;
+		return -1;
+	}
+
 	if (si->type == SOCK_DGRAM) {
 		si->defer_connect = 1;
 		ret = 0;
 	} else {
 		swrap_dump_packet(si, serv_addr, SWRAP_CONNECT_SEND, NULL, 0);
 
-		ret = real_connect(s, (struct sockaddr *)&un_addr,
+		ret = real_connect(s, (struct sockaddr *)(void *)&un_addr,
 				   sizeof(struct sockaddr_un));
 	}
 
@@ -1755,12 +1766,12 @@ _PUBLIC_ int swrap_bind(int s, const struct sockaddr *myaddr, socklen_t addrlen)
 	si->myname_len = addrlen;
 	si->myname = sockaddr_dup(myaddr, addrlen);
 
-	ret = sockaddr_convert_to_un(si, (const struct sockaddr *)myaddr, addrlen, &un_addr, 1, &si->bcast);
+	ret = sockaddr_convert_to_un(si, myaddr, addrlen, &un_addr, 1, &si->bcast);
 	if (ret == -1) return -1;
 
 	unlink(un_addr.sun_path);
 
-	ret = real_bind(s, (struct sockaddr *)&un_addr,
+	ret = real_bind(s, (struct sockaddr *)(void *)&un_addr,
 			sizeof(struct sockaddr_un));
 
 	if (ret == 0) {
@@ -1859,6 +1870,223 @@ _PUBLIC_ int swrap_setsockopt(int s, int  level,  int  optname,  const  void  *o
 	}
 }
 
+_PUBLIC_ int swrap_ioctl(int s, int r, void *p)
+{
+	int ret;
+	struct socket_info *si = find_socket_info(s);
+	int value;
+
+	if (!si) {
+		return real_ioctl(s, r, p);
+	}
+
+	ret = real_ioctl(s, r, p);
+
+	switch (r) {
+	case FIONREAD:
+		value = *((int *)p);
+		if (ret == -1 && errno != EAGAIN && errno != ENOBUFS) {
+			swrap_dump_packet(si, NULL, SWRAP_PENDING_RST, NULL, 0);
+		} else if (value == 0) { /* END OF FILE */
+			swrap_dump_packet(si, NULL, SWRAP_PENDING_RST, NULL, 0);
+		}
+		break;
+	}
+
+	return ret;
+}
+
+static ssize_t swrap_sendmsg_before(struct socket_info *si,
+				    struct msghdr *msg,
+				    struct iovec *tmp_iov,
+				    struct sockaddr_un *tmp_un,
+				    const struct sockaddr_un **to_un,
+				    const struct sockaddr **to,
+				    int *bcast)
+{
+	size_t i, len = 0;
+	ssize_t ret;
+
+	if (to_un) {
+		*to_un = NULL;
+	}
+	if (to) {
+		*to = NULL;
+	}
+	if (bcast) {
+		*bcast = 0;
+	}
+
+	switch (si->type) {
+	case SOCK_STREAM:
+		if (!si->connected) {
+			errno = ENOTCONN;
+			return -1;
+		}
+
+		if (msg->msg_iovlen == 0) {
+			break;
+		}
+
+		/*
+		 * cut down to 1500 byte packets for stream sockets,
+		 * which makes it easier to format PCAP capture files
+		 * (as the caller will simply continue from here)
+		 */
+
+		for (i=0; i < msg->msg_iovlen; i++) {
+			size_t nlen;
+			nlen = len + msg->msg_iov[i].iov_len;
+			if (nlen > 1500) {
+				break;
+			}
+		}
+		msg->msg_iovlen = i;
+		if (msg->msg_iovlen == 0) {
+			*tmp_iov = msg->msg_iov[0];
+			tmp_iov->iov_len = MIN(tmp_iov->iov_len, 1500);
+			msg->msg_iov = tmp_iov;
+			msg->msg_iovlen = 1;
+		}
+		break;
+
+	case SOCK_DGRAM:
+		if (si->connected) {
+			if (msg->msg_name) {
+				errno = EISCONN;
+				return -1;
+			}
+		} else {
+			const struct sockaddr *msg_name;
+			msg_name = (const struct sockaddr *)msg->msg_name;
+
+			if (msg_name == NULL) {
+				errno = ENOTCONN;
+				return -1;
+			}
+
+
+			ret = sockaddr_convert_to_un(si, msg_name, msg->msg_namelen,
+						     tmp_un, 0, bcast);
+			if (ret == -1) return -1;
+
+			if (to_un) {
+				*to_un = tmp_un;
+			}
+			if (to) {
+				*to = msg_name;
+			}
+			msg->msg_name = tmp_un;
+			msg->msg_namelen = sizeof(*tmp_un);
+		}
+
+		if (si->bound == 0) {
+			ret = swrap_auto_bind(si, si->family);
+			if (ret == -1) return -1;
+		}
+
+		if (!si->defer_connect) {
+			break;
+		}
+
+		ret = sockaddr_convert_to_un(si, si->peername, si->peername_len,
+					     tmp_un, 0, NULL);
+		if (ret == -1) return -1;
+
+		ret = real_connect(si->fd, (struct sockaddr *)(void *)tmp_un,
+				   sizeof(*tmp_un));
+
+		/* to give better errors */
+		if (ret == -1 && errno == ENOENT) {
+			errno = EHOSTUNREACH;
+		}
+
+		if (ret == -1) {
+			return ret;
+		}
+
+		si->defer_connect = 0;
+		break;
+	default:
+		errno = EHOSTUNREACH;
+		return -1;
+	}
+
+	return 0;
+}
+
+static void swrap_sendmsg_after(struct socket_info *si,
+				struct msghdr *msg,
+				const struct sockaddr *to,
+				ssize_t ret)


-- 
SAMBA-CTDB repository


More information about the samba-cvs mailing list