[SCM] Samba Shared Repository - branch master updated

Andreas Schneider asn at samba.org
Mon Jan 22 16:27:02 UTC 2018


The branch, master has been updated
       via  39a6ea7 waf: Fix NFS quota support with libtirpc
       via  87f105d wafsamba: Allow passing 'lib' to CHECK_STRUCTURE_MEMBER
       via  ee0be7e build: deal with recent glibc sunrpc header removal
       via  c29d087 include: Create system/nis.h in libreplace
       via  ca5eaf0 s3:waf: Move HAVE_NETGROUP to wscript
       via  850a802 dbcheck: disable fixing duplicate linked attributes until we can recover lost forward links
       via  a25c99c repl_meta_data: fix linked attribute corruption on databases with unsorted links on expunge
       via  c34c2dd testprogs:blackbox: add regression test for unsorted links in tombstones-expunge.sh
      from  9daf40c talloc: Fix documentation typo

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 39a6ea766dfe55d84ab2284b8d5ed01d66da11dd
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Jan 19 14:30:20 2018 +0100

    waf: Fix NFS quota support with libtirpc
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13238
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Alexander Bokovoy <ab at samba.org>
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Mon Jan 22 17:26:52 CET 2018 on sn-devel-144

commit 87f105d76ce074bff08fd507d72568be88d48d00
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Jan 19 15:34:32 2018 +0100

    wafsamba: Allow passing 'lib' to CHECK_STRUCTURE_MEMBER
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13238
    
    We need to be able to point it to the right header location, so we need
    to be able to pass the 'lib' that it gets set.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Alexander Bokovoy <ab at samba.org>

commit ee0be7eb723be1420fd601ea1abe0af748562953
Author: Günther Deschner <gd at samba.org>
Date:   Tue Jan 16 17:48:10 2018 +0100

    build: deal with recent glibc sunrpc header removal
    
    We need to rely on libtirpc or libntirpc to be around in that case.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13238
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10976
    
    Guenther
    
    Pair-Programmed-With: Andreas Schneider <asn at samba.org>
    
    Signed-off-by: Guenther Deschner <gd at samba.org>
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Alexander Bokovoy <ab at samba.org>

commit c29d087e1ea4c92717ef86e372fe80f410580fdc
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Jan 19 09:33:21 2018 +0100

    include: Create system/nis.h in libreplace
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13238
    
    Pair-Programmed-With: Guenther Deschner <gd at samba.org>
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Signed-off-by: Guenther Deschner <gd at samba.org>
    Reviewed-by: Alexander Bokovoy <ab at samba.org>

commit ca5eaf0cdcf8257ac52786aa7439c8f081a2fe0d
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Jan 19 09:32:49 2018 +0100

    s3:waf: Move HAVE_NETGROUP to wscript
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13238
    
    Pair-Programmed-With: Guenther Deschner <gd at samba.org>
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Signed-off-by: Guenther Deschner <gd at samba.org>
    Reviewed-by: Alexander Bokovoy <ab at samba.org>

commit 850a8027f32185e523614231cca76505134bb5e4
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jan 19 11:50:55 2018 +0100

    dbcheck: disable fixing duplicate linked attributes until we can recover lost forward links
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13228
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit a25c99c9f1fd1814c56c21848c748cd0e038eed7
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Jan 17 08:07:03 2018 +0100

    repl_meta_data: fix linked attribute corruption on databases with unsorted links on expunge
    
    This is really critical bug, it removes valid linked attributes.
    
    When a DC was provisioned/joined with a Samba version older than 4.7
    is upgraded to 4.7 (or later), it can happen that the garbage collection
    (dsdb_garbage_collect_tombstones()), triggered periodically by the 'kcc' task
    of 'samba' or my 'samba-tool domain tombstones expunge' corrupt the linked attributes.
    
    This is similar to Bug #13095 - Broken linked attribute handling,
    but it's not triggered by an originating change.
    
    The bug happens in replmd_modify_la_delete()
    were get_parsed_dns_trusted() generates a sorted array of
    struct parsed_dn based on the values in old_el->values.
    
    If the database doesn't support the sortedLinks compatibleFeatures
    in the @SAMBA_DSDB record, it's very likely that
    the array of old_dns is sorted differently than the values
    in old_el->values.
    
    The problem is that struct parsed_dn has just a pointer
    'struct ldb_val *v' that points to the corresponding
    value in old_el->values.
    
    Now if vanish_links is true the damage happens here:
    
            if (vanish_links) {
                    unsigned j = 0;
                    for (i = 0; i < old_el->num_values; i++) {
                            if (old_dns[i].v != NULL) {
                                    old_el->values[j] = *old_dns[i].v;
                                    j++;
                            }
                    }
                    old_el->num_values = j;
            }
    
    old_el->values[0] = *old_dns[0].v;
    can change the value old_dns[1].v is pointing at!
    That means that some values can get lost while others
    are stored twice, because the LDB_FLAG_INTERNAL_DISABLE_SINGLE_VALUE_CHECK
    allows it to be stored.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13228
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit c34c2dd55545b99fba46cf374a1653bad96cea9e
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jan 18 14:54:04 2018 +0100

    testprogs:blackbox: add regression test for unsorted links in tombstones-expunge.sh
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13228
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

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

