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

Karolin Seeger kseeger at samba.org
Wed Jun 1 13:02:04 UTC 2016


The branch, v4-3-test has been updated
       via  2e81a93 s3:client:smbspool_krb5_wrapper: fix the non clearenv build.
       via  14bd198 Provide fallback code for non-portable clearenv(3)
      from  a304725 s3:selftest add a test for rpcclient --pw-nt-hash option

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


- Log -----------------------------------------------------------------
commit 2e81a93f5a58a0f88085a18babf566315afcf2f0
Author: Günther Deschner <gd at samba.org>
Date:   Fri Apr 29 13:28:42 2016 +0200

    s3:client:smbspool_krb5_wrapper: fix the non clearenv build.
    
    Guenther
    
    Signed-off-by: Guenther Deschner <gd at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    Autobuild-User(master): Volker Lendecke <vl at samba.org>
    Autobuild-Date(master): Fri Apr 29 19:52:23 CEST 2016 on sn-devel-144
    
    (cherry picked from commit e0d8c6b6b428819206fb6e96c47e952845af0874)
    
    Autobuild-User(v4-3-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-3-test): Wed Jun  1 15:01:03 CEST 2016 on sn-devel-104

commit 14bd19899a952de1d5dde732a5a97e9f9d985a14
Author: Jérémie Courrèges-Anglas <jca at wxcvbn.org>
Date:   Wed Apr 27 18:01:51 2016 +0200

    Provide fallback code for non-portable clearenv(3)
    
    clearenv(3) is a GNU extension that was rejected twice by POSIX,
    without an easy, portable alternative.
    
    As the dovecot project notes,
    """
    environ = NULL crashes on OSX - and OpenBSD < 6.0
    *environ = NULL doesn't work on FreeBSD 7.0
    environ = emptyenv doesn't work on Haiku OS
    environ = calloc should work everywhere
    """
    (source: http://hg.dovecot.org/dovecot-2.0/file/48f90e7e92dc/src/lib/env-util.c)
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11864
    Signed-off-by: Jérémie Courrèges-Anglas <jca at wxcvbn.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Fri Apr 29 00:12:02 CEST 2016 on sn-devel-144
    
    (cherry picked from commit f198abcbb3f6e8b26c697d3ded2caa1076ae018b)

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

Summary of changes:
 source3/client/smbspool_krb5_wrapper.c | 10 ++++++++++
 source3/wscript                        |  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/source3/client/smbspool_krb5_wrapper.c b/source3/client/smbspool_krb5_wrapper.c
index e19fd92..d26a7a6 100644
--- a/source3/client/smbspool_krb5_wrapper.c
+++ b/source3/client/smbspool_krb5_wrapper.c
@@ -24,12 +24,15 @@
 #include "system/passwd.h"
 
 #include <errno.h>
+#include <stdlib.h>
 #include <string.h>
 
 #include <cups/backend.h>
 
 #include "dynconfig/dynconfig.h"
 
+#undef calloc
+
 enum cups_smb_dbglvl_e {
 	CUPS_SMB_LOG_DEBUG = 0,
 	CUPS_SMB_LOG_ERROR,
@@ -195,7 +198,14 @@ int main(int argc, char *argv[])
 	 * Make sure we do not have LD_PRELOAD or other security relevant
 	 * environment variables set.
 	 */
+#ifdef HAVE_CLEARENV
 	clearenv();
+#else
+	{
+		extern char **environ;
+		environ = calloc(1, sizeof(*environ));
+	}
+#endif
 
 	CUPS_SMB_DEBUG("Setting KRB5CCNAME to '%s'", gen_cc);
 	setenv("KRB5CCNAME", gen_cc, 1);
diff --git a/source3/wscript b/source3/wscript
index e201710..beb3dab 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -92,7 +92,7 @@ def configure(conf):
     conf.CHECK_FUNCS('getpwnam', headers='sys/types.h pwd.h')
     conf.CHECK_FUNCS('fdopendir')
     conf.CHECK_FUNCS('fstatat')
-    conf.CHECK_FUNCS('getpwent_r setenv strcasecmp fcvt fcvtl')
+    conf.CHECK_FUNCS('getpwent_r setenv clearenv strcasecmp fcvt fcvtl')
     conf.CHECK_FUNCS('syslog vsyslog timegm setlocale')
     conf.CHECK_FUNCS_IN('nanosleep', 'rt')
     conf.CHECK_FUNCS('lutimes futimes utimensat futimens')


-- 
Samba Shared Repository



More information about the samba-cvs mailing list