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

Karolin Seeger kseeger at samba.org
Tue Aug 2 14:26:05 UTC 2016


The branch, v4-4-test has been updated
       via  34f5dc7 s3: smbd: Fix delete operations enumerating streams inside a file. This must always be done as a Windows operation.
       via  250a064 s3: smbd: Change lp_set_posix_pathnames() to take a newval parameter and return the old one.
       via  2a71f2e python/remove_dc: handle dnsNode objects without dnsRecord attribute
       via  bba6aa0 s4: ldb: Ignore case of "range" in sscanf as we've already checked for its presence.
       via  ea0770f third_party/zlib/zlib.h: use HAVE___ATTRIBUTE__ instead of __GNUC__
       via  ceb8542 s4/lib/wmi_wrap: use HAVE___ATTRIBUTE__ instead of __GNUC__
       via  3d62a68 mdssvc/sparql_parser.c: use HAVE___ATTRIBUTE__ instead of __GNUC__
       via  8c47303 s3/modules/getdate: use HAVE___ATTRIBUTE__ instead of __GNUC__
       via  fc4863a tevent.h: use HAVE___ATTRIBUTE__ instead of __GNUC__
       via  e8e6d4b libreplace: use HAVE___ATTRIBUTE__ instead of __GNUC__
       via  7ae1446 util/attr.h: use HAVE___ATTRIBUTE__, not __GNUC__ comparisons
       via  385c341 configure: set HAVE___ATTRIBUTE__ for heimdal
       via  f8cfb88 param: Correct the defaults for "dcerpc endpoint services"
       via  7243019 build: Always build eventlog6. This is not a duplicate of eventlog
       via  8cfac46 libads: ensure the right ccache is used during spnego bind
       via  98634bf libads: ensure the right ccache is used during gssapi bind
      from  b5aa461 auth: fix a memory leak in gssapi_get_session_key()

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


- Log -----------------------------------------------------------------
commit 34f5dc791a00a79bb40a6a33e03c8976365f8cff
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Jul 20 11:34:48 2016 -0700

    s3: smbd: Fix delete operations enumerating streams inside a file. This must always be done as a Windows operation.
    
    When using UNIX extensions to delete a file containing streams,
    the open for delete and close operations need to enumerate the
    contained streams and do CREATE and UNLINK operations on the
    stream names. These must always be done as Windows operations
    (use lp_set_posix_pathnames(false) to flip the processing) as
    the stream names are Windows paths.
    
    Without this the create operation under the unlink will
    recurse and cause the client to time out (or a server crash).
    
    This (hack) is only needed for 4.4.x and below, it is fixed
    correctly in 4.5.x.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12021
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(v4-4-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-4-test): Tue Aug  2 16:25:32 CEST 2016 on sn-devel-144

commit 250a0644393ccc342e174cb913b0d41cd2ec2892
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Jul 20 11:25:20 2016 -0700

    s3: smbd: Change lp_set_posix_pathnames() to take a newval parameter and return the old one.
    
    Currently only used in one place, but we'll need to use it to
    temporarily change pathname processing to fix bug 12021.
    
    This (hack) is only needed for 4.4.x and below, it is fixed
    correctly in 4.5.x.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12021
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit 2a71f2e42d74a459346a06eb68a71efa2b7bfad0
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Jul 11 15:25:31 2016 +0200

    python/remove_dc: handle dnsNode objects without dnsRecord attribute
    
    If we have dnsNode objects without dnsRecord attribute values we trigger
    the following error triggered by 'samba-tool domain demote --remove-other-dead-server=server2'
    
      ERROR(<type 'exceptions.TypeError'>): uncaught exception - __ndr_unpack__()
      argument 1 must be string or read-only buffer, not dnsp.DnssrvRpcRecord
        File "/usr/lib64/python2.6/site-packages/samba/netcmd/__init__.py", line 175,
      in _run
          return self.run(*args, **kwargs)
        File "/usr/lib64/python2.6/site-packages/samba/netcmd/domain.py", line 720, in
      run
          remove_dc.remove_dc(samdb, logger, remove_other_dead_server)
        File "/usr/lib64/python2.6/site-packages/samba/remove_dc.py", line 423, in
      remove_dc
          remove_dns_account=True)
        File "/usr/lib64/python2.6/site-packages/samba/remove_dc.py", line 351, in
      offline_remove_ntds_dc
          remove_dns_account=remove_dns_account)
        File "/usr/lib64/python2.6/site-packages/samba/remove_dc.py", line 266, in
      offline_remove_server
          remove_dns_references(samdb, logger, dnsHostName)
        File "/usr/lib64/python2.6/site-packages/samba/remove_dc.py", line 186, in
      remove_dns_references
          for v in values if not to_remove(v) ]
        File "/usr/lib64/python2.6/site-packages/samba/remove_dc.py", line 160, in
      to_remove
          dnsRecord = ndr_unpack(dnsp.DnssrvRpcRecord, value)
        File "/usr/lib64/python2.6/site-packages/samba/ndr.py", line 45, in ndr_unpack
          object.__ndr_unpack__(data, allow_remaining=allow_remaining)
      A transaction is still active in ldb context [0xe1f320] on
      tdb:///var/lib/samba/private/sam.ldb
    
    "next" is used in perl not in python!
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12018
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Wed Jul 13 10:10:30 CEST 2016 on sn-devel-144
    
    (cherry picked from commit f8181360a89ac9e53cc991e966958e496271fa15)