Summary of changes:
 buildtools/wafsamba/samba_autoconf.py              |  4 +-
 ctdb/wscript                                       |  2 +-
 lib/replace/system/nis.h                           | 83 ++++++++++++++++++++++
 lib/replace/wscript                                | 38 ++++++++--
 lib/util/access.c                                  | 10 ++-
 lib/util/wscript_build                             |  2 +-
 python/samba/dbchecker.py                          | 22 +++++-
 selftest/knownfail.d/dbcheck_duplicate_member      |  5 ++
 source3/auth/user_util.c                           | 13 ++++
 source3/auth/wscript_build                         |  2 +-
 source3/include/includes.h                         | 49 -------------
 source3/lib/sysquotas_nfs.c                        | 11 ++-
 source3/lib/util.c                                 | 11 +++
 source3/modules/nfs4acl_xattr_xdr.c                |  9 +++
 source3/wscript                                    | 35 +++++----
 source3/wscript_build                              |  2 +-
 source4/dsdb/samdb/ldb_modules/repl_meta_data.c    | 18 ++++-
 .../add-unsorted-links-step1.ldif                  | 72 +++++++++++++++++++
 .../add-unsorted-links-step2.ldif                  | 12 ++++
 .../release-4-5-0-pre1/expected-expunge-output.txt |  2 +-
 .../expected-unsorted-links-after-expunge.ldif     | 23 ++++++
 testprogs/blackbox/tombstones-expunge.sh           | 24 +++++++
 22 files changed, 365 insertions(+), 84 deletions(-)
 create mode 100644 lib/replace/system/nis.h
 create mode 100644 selftest/knownfail.d/dbcheck_duplicate_member
 create mode 100644 source4/selftest/provisions/release-4-5-0-pre1/add-unsorted-links-step1.ldif
 create mode 100644 source4/selftest/provisions/release-4-5-0-pre1/add-unsorted-links-step2.ldif
 create mode 100644 source4/selftest/provisions/release-4-5-0-pre1/expected-unsorted-links-after-expunge.ldif


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index 7940a7d..cc08e0d 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -454,7 +454,8 @@ def CHECK_CODE(conf, code, define,
 
 @conf
 def CHECK_STRUCTURE_MEMBER(conf, structname, member,
-                           always=False, define=None, headers=None):
+                           always=False, define=None, headers=None,
+                           lib=None):
     '''check for a structure member'''
     if define is None:
         define = 'HAVE_%s' % member.upper()
