[SCM] Samba Shared Repository - branch v4-2-stable updated

Karolin Seeger kseeger at samba.org
Tue Feb 24 12:10:01 MST 2015


The branch, v4-2-stable has been updated
       via  6c9d254 VERSION: Disable git snapshots for the 4.2.0rc5 release.
       via  5ab7f96 WHATSNEW: Add release notes for Samba 4.2.0rc5.
       via  3bd8850 s3-netlogon: Make sure we do not deference a NULL pointer.
       via  9988930 CVE-2015-0240: s3: netlogon: Ensure we don't call talloc_free on an uninitialized pointer.
       via  bba7796 s3: smbd: SMB2 close. If a file has delete on close, store the return info before deleting.
       via  381e601 s3: smbd: SMB2 close. Call utility function setup_close_full_information()
       via  66acf5b s3: smbd: SMB2 close. Add utility function setup_close_full_information()
       via  22578e8 s4: smbtorture: leases - show stat opens grant leases and can be broken.
       via  6eadda1 s3: smbd: leases - losen paranoia check. Stat opens can grant leases.
       via  8b7e8ee s3: smbd: leases - new torture test shows stat opens can get leases.
       via  8409939 samba-tool: Create NIS enabled users and unixHomeDirectory attribute
       via  b4f965d s3: smbclient: Allinfo leaves the file handle open.
       via  9cfaed4 printing/cups: pack requested-attributes with IPP_TAG_KEYWORD
       via  26f58b7 s3:smb2_server: protect against integer wrap with "smb2 max credits = 65535"
       via  fc8cab8 s3:smb2_server: always try to grant the credits the client just consumed
       via  a4fdd14 wafsamba: create unique names when building shared modules
       via  47c1038 wafsamba: remove unused variable in SAMBA_MODULE()
       via  3e865e1 wafsamba: passing 'subsystem' to SAMBA_MODULE() is not optional
       via  f9fbb92 wafsamba: make it possible to pass bundled_name to SAMBA_LIBRARY()
       via  23a4ba8 wafadmin: backported the openbsd fixes from waf 1.7
       via  aada20e wafsamba: remove commented out code.
       via  8001ec4 Revert "waf: added suncc_wrap"
       via  deb4041 wafsamba: generate an empty.c file if a SAMBA_{LIBRARY,SUBSYSTEM} doesn't have any source files
       via  b2bb6ae wafsamba: flags from enviroment are put before our own internal versions
       via  573c452 wafsamba: filter out standard library paths from RPATH and LIBPATH
       via  28e48f3 wafsamba: fix ordering problems with lib-provided and internal RPATHs
       via  c2a5e08 wafsamba: make it possible to specify ADDITIONAL_{CFLAGS,LDFLAGS} as env var to ./configure
       via  320ee4e wafsamba: improve -fvisibility=hidden, we should check it together this WERROR_CFLAGS
       via  f36016e wafsamba: let CURRENT_CFLAGS() use bld.env.VISIBILITY_CFLAGS
       via  c6f5361 wafsamba: move -fvisibility=hidden checks from lib/replace to wafsamba
       via  57855ba wafsamba: move '-fstack-protector' checks from lib/replace to wafsamba
       via  1e84abd0 wafsamba: move WERROR_CFLAGS checks from lib/replace to wafsamba
       via  17ae6ba wafsamba: move compiler / cflags related stuff from lib/replace to wafsamba
       via  cb71b4b wafsamba: let TO_LIST(mylist) return a copy of mylist
       via  1b57443 wafsamba: check for rpath compiler/linker flags
       via  fe9897b wafsamba: fill PRIVATE_NAME() logic again
       via  5a257a0 wafsamba: add -Werror=return-type for developer builds
       via  1b31b8e Reduce the no-op build times by 30%
       via  94aceed Don't use a nested function when testing for visibility attribute support.
       via  ac06d67 Fix more pep8 issues in code I touched recently.
       via  488def5 Remove last instances of pep8 error E712 (use 'is' rather than '==' for booleans)
       via  99b4213 s3: lib, s3: modules: Fix compilation on Solaris.
       via  8a5df7d s4:dsdb/tests: add test_timevalues1() to verify timestamp values
       via  a707d53 ldb: version 1.1.20
       via  cd82192 lib/ldb: fix logic in ldb_val_to_time()
       via  62487b6 Remove use of the "staticforward" macro
       via  84008fe ldb: bump to version 1.1.19
       via  3a97cea ldb: Allow to register extended match rules
       via  f45d30c s3-pam_smbpass: Fix memory leak in pam_sm_authenticate().
       via  e38f3ea utils: Fix 'net time' segfault.
       via  a5d30bd cli_connect_nb_send: don't segfault on host == NULL.
       via  69dd558 vfs_snapper: encode and decode Snapper DBus strings
       via  428c582 vfs_snapper: add DBus string encoding and decoding helpers
       via  1381ac0 vfs_snapper: free dbus req messages in error paths
       via  f922899 s3-vfs: Fix developer build of vfs_ceph module.
       via  ffc1cca vfs_glusterfs: Add comments to the pipe(2) code.
       via  0c9e53b vfs: Fix a typo
       via  7e0e0e0 vfs:glusterfs: whitespace fix.
       via  42b9b52 vfs_glusterfs: Replace eventfd with pipes, for AIO use
       via  1d05617 vfs/glusterfs: Change xattr key to match gluster key.
       via  d35fa8e vfs_glusterfs: Implement AIO support
       via  bab4805 vfs_glusterfs: Change sys_get_acl_file/fd to return ACLs corresponding to mode bits when there are no ACLs set.
       via  d56da88 vfs_glusterfs: Set connectpath as snapdir-entry-path.
       via  11d3349 vfs_glusterfs: Remember the connect path too for reopening.
       via  9994410 vfs_glusterfs: In vfs_gluster_sys_acl_get_file/fd, reduce the number of getxattr calls.
       via  7b78b08 libsmb: provide authinfo domain for encrypted session referrals
       via  8b95fb7 libsmb: provide authinfo domain for DFS referral auth
       via  e8bf65d libsmb: reuse connections derived from DFS referrals
       via  c2f8c93 samba3.py: Correctly initialize cache directory for passdb test
       via  091a3aa gencache: Request mutexes for gencache_notrans.tdb
       via  20d4a67 gencache: Convert gencache.tdb to tdb_wrap
       via  980bba3 gencache: Convert gencache_notrans to use tdb_wrap
       via  ad16a9a s3:gencache: don't use transaction non non-persistent gencache_notrans.tdb
       via  0810b53 s3:gencache: simply stabilize() a bit more: remove error from state
       via  12ea070 s3:gencache: fix logic in stabilization when deleting a record from stable cache
       via  f24a9e5 lib: Use tdb_parse_record in gencache_set
       via  837c146 s3: auth - tests: Add test for "force user" being a unix-only user, not in passdb.
       via  c789398 s3: auth: Add previously missing allocation fail check.
       via  a9e58a2 s3: auth: Plumb in the SamInfo3_handle_sids() utility function into passwd_to_SamInfo3().
       via  d8b2eee s3: auth: Convert samu_to_SamInfo3() to use the new utility function.
       via  31b2dad s3: auth: Add a utility function - SamInfo3_handle_sids() that factors out the code to handle "Unix Users" and "Unix Groups".
       via  a52c6cb nsswitch: fix soname of linux nss_*.so.2 modules
       via  5de1063 selftest: use shared/libnss_wrapper_winbind.so.2
       via  e9d45f6 wafsamba: add optional keep_underscore=True to SAMBA_LIBRARY()
       via  74ee2f7 dsdb: Add tokenGroupsGlobalAndUniversal, tokenGroups, tokenGroupsNoGCAcceptable
       via  77d8786 VERSION: Re-enable git snapshots...
      from  c88a4f4 VERSION: Disable git snapshots for the 4.2.0rc4 release.

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


- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 VERSION                                            |   2 +-
 WHATSNEW.txt                                       |  78 ++++-
 buildtools/wafadmin/Tools/ccroot.py                |  18 +-
 buildtools/wafadmin/Tools/gcc.py                   |   4 +
 buildtools/wafadmin/Tools/gxx.py                   |   4 +
 buildtools/wafsamba/samba3.py                      |  13 +-
 buildtools/wafsamba/samba_autoconf.py              |  21 +-
 buildtools/wafsamba/samba_bundled.py               |  16 +-
 buildtools/wafsamba/samba_conftests.py             |  82 +++++
 buildtools/wafsamba/samba_deps.py                  |   6 +-
 buildtools/wafsamba/samba_optimisation.py          | 250 +++++++++++---
 buildtools/wafsamba/samba_utils.py                 |   3 +-
 buildtools/wafsamba/wafsamba.py                    |  78 +++--
 buildtools/wafsamba/wscript                        |  47 +++
 lib/ldb-samba/pyldb.c                              |   2 +-
 lib/ldb/ABI/{ldb-1.1.16.sigs => ldb-1.1.19.sigs}   |   1 +
 lib/ldb/ABI/{ldb-1.1.16.sigs => ldb-1.1.20.sigs}   |   1 +
 ...ldb-util-1.1.10.sigs => pyldb-util-1.1.19.sigs} |   0
 ...ldb-util-1.1.10.sigs => pyldb-util-1.1.20.sigs} |   0
 lib/ldb/common/ldb.c                               |   5 +
 lib/ldb/common/ldb_match.c                         | 177 ++++++++--
 lib/ldb/common/ldb_msg.c                           |  38 ++-
 lib/ldb/include/ldb_module.h                       |  13 +
 lib/ldb/include/ldb_private.h                      |   6 +
 lib/ldb/pyldb.c                                    |  14 +-
 lib/ldb/wscript                                    |   2 +-
 lib/ntdb/pyntdb.c                                  |   2 +-
 lib/replace/wscript                                |  45 ---
 lib/tevent/pytevent.c                              |  12 +-
 nsswitch/wscript_build                             |  24 +-
 pidl/lib/Parse/Pidl/Samba4/Python.pm               |   4 +-
 python/samba/netcmd/user.py                        |  25 +-
 python/samba/samdb.py                              |  18 +-
 python/samba/tests/samba3.py                       |   1 +
 selftest/target/Samba.pm                           |   2 +-
 selftest/target/Samba3.pm                          |   4 +
 source3/auth/auth_util.c                           |   3 +-
 source3/auth/proto.h                               |   3 +-
 source3/auth/server_info.c                         | 156 +++++----
 source3/client/client.c                            |   1 +
 source3/lib/gencache.c                             | 178 ++++++----
 source3/lib/unix_msg/unix_msg.c                    |  19 +-
 source3/libsmb/cliconnect.c                        |  22 +-
 source3/libsmb/clidfs.c                            | 118 +++++--
 source3/modules/vfs_aio_fork.c                     |   5 +-
 source3/modules/vfs_ceph.c                         |  30 +-
 source3/modules/vfs_glusterfs.c                    | 365 +++++++++++++++++++--
 source3/modules/vfs_snapper.c                      | 238 +++++++++++++-
 source3/pam_smbpass/pam_smb_auth.c                 |  11 +-
 source3/passdb/py_passdb.c                         |   6 +-
 source3/printing/print_cups.c                      |   2 +-
 source3/rpc_server/netlogon/srv_netlog_nt.c        |  13 +-
 source3/script/tests/test_smbclient_auth.sh        |   1 +
 source3/smbd/files.c                               |   3 +-
 source3/smbd/open.c                                |  11 +-
 source3/smbd/smb2_close.c                          |  99 ++++--
 source3/smbd/smb2_server.c                         |  11 +-
 source3/utils/net_time.c                           |  21 +-
 source3/wscript_build                              |   7 -
 source4/dsdb/samdb/ldb_modules/operational.c       |  66 +++-
 source4/dsdb/tests/python/ldap.py                  |  40 +++
 source4/dsdb/tests/python/token_group.py           | 351 +++++++++++++++++++-
 source4/libcli/pysmb.c                             |   2 +-
 source4/librpc/rpc/pyrpc.c                         |   2 +-
 source4/scripting/bin/samba_upgradeprovision       |   2 +-
 source4/selftest/tests.py                          |   2 +-
 source4/torture/smb2/lease.c                       |  79 +++++
 67 files changed, 2366 insertions(+), 519 deletions(-)
 copy lib/ldb/ABI/{ldb-1.1.16.sigs => ldb-1.1.19.sigs} (99%)
 copy lib/ldb/ABI/{ldb-1.1.16.sigs => ldb-1.1.20.sigs} (99%)
 copy lib/ldb/ABI/{pyldb-util-1.1.10.sigs => pyldb-util-1.1.19.sigs} (100%)
 copy lib/ldb/ABI/{pyldb-util-1.1.10.sigs => pyldb-util-1.1.20.sigs} (100%)