commit bba6aa049680c76f827de7a42ccc3a7225c73fd0
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Jun 28 15:38:22 2016 -0700

    s4: ldb: Ignore case of "range" in sscanf as we've already checked for its presence.
    
    https://bugzilla.samba.org/show_bug.cgi?id=11838
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit 1d4b20d4f3829eb3778006397990cd9fee4966a5)

commit ea0770f049001d8d0123f2e6f4a9945ec25ec8f6
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Wed Mar 23 15:30:22 2016 +1300

    third_party/zlib/zlib.h: use HAVE___ATTRIBUTE__ instead of __GNUC__
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11750
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    
    Autobuild-User(master): Uri Simchoni <uri at samba.org>
    Autobuild-Date(master): Thu Mar 24 18:43:34 CET 2016 on sn-devel-144
    
    (cherry picked from commit d64877541036c6b82aa0204671bfdae08936b529)

commit ceb85424856daf1379f440220852a4abb2a61b46
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Wed Mar 23 15:29:50 2016 +1300

    s4/lib/wmi_wrap: use HAVE___ATTRIBUTE__ instead of __GNUC__
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11750
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 82258aa2a6ff1a8d139f60abb170aaffb0934025)

commit 3d62a68e050d6a78ffb3ac3e4b9e1e2efd5ae3cd
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Wed Mar 23 15:28:45 2016 +1300

    mdssvc/sparql_parser.c: use HAVE___ATTRIBUTE__ instead of __GNUC__
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11750
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 7b92b84415dd3292538eb4e44fac12b4e564b984)

commit 8c473033c9a60dc8ae1e3ee0c3ac7108efc1d765
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Wed Mar 23 15:27:45 2016 +1300

    s3/modules/getdate: use HAVE___ATTRIBUTE__ instead of __GNUC__
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11750
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit fb0ebbfcbfb5754b0fca7b309eaded0e57877230)

commit fc4863a9d9f2c133061e4d5cbc29a5176ec38fc1
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Wed Mar 23 15:26:49 2016 +1300

    tevent.h: use HAVE___ATTRIBUTE__ instead of __GNUC__
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11750
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit a20ee62984bdb623f8fa55a9900cb69a99bf38e6)

commit e8e6d4b157fad29fd10175424288a63f585e9aa9
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Wed Mar 23 15:26:03 2016 +1300

    libreplace: use HAVE___ATTRIBUTE__ instead of __GNUC__
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11750
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 6ba2fe2e3f1ad27b12f4ef67f41c7ad4f29f17c3)

commit 7ae14463b32710c5025376589fa1e7e8bc205bc6
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Wed Mar 23 11:16:48 2016 +1300

    util/attr.h: use HAVE___ATTRIBUTE__, not __GNUC__ comparisons
    
    The comparisons that look like
    
        #if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
    
    fail if __GNUC_MINOR__ is 0.  The intended comparison is something
    more like
    
        #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
    
    However, given that:
    
     * these checks are really trying to test the presence of
       __attribute__,
    
     * there are now credible compilers that are not GCC, which have
       __attribute__ but might not be good at emulating __GNUC__
       numbers, and
    
     * we really face little risk of running into GCC 2.95
    
     * we have a HAVE___ATTRIBUTE__ check in ./configure
    
    let's not do the version comparisons.
    
    (Untested on GCC 2.95, GCC 3.0 and GCC 3.1).
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11750
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 88be24c279e29a363c2aabcb68b5f0a1e039f477)