@@ -463,6 +464,7 @@ def CHECK_STRUCTURE_MEMBER(conf, structname, member,
                       define,
                       execute=False,
                       link=False,
+                      lib=lib,
                       always=always,
                       headers=headers,
                       local_include=False,
diff --git a/ctdb/wscript b/ctdb/wscript
index 8774b99..715ecb1 100644
--- a/ctdb/wscript
+++ b/ctdb/wscript
@@ -559,7 +559,7 @@ def build(bld):
     bld.SAMBA_BINARY('smnotify',
                      source=bld.SUBDIR('utils/smnotify',
                                        'smnotify.c gen_smnotify.c gen_xdr.c'),
-                     deps='ctdb-smnotify-h ctdb-smnotify-c ctdb-smnotify-x popt',
+                     deps='ctdb-smnotify-h ctdb-smnotify-c ctdb-smnotify-x popt tirpc',
                      includes='utils utils/smnotify',
                      install_path='${CTDB_HELPER_BINDIR}')
 
diff --git a/lib/replace/system/nis.h b/lib/replace/system/nis.h
new file mode 100644
index 0000000..068595a
--- /dev/null
+++ b/lib/replace/system/nis.h
@@ -0,0 +1,83 @@
+/*
+   Unix SMB/CIFS implementation.
+
+   nis system include wrappers
+
+   Copyright (C) Andrew Tridgell 2004
+
+     ** NOTE! The following LGPL license applies to the replace
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef _nis_passwd_h
+#define _nis_passwd_h
+
+#if defined(HAVE_RPC_RPC_H)
+/*
+ * Check for AUTH_ERROR define conflict with rpc/rpc.h in prot.h.
+ */
+#if defined(HAVE_SYS_SECURITY_H) && defined(HAVE_RPC_AUTH_ERROR_CONFLICT)
+#undef AUTH_ERROR
+#endif /* HAVE_SYS_SECURITY_H && HAVE_RPC_AUTH_ERROR_CONFLICT */
+/*
+ * HP-UX 11.X has TCP_NODELAY and TCP_MAXSEG defined in <netinet/tcp.h> which
+ * was included above.  However <rpc/rpc.h> includes <sys/xti.h> which defines
+ * them again without checking if they already exsist.  This generates
+ * two "Redefinition of macro" warnings for every single .c file that is
+ * compiled.
+ */
+#if defined(HPUX) && defined(TCP_NODELAY)
+#undef TCP_NODELAY
+#endif /* HPUX && TCP_NODELAY */
+
+#if defined(HPUX) && defined(TCP_MAXSEG)
+#undef TCP_MAXSEG
+#endif /* HPUX && TCP_MAXSEG */
+
+#include <rpc/rpc.h>
+#endif /* HAVE_RPC_RPC_H */
+
+
+#if defined (HAVE_NETGROUP)
+
+#if defined(HAVE_RPCSVC_YP_PROT_H)
+/*
+ * HP-UX 11.X has TCP_NODELAY and TCP_MAXSEG defined in <netinet/tcp.h> which
+ * was included above.  However <rpc/rpc.h> includes <sys/xti.h> which defines
+ * them again without checking if they already exsist.  This generates
+ * two "Redefinition of macro" warnings for every single .c file that is
+ * compiled.
+ */
+#if defined(HPUX) && defined(TCP_NODELAY)
+#undef TCP_NODELAY
+#endif /* HPUX && TCP_MAXSEG */
+
+#if defined(HPUX) && defined(TCP_MAXSEG)
+#undef TCP_MAXSEG
+#endif /* HPUX && TCP_MAXSEG */
+
+#include <rpcsvc/yp_prot.h>
+
+#endif /* HAVE_RPCSVC_YP_PROT_H */
+
+#if defined(HAVE_RPCSVC_YPCLNT_H)
+#include <rpcsvc/ypclnt.h>
+#endif /* HAVE_RPCSVC_YPCLNT_H */
+
+#endif /* HAVE_NETGROUP */
+
+#endif /* _nis_passwd_h */
diff --git a/lib/replace/wscript b/lib/replace/wscript
index 2f94d49..2c638b7 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -5,7 +5,7 @@ VERSION = '1.2.1'
 
 blddir = 'bin'
 
-import sys, os
+import Logs, sys, os
 
 # find the buildtools directory
 srcdir = '.'
@@ -65,14 +65,42 @@ def configure(conf):
                         headers='sys/inotify.h')
 
     conf.CHECK_HEADERS('security/pam_appl.h zlib.h asm/unistd.h')