Changeset truncated at 500 lines:

diff --git a/VERSION b/VERSION
index 7d26f52..6a16ad00 100644
--- a/VERSION
+++ b/VERSION
@@ -87,7 +87,7 @@ SAMBA_VERSION_PRE_RELEASE=
 # e.g. SAMBA_VERSION_RC_RELEASE=1                      #
 #  ->  "3.0.0rc1"                                      #
 ########################################################
-SAMBA_VERSION_RC_RELEASE=4
+SAMBA_VERSION_RC_RELEASE=5
 
 ########################################################
 # To mark SVN snapshots this should be set to 'yes'    #
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index dc47556..49c1cb7 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -1,7 +1,7 @@
 Release Announcements
 =====================
 
-This is the fourth release candidate of Samba 4.2.  This is *not*
+This is the fifth release candidate of Samba 4.2.  This is *not*
 intended for production environments and is designed for testing
 purposes only.  Please report any defects via the Samba bug reporting
 system at https://bugzilla.samba.org/.
@@ -338,6 +338,82 @@ smb.conf changes
    winbind expand groups                Changed default 0
 
 
+CHANGES SINCE 4.2.0rc4
+======================
+
+o   Michael Adam <obnox at samba.org>
+    * BUG 11032: Enable mutexes in gencache_notrans.tdb.
+    * BUG 11058: cli_connect_nb_send: Don't segfault on host == NULL.
+
+
+o   Jeremy Allison <jra at samba.org>
+    * BUG 10849: s3: lib, s3: modules: Fix compilation on Solaris.
+    * BUG 11044: Fix authentication using Kerberos (not AD).
+    * BUG 11077: CVE-2015-0240: s3: netlogon: Ensure we don't call talloc_free
+      on an uninitialized pointer.
+    * BUG 11094: s3: smbclient: Allinfo leaves the file handle open.
+    * BUG 11102: s3: smbd: leases - losen paranoia check. Stat opens can grant
+      leases.
+    * BUG 11104: s3: smbd: SMB2 close. If a file has delete on close, store the
+      return info before deleting.
+
+
+o   Ira Cooper <ira at samba.org>
+    * BUG 11069: vfs_glusterfs: Add comments to the pipe(2) code.
+
+
+o   Günther Deschner <gd at samba.org>
+    * BUG 11070: s3-vfs: Fix developer build of vfs_ceph module.
+
+
+o   David Disseldorp <ddiss at samba.org>
+    * BUG 10808: printing/cups: Pack requested-attributes with IPP_TAG_KEYWORD.
+    * BUG 11055: vfs_snapper: Correctly handles multi-byte DBus strings.
+    * BUG 11059: libsmb: Provide authinfo domain for encrypted session
+      referrals.
+
+
+o   Poornima G <pgurusid at redhat.com>
+    * BUG 11069: vfs_glusterfs: Implement AIO support.
+
+
+o   Volker Lendecke <vl at samba.org>
+    * BUG 11032: Enable mutexes in gencache_notrans.tdb.
+
+
+o   Stefan Metzmacher <metze at samba.org>
+    * BUG 9299: nsswitch: Fix soname of linux nss_*.so.2 modules.
+    * BUG 9702: s3:smb2_server: protect against integer wrap with "smb2 max
+      credits = 65535".
+    * BUG 9810: Make validate_ldb of String(Generalized-Time) accept
+      millisecond format ".000Z".
+    * BUG 10112: Use -R linker flag on Solaris, not -rpath.
+
+
+o   Marc Muehlfeld <mmuehlfeld at samba.org>
+    * BUG 10909: samba-tool: Create NIS enabled users and unixHomeDirectory
+      attribute.
+
+
+o   Garming Sam <garming at catalyst.net.nz>
+    * BUG 11022: Make Sharepoint search show user documents.
+
+
+o   Christof Schmitt <cs at samba.org>
+    * BUG 11032: Enable mutexes in gencache_notrans.tdb.
+
+
+o   Andreas Schneider <asn at samba.org>
+    * BUG 11058: utils: Fix 'net time' segfault.
+    * BUG 11066: s3-pam_smbpass: Fix memory leak in pam_sm_authenticate().
+    * BUG 11077: CVE-2015-0240: s3-netlogon: Make sure we do not deference a
+      NULL pointer.
+
+
+o   Raghavendra Talur <raghavendra.talur at gmail.com>
+    * BUG 11069: vfs/glusterfs: Change xattr key to match gluster key.
+
+
 CHANGES SINCE 4.2.0rc3
 ======================
 