commit 385c3416048dffc5f3becf894be6e440a16717d6
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Tue Mar 8 10:23:09 2016 +1300

    configure: set HAVE___ATTRIBUTE__ for heimdal
    
    Without this, heimdal ends up defining __attribute__ away, causing
    gcc-6 compile errors with -Werror=return-type because it can't tell
    when functions have __attribute__((noreturn)).
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11750
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Garming Sam <garming at catalyst.net.nz>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Wed Mar  9 13:52:26 CET 2016 on sn-devel-144
    
    (cherry picked from commit 1c796547f20fa3c7c2e93fd5ce6ee8453a2bb435)

commit f8cfb888ccfd2443b3fa106acdff1305f1e35979
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Sat Jul 9 17:36:18 2016 +1200

    param: Correct the defaults for "dcerpc endpoint services"
    
    We must not list any services that we skip building, as otherwise all RPC services fail to start.
    
    We now build without the source4 spoolss server in non-developer builds
    
    This fixes commit 0b4c741b9c03d147ee5f56d027bacda75c1b5282
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12025
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    (cherry picked from commit 748384992b96c3936d82bc09f39459fb4bd489bd)

commit 72430196d2cb10e8466884b85d1322f1b4d1feaf
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Sat Jul 9 17:34:39 2016 +1200

    build: Always build eventlog6. This is not a duplicate of eventlog
    
    The eventlog6 pipe is not a duplicate with the source3 code, so should be built even
    for the default build with smbd for file serving
    
    This fixes commit 0b4c741b9c03d147ee5f56d027bacda75c1b5282
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12026
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    (cherry picked from commit d183261e6844724394d618912403cd0217401741)

commit 8cfac46fc8b4634474d259f2db2e4d1119da4aad
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Jul 6 12:44:11 2016 +0200

    libads: ensure the right ccache is used during spnego bind
    
    When doing spnego sasl bind:
    1. Try working without kinit only if a password is not
       provided
    2. When using kinit, ensure the KRB5CCNAME env var is set
       to a private memory ccache, so that the bind is on behalf
       of the requested user.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12007
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Tue Jul 12 03:23:33 CEST 2016 on sn-devel-144
    
    (cherry picked from commit a1743de74f09d5bf695f077f5127d02352a014e2)

commit 98634bf11011050a4f3c8bce047aec832e7eab1b
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Jul 6 12:48:11 2016 +0200

    libads: ensure the right ccache is used during gssapi bind
    
    When doing gssapi sasl bind:
    1. Try working without kinit only if a password is not
       provided
    2. When using kinit, ensure the KRB5CCNAME env var is set
       to a private memory ccache, so that the bind is on behalf
       of the requested user.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12007
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 2672968851966e5c01e4fc4d906b45b5c047e655)

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

Summary of changes:
 buildtools/wafsamba/wscript                        | 16 +++++++
 .../smbdotconf/protocol/dcerpcendpointservers.xml  |  2 +-
 lib/param/loadparm.c                               |  2 +-
 lib/replace/replace.h                              |  4 +-
 lib/tevent/tevent.h                                |  2 +-
 lib/util/attr.h                                    | 16 +++----
 python/samba/remove_dc.py                          | 11 +++--
 source3/include/proto.h                            |  2 +-
 source3/libads/sasl.c                              | 52 +++++++++++++++-------
 source3/modules/getdate.c                          |  2 +-
 source3/modules/getdate.y                          |  2 +-
 source3/param/loadparm.c                           | 11 ++---
 source3/rpc_server/mdssvc/sparql_parser.c          |  4 +-
 source3/smbd/close.c                               | 10 +++++
 source3/smbd/open.c                                | 10 +++++
 source3/smbd/trans2.c                              |  2 +-
 source4/dsdb/samdb/ldb_modules/ranged_results.c    |  8 ++--
 source4/lib/wmi/wmi_wrap.c                         |  8 +---
 source4/rpc_server/wscript_build                   |  3 +-
 third_party/zlib/zlib.h                            |  2 +-
 20 files changed, 109 insertions(+), 60 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript
index 586cc4b..8802e5a 100755
--- a/buildtools/wafsamba/wscript
+++ b/buildtools/wafsamba/wscript
@@ -402,6 +402,22 @@ def configure(conf):
             addmain=False,
             msg='Checking for library destructor support')
 
+    conf.CHECK_CODE('''
+            void test_attribute(void) __attribute__ (());
+
+            void test_attribute(void)
+            {
+                return;
+            }
+
+            int main(void) {
+                return 0;
+            }
+            ''',
+            'HAVE___ATTRIBUTE__',
+            addmain=False,
+            msg='Checking for __attribute__')
+
     if sys.platform.startswith('aix'):
         conf.DEFINE('_ALL_SOURCE', 1, add_to_cflags=True)
         # Might not be needed if ALL_SOURCE is defined
diff --git a/docs-xml/smbdotconf/protocol/dcerpcendpointservers.xml b/docs-xml/smbdotconf/protocol/dcerpcendpointservers.xml
index feecf62..8a217cc 100644
--- a/docs-xml/smbdotconf/protocol/dcerpcendpointservers.xml
+++ b/docs-xml/smbdotconf/protocol/dcerpcendpointservers.xml
@@ -6,6 +6,6 @@
 	<para>Specifies which DCE/RPC endpoint servers should be run.</para>
 </description>
 
-<value type="default">epmapper, wkssvc, rpcecho, samr, netlogon, lsarpc, spoolss, drsuapi, dssetup, unixinfo, browser, eventlog6, backupkey, dnsserver</value>
+<value type="default">epmapper, wkssvc, rpcecho, samr, netlogon, lsarpc, drsuapi, dssetup, unixinfo, browser, eventlog6, backupkey, dnsserver</value>
 <value type="example">rpcecho</value>
 </samba:parameter>
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index 73d4204..873561a 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -2569,7 +2569,7 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx)
 	lpcfg_do_global_parameter(lp_ctx, "ntvfs handler", "unixuid default");
 	lpcfg_do_global_parameter(lp_ctx, "max connections", "0");
 