-    conf.CHECK_HEADERS('aio.h sys/unistd.h rpc/rpc.h rpc/nettype.h alloca.h float.h')
+    conf.CHECK_HEADERS('aio.h sys/unistd.h alloca.h float.h')
+
+    conf.SET_TARGET_TYPE('tirpc', 'EMPTY')
+    conf.CHECK_HEADERS('rpc/rpc.h rpc/nettype.h')
+    if not conf.CONFIG_SET('HAVE_RPC_RPC_H'):
+        if conf.CHECK_CFG(package='libtirpc', args='--cflags --libs',
+                       msg='Checking for libtirpc headers',
+                       uselib_store='TIRPC'):
+            conf.CHECK_HEADERS('rpc/rpc.h rpc/nettype.h', lib='tirpc', together=True)
+            conf.SET_TARGET_TYPE('tirpc', 'SYSLIB')
+    if not conf.CONFIG_SET('HAVE_RPC_RPC_H'):
+        if conf.CHECK_CFG(package='libntirpc', args='--cflags',
+                       msg='Checking for libntirpc headers',
+                       uselib_store='TIRPC'):
+            conf.CHECK_HEADERS('rpc/rpc.h rpc/nettype.h', lib='tirpc', together=True)
+            conf.SET_TARGET_TYPE('tirpc', 'SYSLIB')
+    if not conf.CONFIG_SET('HAVE_RPC_RPC_H'):
+            Logs.error('ERROR: No rpc/rpc.h header found, tirpc or libntirpc missing?')
+            sys.exit(1)
+
+    conf.SET_TARGET_TYPE('nsl', 'EMPTY')
+    conf.CHECK_HEADERS('rpc/rpc.h rpcsvc/yp_prot.h', lib='tirpc')
+    if not conf.CONFIG_SET('HAVE_RPCSVC_YP_PROT_H'):
+        if conf.CHECK_CFG(package='libnsl', args='--cflags --libs',
+                          msg='Checking for libnsl',
+                          uselib_store='NSL'):
+            conf.SET_TARGET_TYPE('nsl', 'SYSLIB')
+            conf.CHECK_HEADERS('rpc/rpc.h rpcsvc/yp_prot.h', lib='tirpc nsl')
+        else:
+            conf.SET_TARGET_TYPE('nsl', 'SYSLIB')
+    conf.CHECK_HEADERS('rpcsvc/nis.h rpcsvc/ypclnt.h', lib='tirpc nsl')
 
-    conf.CHECK_HEADERS('rpcsvc/nis.h rpcsvc/ypclnt.h sys/sysctl.h')
+    conf.CHECK_HEADERS('sys/sysctl.h')
     conf.CHECK_HEADERS('sys/fileio.h sys/filesys.h sys/dustat.h sys/sysmacros.h')
     conf.CHECK_HEADERS('xfs/libxfs.h netgroup.h')
 
-    conf.CHECK_CODE('', headers='rpc/rpc.h rpcsvc/yp_prot.h', define='HAVE_RPCSVC_YP_PROT_H')
-
     conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h')
     conf.CHECK_HEADERS('nss_common.h nsswitch.h ns_api.h')
     conf.CHECK_HEADERS('sys/extattr.h sys/ea.h sys/proplist.h sys/cdefs.h')
diff --git a/lib/util/access.c b/lib/util/access.c
index 6d04a5f..7da0573 100644
--- a/lib/util/access.c
+++ b/lib/util/access.c
@@ -22,6 +22,10 @@
 #include "lib/util/access.h"
 #include "lib/util/unix_match.h"
 
+#if defined(HAVE_NETGROUP)
+#include "system/nis.h"
+#endif
+
 #define NAME_INDEX 0
 #define ADDR_INDEX 1
 
@@ -143,11 +147,11 @@ static bool string_match(const char *tok,const char *s)
 
 		netgroup_ok = innetgr(tok + 1, hostname, (char *) 0, mydomain);
 
-		DEBUG(5,("looking for %s of domain %s in netgroup %s gave %s\n",
+		DBG_INFO("%s %s of domain %s in netgroup %s\n",
+			 netgroup_ok ? "Found" : "Could not find",
 			 hostname,
 			 mydomain?mydomain:"(ANY)",
-			 tok+1,
-			 BOOLSTR(netgroup_ok)));
+			 tok+1);
 
 		SAFE_FREE(hostname);
 