diff --git a/buildtools/wafadmin/Tools/ccroot.py b/buildtools/wafadmin/Tools/ccroot.py
index 264bdc7..d59cf26 100644
--- a/buildtools/wafadmin/Tools/ccroot.py
+++ b/buildtools/wafadmin/Tools/ccroot.py
@@ -177,10 +177,14 @@ def get_target_name(self):
 
 	dir, name = os.path.split(self.target)
 
-	if self.env.DEST_BINFMT == 'pe' and getattr(self, 'vnum', None) and 'cshlib' in self.features:
-		# include the version in the dll file name,
-		# the import lib file name stays unversionned.
-		name = name + '-' + self.vnum.split('.')[0]
+	if 'cshlib' in self.features and getattr(self, 'vnum', None):
+		nums = self.vnum.split('.')
+		if self.env.DEST_BINFMT == 'pe':
+			# include the version in the dll file name,
+			# the import lib file name stays unversionned.
+			name = name + '-' + nums[0]
+		elif self.env.DEST_OS == 'openbsd':
+			pattern = '%s.%s.%s' % (pattern, nums[0], nums[1])
 
 	return os.path.join(dir, pattern % name)
 
@@ -598,14 +602,16 @@ def apply_vnum(self):
 	if not path: return
 
 	if self.env.DEST_OS == 'openbsd':