-	lpcfg_do_global_parameter(lp_ctx, "dcerpc endpoint servers", "epmapper wkssvc rpcecho samr netlogon lsarpc spoolss drsuapi dssetup unixinfo browser eventlog6 backupkey dnsserver");
+	lpcfg_do_global_parameter(lp_ctx, "dcerpc endpoint servers", "epmapper wkssvc rpcecho samr netlogon lsarpc drsuapi dssetup unixinfo browser eventlog6 backupkey dnsserver");
 	lpcfg_do_global_parameter(lp_ctx, "server services", "s3fs rpc nbt wrepl ldap cldap kdc drepl winbindd ntp_signd kcc dnsupdate dns");
 	lpcfg_do_global_parameter(lp_ctx, "kccsrv:samba_kcc", "false");
 	/* the winbind method for domain controllers is for both RODC
diff --git a/lib/replace/replace.h b/lib/replace/replace.h
index c764d06..7080373 100644
--- a/lib/replace/replace.h
+++ b/lib/replace/replace.h
@@ -425,7 +425,7 @@ int rep_dlclose(void *handle);
 #endif
 
 #ifndef PRINTF_ATTRIBUTE
-#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
+#ifdef HAVE___ATTRIBUTE__
 /** Use gcc attribute to check printf fns.  a1 is the 1-based index of
  * the parameter containing the format, and a2 the index of the first
  * argument. Note that some gcc 2.x versions don't handle this
@@ -437,7 +437,7 @@ int rep_dlclose(void *handle);
 #endif
 
 #ifndef _DEPRECATED_
-#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
+#ifdef HAVE___ATTRIBUTE__
 #define _DEPRECATED_ __attribute__ ((deprecated))
 #else
 #define _DEPRECATED_
diff --git a/lib/tevent/tevent.h b/lib/tevent/tevent.h
index cb95507..cc6b15e 100644
--- a/lib/tevent/tevent.h
+++ b/lib/tevent/tevent.h
@@ -1752,7 +1752,7 @@ void tevent_thread_proxy_schedule(struct tevent_thread_proxy *tp,
 
 #ifdef TEVENT_DEPRECATED
 #ifndef _DEPRECATED_
-#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
+#ifdef HAVE___ATTRIBUTE__
 #define _DEPRECATED_ __attribute__ ((deprecated))
 #else
 #define _DEPRECATED_
diff --git a/lib/util/attr.h b/lib/util/attr.h
index b72696a..8e542c1 100644
--- a/lib/util/attr.h
+++ b/lib/util/attr.h
@@ -35,7 +35,7 @@
 #endif
 
 #ifndef _DEPRECATED_
-#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
+#ifdef HAVE___ATTRIBUTE__
 #define _DEPRECATED_ __attribute__ ((deprecated))
 #else
 #define _DEPRECATED_
@@ -43,7 +43,7 @@
 #endif
 
 #ifndef _WARN_UNUSED_RESULT_
-#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
+#ifdef HAVE___ATTRIBUTE__
 #define _WARN_UNUSED_RESULT_ __attribute__ ((warn_unused_result))
 #else
 #define _WARN_UNUSED_RESULT_
@@ -51,7 +51,7 @@
 #endif
 
 #ifndef _NORETURN_
-#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
+#ifdef HAVE___ATTRIBUTE__
 #define _NORETURN_ __attribute__ ((noreturn))
 #else
 #define _NORETURN_
@@ -59,7 +59,7 @@
 #endif
 
 #ifndef _PURE_
-#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1)
+#ifdef HAVE___ATTRIBUTE__
 #define _PURE_ __attribute__((pure))
 #else
 #define _PURE_
@@ -67,7 +67,7 @@
 #endif
 
 #ifndef NONNULL
-#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1)
+#ifdef HAVE___ATTRIBUTE__
 #define NONNULL(param) param __attribute__((nonnull))
 #else
 #define NONNULL(param) param
@@ -75,7 +75,7 @@
 #endif
 
 #ifndef PRINTF_ATTRIBUTE
-#if __GNUC__ >= 3
+#ifdef HAVE___ATTRIBUTE__
 /** Use gcc attribute to check printf fns.  a1 is the 1-based index of
  * the parameter containing the format, and a2 the index of the first
  * argument. Note that some gcc 2.x versions don't handle this
@@ -87,11 +87,11 @@
 #endif
 
 #ifndef FORMAT_ATTRIBUTE
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
+#ifdef HAVE___ATTRIBUTE__
 /** Use gcc attribute to check printf fns.  a1 is argument to format()
  * in the above macro.  This is needed to support Heimdal's printf
  * decorations. Note that some gcc 2.x versions don't handle this
- * properly, and as such I've used the same minimum from heimdal: GCC 3.1 **/
+ * properly. **/
 #define FORMAT_ATTRIBUTE(a) __attribute__ ((format a))
 #else
 #define FORMAT_ATTRIBUTE(a)
diff --git a/python/samba/remove_dc.py b/python/samba/remove_dc.py
index 055a516..db7bb82 100644
--- a/python/samba/remove_dc.py
+++ b/python/samba/remove_dc.py
@@ -176,19 +176,18 @@ def remove_dns_references(samdb, logger, dnsHostName):
                                attrs=["dnsRecord"])
         for record in records:
             try:
-                values = record["dnsRecord"]
+                orig_values = record["dnsRecord"]
             except KeyError:
-                next
-            orig_num_values = len(values)
+                continue
 
             # Remove references to dnsHostName in A, AAAA, NS, CNAME and SRV
             values = [ ndr_unpack(dnsp.DnssrvRpcRecord, v)
-                       for v in values if not to_remove(v) ]
+                       for v in orig_values if not to_remove(v) ]
 
-            if len(values) != orig_num_values:
+            if len(values) != len(orig_values):
                 logger.info("updating %s keeping %d values, removing %s values" \
                             % (record.dn, len(values),
-                               orig_num_values - len(values)))
+                               len(orig_values) - len(values)))
 
                 # This requires the values to be unpacked, so this
                 # has been done in the list comprehension above
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 0bd0c80..62cd257 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1020,7 +1020,7 @@ bool lp_use_sendfile(int snum, struct smb_signing_state *signing_state);
 void set_use_sendfile(int snum, bool val);
 void lp_set_mangling_method(const char *new_method);
 bool lp_posix_pathnames(void);