diff --git a/lib/util/wscript_build b/lib/util/wscript_build
index 0b16b6f..30face3 100644
--- a/lib/util/wscript_build
+++ b/lib/util/wscript_build
@@ -204,7 +204,7 @@ else:
 
     bld.SAMBA_SUBSYSTEM('access',
                         source='access.c',
-                        deps='interfaces samba-util',
+                        deps='interfaces samba-util tirpc nsl',
                         local_include=False)
 
     bld.SAMBA_SUBSYSTEM('util_str_escape',
diff --git a/python/samba/dbchecker.py b/python/samba/dbchecker.py
index 1933740..6e4c440 100644
--- a/python/samba/dbchecker.py
+++ b/python/samba/dbchecker.py
@@ -708,9 +708,15 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base)))
                           "Failed to fix incorrect RMD_FLAGS %u" % rmd_flags):
             self.report("Fixed incorrect RMD_FLAGS %u" % (rmd_flags))
 
-    def err_orphaned_backlink(self, obj, attrname, val, link_name, target_dn):
+    def err_orphaned_backlink(self, obj, attrname, val, link_name, target_dn, duplicate_links):
         '''handle a orphaned backlink value'''
         self.report("ERROR: orphaned backlink attribute '%s' in %s for link %s in %s" % (attrname, obj.dn, link_name, target_dn))
+        if duplicate_links:
+            self.report("ERROR: FATAL! Most likely the corresponding forward link got lost!")
+            self.report("ERROR: FATAL! See https://bugzilla.samba.org/show_bug.cgi?id=13228")
+            self.report("Recovery handling will be implemented in a future version")
+            self.report("Not removing orphaned backlink %s" % attrname)
+            return
         if not self.confirm_all('Remove orphaned backlink %s' % attrname, 'fix_all_orphaned_backlinks'):
             self.report("Not removing orphaned backlink %s" % attrname)
             return
@@ -724,6 +730,11 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base)))
     def err_duplicate_links(self, obj, attrname, vals):
         '''handle a duplicate links value'''
 
+        self.report("ERROR: FATAL! Most likely some forward link values for attribute '%s' in '%s' got lost!" % (attrname, obj.dn))
+        self.report("ERROR: FATAL! See https://bugzilla.samba.org/show_bug.cgi?id=13228")
+        self.report("Recovery handling will be implemented in a future version")
+        self.report("Not removing duplicate links in attribute '%s'" % attrname)
+        return
         if not self.confirm_all("Remove duplicate links in attribute '%s'" % attrname, 'fix_all_duplicate_links'):
             self.report("Not removing duplicate links in attribute '%s'" % attrname)
             return
@@ -896,6 +907,7 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base)))
         else:
             reverse_syntax_oid = None
 
+        duplicate_links = False
         duplicate_dict = dict()
         duplicate_list = list()
         unique_dict = dict()
@@ -950,6 +962,10 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base)))
             unique_dict[keystr] = dsdb_dn
 
         if len(duplicate_list) != 0:
+            duplicate_links = True
+            self.report("ERROR: FATAL! Most likely some forward link values for attribute '%s' in '%s' got lost!" % (attrname, obj.dn))
+            self.report("ERROR: FATAL! See https://bugzilla.samba.org/show_bug.cgi?id=13228")
+
             self.report("ERROR: Duplicate link values for attribute '%s' in '%s'" % (attrname, obj.dn))
             for keystr in duplicate_list:
                 d = duplicate_dict[keystr]
@@ -1148,7 +1164,7 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base)))
                     error_count += 1
                     self.err_orphaned_backlink(obj, attrname,
                                                val, reverse_link_name,
-                                               dsdb_dn.dn)
+                                               dsdb_dn.dn, duplicate_links)
                     continue
                 # Only warn here and let the forward link logic fix it.
                 self.report("WARNING: Link (back) mismatch for '%s' (%d) on '%s' to '%s' (%d) on '%s'" % (
@@ -1180,7 +1196,7 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base)))
                 else:
                     self.err_orphaned_backlink(res[0], reverse_link_name,
                                                obj.dn.extended_str(), attrname,
-                                               obj.dn)
+                                               obj.dn, duplicate_links)
                     diff_count += 1
 
 