-		bld.install_as(path + os.sep + name2, node, env=self.env, chmod=self.link_task.chmod)
+		libname = self.link_task.outputs[0].name
+		bld.install_as('%s%s%s' % (path, os.sep, libname), node, env=self.env)
 	else:
 		bld.install_as(path + os.sep + name3, node, env=self.env)
 		bld.symlink_as(path + os.sep + name2, name3)
 		bld.symlink_as(path + os.sep + libname, name3)
 
 	# the following task is just to enable execution from the build dir :-/
-	self.create_task('vnum', node, [node.parent.find_or_declare(name2), node.parent.find_or_declare(name3)])
+	if self.env.DEST_OS != 'openbsd':
+		self.create_task('vnum', node, [node.parent.find_or_declare(name2), node.parent.find_or_declare(name3)])
 
 def exec_vnum_link(self):
 	for x in self.outputs:
diff --git a/buildtools/wafadmin/Tools/gcc.py b/buildtools/wafadmin/Tools/gcc.py
index 420b44f..a6be0b2 100644
--- a/buildtools/wafadmin/Tools/gcc.py
+++ b/buildtools/wafadmin/Tools/gcc.py
@@ -114,6 +114,10 @@ def gcc_modifier_aix(conf):
 	v['SHLIB_MARKER']        = ''
 
 @conftest
+def gcc_modifier_openbsd(conf):
+	conf.env['SONAME_ST'] = []
+
+ at conftest
 def gcc_modifier_platform(conf):
 	# * set configurations specific for a platform.
 	# * the destination platform is detected automatically by looking at the macros the compiler predefines,
diff --git a/buildtools/wafadmin/Tools/gxx.py b/buildtools/wafadmin/Tools/gxx.py
index 8f4a0bf..4984122 100644
--- a/buildtools/wafadmin/Tools/gxx.py
+++ b/buildtools/wafadmin/Tools/gxx.py
@@ -112,6 +112,10 @@ def gxx_modifier_aix(conf):
 	v['SHLIB_MARKER']        = ''
 
 @conftest