-void lp_set_posix_pathnames(void);
+bool lp_set_posix_pathnames(bool newval);
 enum brl_flavour lp_posix_cifsu_locktype(files_struct *fsp);
 void lp_set_posix_default_cifsx_readwrite_locktype(enum brl_flavour val);
 int lp_min_receive_file_size(void);
diff --git a/source3/libads/sasl.c b/source3/libads/sasl.c
index d76d872..85a2eb0 100644
--- a/source3/libads/sasl.c
+++ b/source3/libads/sasl.c
@@ -26,6 +26,7 @@
 #include "smb_krb5.h"
 #include "system/gssapi.h"
 #include "lib/param/loadparm.h"
+#include "krb5_env.h"
 
 #ifdef HAVE_LDAP
 
@@ -748,18 +749,29 @@ static ADS_STATUS ads_sasl_spnego_bind(ADS_STRUCT *ads)
 	if (!(ads->auth.flags & ADS_AUTH_DISABLE_KERBEROS) &&
 	    got_kerberos_mechanism) 
 	{
-		status = ads_sasl_spnego_gensec_bind(ads, "GSS-SPNEGO",
-						     CRED_MUST_USE_KERBEROS,
-						     p.service, p.hostname,
-						     blob);
-		if (ADS_ERR_OK(status)) {
-			ads_free_service_principal(&p);
-			goto done;
+		const char *ccache_name = "MEMORY:ads_sasl_spnego_bind";
+		if (ads->auth.ccache_name != NULL) {
+			ccache_name = ads->auth.ccache_name;
 		}
 
-		DEBUG(10,("ads_sasl_spnego_gensec_bind(KRB5) failed with: %s, "
-			  "calling kinit\n", ads_errstr(status)));
+		if (ads->auth.password == NULL ||
+		    ads->auth.password[0] == '\0')
+		{
 
+			status = ads_sasl_spnego_gensec_bind(ads, "GSS-SPNEGO",
+							     CRED_MUST_USE_KERBEROS,
+							     p.service, p.hostname,
+							     blob);
+			if (ADS_ERR_OK(status)) {
+				ads_free_service_principal(&p);
+				goto done;
+			}
+
+			DEBUG(10,("ads_sasl_spnego_gensec_bind(KRB5) failed with: %s, "
+				  "calling kinit\n", ads_errstr(status)));
+		}
+
+		setenv(KRB5_ENV_CCNAME, ccache_name, 1);
 		status = ADS_ERROR_KRB5(ads_kinit_password(ads)); 
 
 		if (ADS_ERR_OK(status)) {
@@ -1015,21 +1027,29 @@ static ADS_STATUS ads_sasl_gssapi_bind(ADS_STRUCT *ads)
 {
 	ADS_STATUS status;
 	struct ads_service_principal p;
+	const char *ccache_name = "MEMORY:ads_sasl_gssapi_do_bind";
 
 	status = ads_generate_service_principal(ads, &p);
 	if (!ADS_ERR_OK(status)) {
 		return status;
 	}
 
-	status = ads_sasl_gssapi_do_bind(ads, p.name);
-	if (ADS_ERR_OK(status)) {
-		ads_free_service_principal(&p);
-		return status;
-	}
+	if (ads->auth.password == NULL ||
+	    ads->auth.password[0] == '\0') {
+		status = ads_sasl_gssapi_do_bind(ads, p.name);
+		if (ADS_ERR_OK(status)) {
+			ads_free_service_principal(&p);
+			return status;
+		}
 
-	DEBUG(10,("ads_sasl_gssapi_do_bind failed with: %s, "
-		  "calling kinit\n", ads_errstr(status)));
+		DEBUG(10,("ads_sasl_gssapi_do_bind failed with: %s, "
+			  "calling kinit\n", ads_errstr(status)));
+	}
 
+	if (ads->auth.ccache_name != NULL) {
+		ccache_name = ads->auth.ccache_name;
+	}
+	setenv(KRB5_ENV_CCNAME, ccache_name, 1);
 	status = ADS_ERROR_KRB5(ads_kinit_password(ads));
 
 	if (ADS_ERR_OK(status)) {
diff --git a/source3/modules/getdate.c b/source3/modules/getdate.c
index a27b75f..6ed9946 100644
--- a/source3/modules/getdate.c
+++ b/source3/modules/getdate.c
@@ -181,7 +181,7 @@
 # include <string.h>
 #endif
 
-#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__
+#ifndef HAVE___ATTRIBUTE__
 # define __attribute__(x)
 #endif
 
diff --git a/source3/modules/getdate.y b/source3/modules/getdate.y
index 21c01b8..1ddcda4 100644
--- a/source3/modules/getdate.y
+++ b/source3/modules/getdate.y
@@ -72,7 +72,7 @@
 # include <string.h>
 #endif
 
-#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__
+#ifndef HAVE___ATTRIBUTE__
 # define __attribute__(x)
 #endif
 
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 2ad1c6f..32acd03 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -871,7 +871,7 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
 
 	Globals.server_services = str_list_make_v3_const(NULL, "s3fs rpc nbt wrepl ldap cldap kdc drepl winbindd ntp_signd kcc dnsupdate dns", NULL);
 
-	Globals.dcerpc_endpoint_servers = str_list_make_v3_const(NULL, "epmapper wkssvc rpcecho samr netlogon lsarpc spoolss drsuapi dssetup unixinfo browser eventlog6 backupkey dnsserver", NULL);
+	Globals.dcerpc_endpoint_servers = str_list_make_v3_const(NULL, "epmapper wkssvc rpcecho samr netlogon lsarpc drsuapi dssetup unixinfo browser eventlog6 backupkey dnsserver", NULL);
 
 	Globals.tls_enabled = true;
 	Globals.tls_verify_peer = TLS_VERIFY_PEER_AS_STRICT_AS_POSSIBLE;
@@ -4337,13 +4337,14 @@ bool lp_posix_pathnames(void)
 }
 
 /*******************************************************************
- Change everything needed to ensure POSIX pathname processing (currently
- not much).
+ Set posix pathnames to new value. Returns old value.
 ********************************************************************/
 
-void lp_set_posix_pathnames(void)
+bool lp_set_posix_pathnames(bool newval)
 {
-	posix_pathnames = true;
+	bool oldval = posix_pathnames;
+	posix_pathnames = newval;
+	return oldval;
 }
 
 /*******************************************************************
diff --git a/source3/rpc_server/mdssvc/sparql_parser.c b/source3/rpc_server/mdssvc/sparql_parser.c
index 8170290..3cd532b 100644
--- a/source3/rpc_server/mdssvc/sparql_parser.c
+++ b/source3/rpc_server/mdssvc/sparql_parser.c
@@ -241,9 +241,7 @@ typedef short int yytype_int16;
 #endif
 
 #ifndef YY_ATTRIBUTE
-# if (defined __GNUC__                                               \
-      && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))  \
-     || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
+# if HAVE___ATTRIBUTE__
 #  define YY_ATTRIBUTE(Spec) __attribute__(Spec)
 # else
 #  define YY_ATTRIBUTE(Spec) /* empty */
diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index 3ab04b7..271885e 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -168,6 +168,7 @@ NTSTATUS delete_all_streams(connection_struct *conn, const char *fname)
 	unsigned int num_streams = 0;
 	TALLOC_CTX *frame = talloc_stackframe();
 	NTSTATUS status;
+	bool saved_posix_pathnames;
 
 	status = vfs_streaminfo(conn, NULL, fname, talloc_tos(),
 				&num_streams, &stream_info);
@@ -192,6 +193,13 @@ NTSTATUS delete_all_streams(connection_struct *conn, const char *fname)
 		return NT_STATUS_OK;
 	}
 
+	/*
+	 * Any stream names *must* be treated as Windows
+	 * pathnames, even if we're using UNIX extensions.
+	 */
+
+	saved_posix_pathnames = lp_set_posix_pathnames(false);
+
 	for (i=0; i<num_streams; i++) {
 		int res;
 		struct smb_filename *smb_fname_stream;
@@ -223,6 +231,8 @@ NTSTATUS delete_all_streams(connection_struct *conn, const char *fname)
 	}
 
  fail:
+
+	(void)lp_set_posix_pathnames(saved_posix_pathnames);
 	TALLOC_FREE(frame);
 	return status;
 }
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 2d5f8d7..5935ff5 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -3871,6 +3871,7 @@ NTSTATUS open_streams_for_delete(connection_struct *conn,
 	unsigned int num_streams = 0;
 	TALLOC_CTX *frame = talloc_stackframe();
 	NTSTATUS status;
+	bool saved_posix_pathnames;
 
 	status = vfs_streaminfo(conn, NULL, fname, talloc_tos(),
 				&num_streams, &stream_info);
@@ -3903,6 +3904,13 @@ NTSTATUS open_streams_for_delete(connection_struct *conn,
 		goto fail;
 	}
 
+	/*
+	 * Any stream names *must* be treated as Windows
+	 * pathnames, even if we're using UNIX extensions.
+	 */
+
+	saved_posix_pathnames = lp_set_posix_pathnames(false);
+
 	for (i=0; i<num_streams; i++) {
 		struct smb_filename *smb_fname;
 
@@ -3970,6 +3978,8 @@ NTSTATUS open_streams_for_delete(connection_struct *conn,
 	}
 
  fail:
+
+	(void)lp_set_posix_pathnames(saved_posix_pathnames);
 	TALLOC_FREE(frame);
 	return status;
 }
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 1780d6f..7354bba 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -4152,7 +4152,7 @@ static void call_trans2setfsinfo(connection_struct *conn,
 
 			/* Here is where we must switch to posix pathname processing... */
 			if (xconn->smb1.unix_info.client_cap_low & CIFS_UNIX_POSIX_PATHNAMES_CAP) {
-				lp_set_posix_pathnames();
+				(void)lp_set_posix_pathnames(true);
 				mangle_change_to_posix();
 			}
 
diff --git a/source4/dsdb/samdb/ldb_modules/ranged_results.c b/source4/dsdb/samdb/ldb_modules/ranged_results.c
index 60d7503..13bf3a2 100644
--- a/source4/dsdb/samdb/ldb_modules/ranged_results.c
+++ b/source4/dsdb/samdb/ldb_modules/ranged_results.c
@@ -201,6 +201,8 @@ static int rr_search(struct ldb_module *module, struct ldb_request *req)
 	/* Strip the range request from the attribute */
 	for (i = 0; req->op.search.attrs && req->op.search.attrs[i]; i++) {
 		char *p;
+		size_t range_len = strlen(";range=");
+
 		new_attrs = talloc_realloc(req, new_attrs, const char *, i+2);
 		new_attrs[i] = req->op.search.attrs[i];
 		new_attrs[i+1] = NULL;
@@ -208,12 +210,12 @@ static int rr_search(struct ldb_module *module, struct ldb_request *req)
 		if (!p) {
 			continue;
 		}
-		if (strncasecmp(p, ";range=", strlen(";range=")) != 0) {
+		if (strncasecmp(p, ";range=", range_len) != 0) {
 			continue;
 		}
 		end = (unsigned int)-1;
-		if (sscanf(p, ";range=%u-*", &start) != 1) {
-			if (sscanf(p, ";range=%u-%u", &start, &end) != 2) {
+		if (sscanf(p + range_len, "%u-*", &start) != 1) {
+			if (sscanf(p + range_len, "%u-%u", &start, &end) != 2) {
 				ldb_asprintf_errstring(ldb,
 					"range request error: "
 					"range request malformed");
diff --git a/source4/lib/wmi/wmi_wrap.c b/source4/lib/wmi/wmi_wrap.c
index a4aaf1b..07eba3e 100644
--- a/source4/lib/wmi/wmi_wrap.c
+++ b/source4/lib/wmi/wmi_wrap.c
@@ -39,13 +39,7 @@
 
 /* attribute recognised by some compilers to avoid 'unused' warnings */
 #ifndef SWIGUNUSED
-# if defined(__GNUC__)
-#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-#     define SWIGUNUSED __attribute__ ((__unused__)) 
-#   else
-#     define SWIGUNUSED
-#   endif
-# elif defined(__ICC)
+# ifdef HAVE___ATTRIBUTE__
 #   define SWIGUNUSED __attribute__ ((__unused__)) 
 # else
 #   define SWIGUNUSED 
diff --git a/source4/rpc_server/wscript_build b/source4/rpc_server/wscript_build
index b9de1fb..ff2b82e 100755
--- a/source4/rpc_server/wscript_build
+++ b/source4/rpc_server/wscript_build
@@ -158,8 +158,7 @@ bld.SAMBA_MODULE('dcerpc_eventlog',
 	source='eventlog/dcesrv_eventlog6.c',
 	subsystem='dcerpc_server',


-- 
Samba Shared Repository



More information about the samba-cvs mailing list