diff --git a/selftest/knownfail.d/dbcheck_duplicate_member b/selftest/knownfail.d/dbcheck_duplicate_member
new file mode 100644
index 0000000..7ebb82b
--- /dev/null
+++ b/selftest/knownfail.d/dbcheck_duplicate_member
@@ -0,0 +1,5 @@
+^samba4.blackbox.dbcheck-links.release-4-5-0-pre1.dbcheck_duplicate_member
+^samba4.blackbox.dbcheck-links.release-4-5-0-pre1.check_expected_after_duplicate_links
+^samba4.blackbox.dbcheck-links.release-4-5-0-pre1.duplicate_clean
+^samba4.blackbox.dbcheck-links.release-4-5-0-pre1.dbcheck_clean2
+^samba4.blackbox.dbcheck-links.release-4-5-0-pre1.dbcheck_clean3
diff --git a/source3/auth/user_util.c b/source3/auth/user_util.c
index 1ddb738..63841a1 100644
--- a/source3/auth/user_util.c
+++ b/source3/auth/user_util.c
@@ -23,6 +23,19 @@
 #include "system/filesys.h"
 #include "auth.h"
 
+#ifdef HAVE_NETGROUP
+/* rpc/xdr.h uses TRUE and FALSE */
+#ifdef TRUE
+#undef TRUE
+#endif
+
+#ifdef FALSE
+#undef FALSE
+#endif
+
+#include "system/nis.h"
+#endif
+
 /*******************************************************************
  Map a username from a dos name to a unix name by looking in the username
  map. Note that this modifies the name in place.
diff --git a/source3/auth/wscript_build b/source3/auth/wscript_build
index 83b5ad1..8fd7dcd 100644
--- a/source3/auth/wscript_build
+++ b/source3/auth/wscript_build
@@ -6,7 +6,7 @@ bld.SAMBA3_SUBSYSTEM('TOKEN_UTIL',
 
 bld.SAMBA3_SUBSYSTEM('USER_UTIL',
                      source='user_util.c',
-                     deps='TOKEN_UTIL')
+                     deps='TOKEN_UTIL tirpc nsl')
 
 bld.SAMBA3_SUBSYSTEM('AUTH_COMMON',
                     source='''auth_util.c
diff --git a/source3/include/includes.h b/source3/include/includes.h
index e82bfad..d822c3f 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -68,55 +68,6 @@
 #include "system/time.h"
 #include "system/wait.h"
 
-#if defined(HAVE_RPC_RPC_H)
-/*
- * Check for AUTH_ERROR define conflict with rpc/rpc.h in prot.h.
- */
-#if defined(HAVE_SYS_SECURITY_H) && defined(HAVE_RPC_AUTH_ERROR_CONFLICT)
-#undef AUTH_ERROR
-#endif
-/*
- * HP-UX 11.X has TCP_NODELAY and TCP_MAXSEG defined in <netinet/tcp.h> which
- * was included above.  However <rpc/rpc.h> includes <sys/xti.h> which defines
- * them again without checking if they already exsist.  This generates
- * two "Redefinition of macro" warnings for every single .c file that is
- * compiled.
- */
-#if defined(HPUX) && defined(TCP_NODELAY)
-#undef TCP_NODELAY
-#endif
-#if defined(HPUX) && defined(TCP_MAXSEG)
-#undef TCP_MAXSEG
-#endif
-#include <rpc/rpc.h>
-#endif
-
-#if defined(HAVE_YP_GET_DEFAULT_DOMAIN) && defined(HAVE_SETNETGRENT) && defined(HAVE_ENDNETGRENT) && defined(HAVE_GETNETGRENT)
-#define HAVE_NETGROUP 1
-#endif
-
-#if defined (HAVE_NETGROUP)
-#if defined(HAVE_RPCSVC_YP_PROT_H)
-/*
- * HP-UX 11.X has TCP_NODELAY and TCP_MAXSEG defined in <netinet/tcp.h> which
- * was included above.  However <rpc/rpc.h> includes <sys/xti.h> which defines
- * them again without checking if they already exsist.  This generates
- * two "Redefinition of macro" warnings for every single .c file that is
- * compiled.
- */
-#if defined(HPUX) && defined(TCP_NODELAY)
-#undef TCP_NODELAY
-#endif
-#if defined(HPUX) && defined(TCP_MAXSEG)
-#undef TCP_MAXSEG
-#endif
-#include <rpcsvc/yp_prot.h>
-#endif
-#if defined(HAVE_RPCSVC_YPCLNT_H)
-#include <rpcsvc/ypclnt.h>
-#endif
-#endif /* HAVE_NETGROUP */
-
 #ifndef HAVE_KRB5_H
 #undef HAVE_KRB5
 #endif