+def gxx_modifier_openbsd(conf):
+	conf.env['SONAME_ST'] = []
+
+ at conftest
 def gxx_modifier_platform(conf):
 	# * set configurations specific for a platform.
 	# * the destination platform is detected automatically by looking at the macros the compiler predefines,
diff --git a/buildtools/wafsamba/samba3.py b/buildtools/wafsamba/samba3.py
index 64cd8c7..ffe6784 100644
--- a/buildtools/wafsamba/samba3.py
+++ b/buildtools/wafsamba/samba3.py
@@ -6,16 +6,17 @@ from optparse import SUPPRESS_HELP
 from samba_utils import os_path_relpath, TO_LIST
 from samba_autoconf import library_flags
 
+
 def SAMBA3_ADD_OPTION(opt, option, help=(), dest=None, default=True,
                       with_name="with", without_name="without"):
     if default is None:
-        default_str="auto"
-    elif default == True:
-        default_str="yes"
-    elif default == False:
-        default_str="no"
+        default_str = "auto"
+    elif default is True:
+        default_str = "yes"
+    elif default is False:
+        default_str = "no"
     else:
-        default_str=str(default)
+        default_str = str(default)
 
     if help == ():
         help = ("Build with %s support (default=%s)" % (option, default_str))
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index f60ce9d..cb33630 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -646,6 +646,10 @@ def SAMBA_CONFIG_H(conf, path=None):
     if not IN_LAUNCH_DIR(conf):
         return
 
+    if conf.CHECK_CFLAGS(['-fstack-protector']) and conf.CHECK_LDFLAGS(['-fstack-protector']):
+        conf.ADD_CFLAGS('-fstack-protector')
+        conf.ADD_LDFLAGS('-fstack-protector')
+
     if Options.options.debug:
         conf.ADD_CFLAGS('-g', testflags=True)
 
@@ -671,6 +675,8 @@ def SAMBA_CONFIG_H(conf, path=None):
                         testflags=True)
         conf.ADD_CFLAGS('-Werror=declaration-after-statement -Wdeclaration-after-statement',
                         testflags=True)
+        conf.ADD_CFLAGS('-Werror=return-type -Wreturn-type',
+                        testflags=True)
 
         conf.ADD_CFLAGS('-Wformat=2 -Wno-format-y2k', testflags=True)
         # This check is because for ldb_search(), a NULL format string