diff --git a/source3/lib/sysquotas_nfs.c b/source3/lib/sysquotas_nfs.c
index fe46d3f..dd2b12d 100644
--- a/source3/lib/sysquotas_nfs.c
+++ b/source3/lib/sysquotas_nfs.c
@@ -36,13 +36,22 @@
  * This is based on the FreeBSD / SUNOS5 section of quotas.c
  */
 
+/* <rpc/xdr.h> uses TRUE and FALSE */
+#ifdef TRUE
+#undef TRUE
+#endif
+
+#ifdef FALSE
+#undef FALSE
+#endif
+
 #include <rpc/rpc.h>
 #include <rpc/types.h>
+#include <rpc/xdr.h>
 #include <rpcsvc/rquota.h>
 #ifdef HAVE_RPC_NETTYPE_H
 #include <rpc/nettype.h>
 #endif
-#include <rpc/xdr.h>
 
 #ifndef RQ_PATHLEN
 #define RQ_PATHLEN 1024
diff --git a/source3/lib/util.c b/source3/lib/util.c
index fb50884..ae9fe71 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -45,6 +45,17 @@
 #define MAX_ALLOC_SIZE (1024*1024*256)
 
 #if (defined(HAVE_NETGROUP) && defined (WITH_AUTOMOUNT))
+/* rpc/xdr.h uses TRUE and FALSE */
+#ifdef TRUE
+#undef TRUE
+#endif
+
+#ifdef FALSE
+#undef FALSE
+#endif
+
+#include "system/nis.h"
+
 #ifdef WITH_NISPLUS_HOME
 #ifdef BROKEN_NISPLUS_INCLUDE_FILES
 /*
diff --git a/source3/modules/nfs4acl_xattr_xdr.c b/source3/modules/nfs4acl_xattr_xdr.c
index 524e69c..399c104 100644
--- a/source3/modules/nfs4acl_xattr_xdr.c
+++ b/source3/modules/nfs4acl_xattr_xdr.c
@@ -27,6 +27,15 @@
 #define DBGC_CLASS DBGC_VFS
 
 #ifdef HAVE_RPC_XDR_H
+/* <rpc/xdr.h> uses TRUE and FALSE */
+#ifdef TRUE
+#undef TRUE
+#endif
+
+#ifdef FALSE
+#undef FALSE
+#endif
+
 #include <rpc/xdr.h>
 #include "nfs41acl.h"
 #include "nfs4acl_xattr_xdr.h"
diff --git a/source3/wscript b/source3/wscript
index e81a212..8751833 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -119,7 +119,6 @@ def configure(conf):
     conf.CHECK_FUNCS('memalign posix_memalign hstrerror')
     conf.CHECK_FUNCS('shmget')
     conf.CHECK_FUNCS_IN('shm_open', 'rt', checklibc=True)
-    #FIXME: for some reason this one still fails
     conf.CHECK_FUNCS_IN('yp_get_default_domain', 'nsl')
     conf.CHECK_FUNCS_IN('dn_expand _dn_expand __dn_expand', 'resolv')
     conf.CHECK_FUNCS_IN('dn_expand', 'inet')
@@ -611,6 +610,11 @@ msg.msg_accrightslen = sizeof(fd);
                     headers='netdb.h netgroup.h',
                     cflags=netgrent_cflags)
 
+    if (conf.CONFIG_SET('HAVE_YP_GET_DEFAULT_DOMAIN') and
+        conf.CONFIG_SET('HAVE_SETNETGRENT') and
+        conf.CONFIG_SET('HAVE_ENDNETGRENT') and
+        conf.CONFIG_SET('HAVE_GETNETGRENT')):
+           conf.DEFINE('HAVE_NETGROUP', '1')
 
     # Look for CUPS
     if Options.options.with_cups:
@@ -1441,11 +1445,23 @@ main() {


-- 
Samba Shared Repository



More information about the samba-cvs mailing list