@@ -697,6 +703,19 @@ int main(void) {
     if Options.options.pedantic:
         conf.ADD_CFLAGS('-W', testflags=True)
 
+
+    # Let people pass an additional ADDITIONAL_{CFLAGS,LDFLAGS}
+    # environment variables which are only used the for final build.
+    #
+    # The CFLAGS and LDFLAGS environment variables are also
+    # used for the configure checks which might impact their results.
+    conf.add_os_flags('ADDITIONAL_CFLAGS')
+    if conf.env.ADDITIONAL_CFLAGS and conf.CHECK_CFLAGS(conf.env['ADDITIONAL_CFLAGS']):
+        conf.env['EXTRA_CFLAGS'].extend(conf.env['ADDITIONAL_CFLAGS'])
+    conf.add_os_flags('ADDITIONAL_LDFLAGS')
+    if conf.env.ADDITIONAL_LDFLAGS and conf.CHECK_LDFLAGS(conf.env['ADDITIONAL_LDFLAGS']):
+        conf.env['EXTRA_LDFLAGS'].extend(conf.env['ADDITIONAL_LDFLAGS'])
+
     if path is None:
         conf.write_config_header('config.h', top=True)
     else:
@@ -775,7 +794,7 @@ def CURRENT_CFLAGS(bld, target, cflags, allow_warnings=True, hide_symbols=False)
         list = bld.env['PICKY_CFLAGS'];
         ret.extend(list)
     if hide_symbols and bld.env.HAVE_VISIBILITY_ATTR:
-        ret.append('-fvisibility=hidden')
+        ret.append(bld.env.VISIBILITY_CFLAGS)
     return ret
 
 
diff --git a/buildtools/wafsamba/samba_bundled.py b/buildtools/wafsamba/samba_bundled.py
index 45946d5..515590f 100644
--- a/buildtools/wafsamba/samba_bundled.py
+++ b/buildtools/wafsamba/samba_bundled.py
@@ -7,11 +7,25 @@ from samba_utils import *
 def PRIVATE_NAME(bld, name, private_extension, private_library):
     '''possibly rename a library to include a bundled extension'''
 
+    if not private_library:
+        return name
+
     # we now use the same private name for libraries as the public name.
     # see http://git.samba.org/?p=tridge/junkcode.git;a=tree;f=shlib for a
     # demonstration that this is the right thing to do
     # also see http://lists.samba.org/archive/samba-technical/2011-January/075816.html
-    return name
+    if private_extension:
+        return name
+
+    extension = bld.env.PRIVATE_EXTENSION
+
+    if extension and name.startswith('%s' % extension):
+        return name
+
+    if extension and name.endswith('%s' % extension):
+        return name
+
+    return "%s-%s" % (name, extension)
 
 
 def target_in_list(target, lst, default):
diff --git a/buildtools/wafsamba/samba_conftests.py b/buildtools/wafsamba/samba_conftests.py
index ec98ba0..1afc6c9 100644
--- a/buildtools/wafsamba/samba_conftests.py
+++ b/buildtools/wafsamba/samba_conftests.py
@@ -4,6 +4,7 @@
 import os, shutil, re
 import Build, Configure, Utils
 from Configure import conf
+import config_c
 from samba_utils import *
 
 
@@ -506,3 +507,84 @@ def CHECK_XSLTPROC_MANPAGES(conf):
     if not conf.CONFIG_SET('XSLTPROC_MANPAGES'):
         print "A local copy of the docbook.xsl wasn't found on your system" \
               " consider installing package like docbook-xsl"
+
+#
+# Determine the standard libpath for the used compiler,
+# so we can later use that to filter out these standard
+# library paths when some tools like cups-config or
+# python-config report standard lib paths with their
+# ldflags (-L...)
+#
+ at conf
+def CHECK_STANDARD_LIBPATH(conf):
+    # at least gcc and clang support this:
+    try:
+        cmd = conf.env.CC + ['-print-search-dirs']
+        out = Utils.cmd_output(cmd).split('\n')
+    except ValueError:
+        # option not supported by compiler - use a standard list of directories
+        dirlist = [ '/usr/lib', '/usr/lib64' ]
+    except:
+        raise Utils.WafError('Unexpected error running "%s"' % (cmd))
+    else:
+        dirlist = []
+        for line in out:
+            line = line.strip()
+            if line.startswith("libraries: ="):
+                dirliststr = line[len("libraries: ="):]
+                dirlist = [ os.path.normpath(x) for x in dirliststr.split(':') ]
+                break
+
+    conf.env.STANDARD_LIBPATH = dirlist
+
+
+waf_config_c_parse_flags = config_c.parse_flags;
+def samba_config_c_parse_flags(line1, uselib, env):
+    #
+    # We do a special treatment of the rpath components
+    # in the linkflags line, because currently the upstream
+    # parse_flags function is incomplete with respect to
+    # treatment of the rpath. The remainder of the linkflags
+    # line is later passed to the original funcion.
+    #
+    lst1 = shlex.split(line1)
+    lst2 = []
+    while lst1:
+        x = lst1.pop(0)
+
+        #
+        # NOTE on special treatment of -Wl,-R and -Wl,-rpath:
+        #
+        # It is important to not put a library provided RPATH
+        # into the LINKFLAGS but in the RPATH instead, since
+        # the provided LINKFLAGS get prepended to our own internal
+        # RPATH later, and hence can potentially lead to linking
+        # in too old versions of our internal libs.
+        #
+        # We do this filtering here on our own because of some
+        # bugs in the real parse_flags() function.
+        #
+        if x == '-Wl,-rpath' or x == '-Wl,-R':
+            linkflags.remove(x)
+            x = lst1.pop(0)
+            if x.startswith('-Wl,'):
+                rpath = x[4:]
+            else:
+                rpath = x
+        elif x.startswith('-Wl,-R,'):
+            rpath = x[7:]
+        elif x.startswith('-Wl,-R'):
+            rpath = x[6:]
+        elif x.startswith('-Wl,-rpath,'):
+            rpath = x[11:]
+        else:
+            lst2.append(x)
+            continue
+
+        env.append_value('RPATH_' + uselib, rpath)
+
+    line2 = ' '.join(lst2)
+    waf_config_c_parse_flags(line2, uselib, env)
+
+    return
+config_c.parse_flags = samba_config_c_parse_flags
diff --git a/buildtools/wafsamba/samba_deps.py b/buildtools/wafsamba/samba_deps.py
index c00744e..3be9956 100644
--- a/buildtools/wafsamba/samba_deps.py
+++ b/buildtools/wafsamba/samba_deps.py
@@ -1021,7 +1021,7 @@ def save_samba_deps(bld, tgt_list):
             denv.outenv[t.sname] = tdeps
 
     depsfile = os.path.join(bld.bdir, "sambadeps")
-    denv.store(depsfile)
+    denv.store_fast(depsfile)
 
 
 
@@ -1031,12 +1031,12 @@ def load_samba_deps(bld, tgt_list):
     denv = Environment.Environment()
     try:
         debug('deps: checking saved dependencies')
-        denv.load(depsfile)
+        denv.load_fast(depsfile)
         if (denv.version != savedeps_version or
             denv.savedeps_inputs != savedeps_inputs or
             denv.savedeps_outputs != savedeps_outputs):
             return False
-    except:
+    except Exception:
         return False
 
     # check if critical files have changed
diff --git a/buildtools/wafsamba/samba_optimisation.py b/buildtools/wafsamba/samba_optimisation.py
index f0f430d..5def580 100644
--- a/buildtools/wafsamba/samba_optimisation.py
+++ b/buildtools/wafsamba/samba_optimisation.py
@@ -6,8 +6,10 @@
 
 # overall this makes some build tasks quite a bit faster
 
-from TaskGen import feature, after
-import preproc, Task
+import os
+import Build, Utils, Node
+from TaskGen import feature, after, before
+import preproc
 
 @feature('cc', 'cxx')
 @after('apply_type_vars', 'apply_lib_vars', 'apply_core')
@@ -122,44 +124,208 @@ def hash_constraints(self):
     return sum
 Task.TaskBase.hash_constraints = hash_constraints
 
+def hash_env_vars(self, env, vars_lst):
+    idx = str(id(env)) + str(vars_lst)
+    try:
+        return self.cache_sig_vars[idx]
+    except KeyError:
+        pass
+
+    m = Utils.md5()
+    m.update(''.join([str(env[a]) for a in vars_lst]))
+
+    ret = self.cache_sig_vars[idx] = m.digest()
+    return ret
+Build.BuildContext.hash_env_vars = hash_env_vars
+
+
+def store_fast(self, filename):
+    file = open(filename, 'wb')
+    data = self.get_merged_dict()
+    try:
+        Build.cPickle.dump(data, file, -1)
+    finally:
+        file.close()
+Environment.Environment.store_fast = store_fast
+
+def load_fast(self, filename):
+    file = open(filename, 'rb')
+    try:
+        data = Build.cPickle.load(file)
+    finally:
+        file.close()
+    self.table.update(data)
+Environment.Environment.load_fast = load_fast
+
+def is_this_a_static_lib(self, name):
+    try:
+        cache = self.cache_is_this_a_static_lib
+    except AttributeError:
+        cache = self.cache_is_this_a_static_lib = {}
+    try:
+        return cache[name]
+    except KeyError:
+        ret = cache[name] = 'cstaticlib' in self.bld.name_to_obj(name, self.env).features
+        return ret
+TaskGen.task_gen.is_this_a_static_lib = is_this_a_static_lib
+
+def shared_ancestors(self):
+    try:
+        cache = self.cache_is_this_a_static_lib
+    except AttributeError:
+        cache = self.cache_is_this_a_static_lib = {}
+    try:
+        return cache[id(self)]
+    except KeyError:
+
+        ret = []
+        if 'cshlib' in self.features: # or 'cprogram' in self.features:
+            if getattr(self, 'uselib_local', None):
+                lst = self.to_list(self.uselib_local)
+                ret = [x for x in lst if not self.is_this_a_static_lib(x)]
+        cache[id(self)] = ret
+        return ret


-- 
Samba Shared Repository


More information about the samba-cvs mailing list