From fb55f94a595bda89ba521319cde1cd65609617d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Jacke?= Date: Fri, 14 Sep 2012 20:41:08 +0200 Subject: [PATCH 01/39] wafbuild: check for dn_expand also in libinet see bug #7472 --- source3/wscript | 1 + 1 file changed, 1 insertion(+) diff --git a/source3/wscript b/source3/wscript index 76d0520..3dba4e9 100644 --- a/source3/wscript +++ b/source3/wscript @@ -97,6 +97,7 @@ def configure(conf): #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') conf.CHECK_DECLS('fdatasync', reverse=True) conf.CHECK_DECLS('readahead', reverse=True, headers='fcntl.h') -- 1.7.11.7 From a93dfd29711a90dd571b18e110cc0f92191ff144 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Jacke?= Date: Fri, 14 Sep 2012 20:32:15 +0200 Subject: [PATCH 02/39] autoconf: check for dn_expand also in libinet see bug #7472 --- source3/configure.in | 1 + 1 file changed, 1 insertion(+) diff --git a/source3/configure.in b/source3/configure.in index 16d89f4..de62af4 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -1219,6 +1219,7 @@ fi AC_CHECK_LIB(resolv, dn_expand) AC_CHECK_LIB(resolv, _dn_expand) AC_CHECK_LIB(resolv, __dn_expand) +AC_CHECK_LIB(inet, dn_expand) # # Check for the functions putprpwnam, set_auth_parameters, -- 1.7.11.7 From 6c051028b5322b6e5f8f3b39030ad1ecb8d82b4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Jacke?= Date: Fri, 14 Sep 2012 20:46:45 +0200 Subject: [PATCH 03/39] quota: also log which fs type we found MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Autobuild-User(master): Björn Jacke Autobuild-Date(master): Sat Sep 15 02:18:16 CEST 2012 on sn-devel-104 --- source3/lib/sysquotas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/lib/sysquotas.c b/source3/lib/sysquotas.c index 7cc9b96..2ef1d1b 100644 --- a/source3/lib/sysquotas.c +++ b/source3/lib/sysquotas.c @@ -408,7 +408,7 @@ int sys_get_quota(const char *path, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DI } errno = 0; - DEBUG(10,("sys_get_quota() uid(%u, %u)\n", (unsigned)getuid(), (unsigned)geteuid())); + DEBUG(10,("sys_get_quota() uid(%u, %u), fs(%s)\n", (unsigned)getuid(), (unsigned)geteuid(), fs)); for (i=0;(fs && sys_quota_backends[i].name && sys_quota_backends[i].get_quota);i++) { if (strcmp(fs,sys_quota_backends[i].name)==0) { -- 1.7.11.7 From 7841720e8024b3881994a93034b657667eef254b Mon Sep 17 00:00:00 2001 From: Ira Cooper Date: Thu, 20 Sep 2012 19:38:12 +0000 Subject: [PATCH 04/39] waf: Make samba "ok" with directories for install being symlinks stat -> lstat conversion. This allows people for whom $PREFIX/var is a symlink to complete make install. Autobuild-User(master): Ira Cooper Autobuild-Date(master): Thu Sep 20 23:26:26 CEST 2012 on sn-devel-104 --- buildtools/wafadmin/Utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildtools/wafadmin/Utils.py b/buildtools/wafadmin/Utils.py index 41dad57..91ded93 100644 --- a/buildtools/wafadmin/Utils.py +++ b/buildtools/wafadmin/Utils.py @@ -15,7 +15,7 @@ Utilities, the stable ones are the following: import stat def h_file(filename): - st = os.stat(filename) + st = os.lstat(filename) if stat.S_ISDIR(st[stat.ST_MODE]): raise IOError('not a file') m = Utils.md5() m.update(str(st.st_mtime)) @@ -419,7 +419,7 @@ def pprint(col, str, label='', sep='\n'): def check_dir(dir): """If a folder doesn't exists, create it.""" try: - os.stat(dir) + os.lstat(dir) except OSError: try: os.makedirs(dir) -- 1.7.11.7 From 86d3e29aee6fc278fd1b29ebd945c1d5a8e65139 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 21 Sep 2012 21:57:22 -0700 Subject: [PATCH 05/39] build: Try not build with LDAP if we do not have ldap.h --- source3/wscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/wscript b/source3/wscript index 3dba4e9..7a4ffe0 100644 --- a/source3/wscript +++ b/source3/wscript @@ -541,7 +541,7 @@ msg.msg_acctrightslen = sizeof(fd); conf.DEFINE('LDAP_SET_REBIND_PROC_ARGS', '2') # last but not least, if ldap_init() exists, we want to use ldap - if conf.CONFIG_SET('HAVE_LDAP_INIT'): + if conf.CONFIG_SET('HAVE_LDAP_INIT') and conf.CONFIG_SET('HAVE_LDAP_H'): conf.DEFINE('HAVE_LDAP', '1') conf.DEFINE('LDAP_DEPRECATED', '1') conf.env['HAVE_LDAP'] = '1' -- 1.7.11.7 From b716d456faa5bf77103b91e72d55266329cb2a1c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 21 Sep 2012 22:27:24 -0700 Subject: [PATCH 06/39] build: Fix enabled handling for HAVE_LDAP, we need to use bld.CONFIG_SET Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Sat Sep 22 09:09:17 CEST 2012 on sn-devel-104 --- source3/passdb/wscript_build | 2 +- source3/winbindd/wscript_build | 12 ++++++------ source3/wscript_build | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/source3/passdb/wscript_build b/source3/passdb/wscript_build index d26afc2..03a0df4 100644 --- a/source3/passdb/wscript_build +++ b/source3/passdb/wscript_build @@ -19,7 +19,7 @@ bld.SAMBA3_MODULE('pdb_ldap', source=PDB_LDAP_SRC, init_function='', internal_module=bld.SAMBA3_IS_STATIC_MODULE('pdb_ldap'), - enabled=bld.SAMBA3_IS_ENABLED_MODULE('pdb_ldap') and bld.env.HAVE_LDAP) + enabled=bld.SAMBA3_IS_ENABLED_MODULE('pdb_ldap') and bld.CONFIG_SET('HAVE_LDAP')) bld.SAMBA3_MODULE('pdb_smbpasswd', subsystem='pdb', diff --git a/source3/winbindd/wscript_build b/source3/winbindd/wscript_build index 302b9ee..0d826f0 100644 --- a/source3/winbindd/wscript_build +++ b/source3/winbindd/wscript_build @@ -32,7 +32,7 @@ bld.SAMBA3_SUBSYSTEM('IDMAP_AD', source=IDMAP_AD_SRC, deps='ads nss_info', vars=locals(), - enabled=bld.env.HAVE_LDAP) + enabled=bld.CONFIG_SET("HAVE_LDAP")) bld.SAMBA3_MODULE('idmap_ad', subsystem='idmap', @@ -41,7 +41,7 @@ bld.SAMBA3_MODULE('idmap_ad', deps='IDMAP_AD', init_function='', internal_module=bld.SAMBA3_IS_STATIC_MODULE('idmap_ad'), - enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_ad') and bld.env.HAVE_LDAP) + enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_ad') and bld.CONFIG_SET("HAVE_LDAP")) bld.SAMBA3_MODULE('idmap_rid', subsystem='idmap', @@ -65,7 +65,7 @@ bld.SAMBA3_MODULE('idmap_ldap', deps='smbldap smbldaphelper pdb', init_function='', internal_module=bld.SAMBA3_IS_STATIC_MODULE('idmap_ldap'), - enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_ldap') and bld.env.HAVE_LDAP) + enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_ldap') and bld.CONFIG_SET("HAVE_LDAP")) bld.SAMBA3_MODULE('idmap_nss', subsystem='idmap', @@ -143,7 +143,7 @@ bld.SAMBA3_MODULE('nss_info_rfc2307', allow_undefined_symbols=True, init_function='', internal_module=bld.SAMBA3_IS_STATIC_MODULE('idmap_ad'), - enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_ad') and bld.env.HAVE_LDAP) + enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_ad') and bld.CONFIG_SET("HAVE_LDAP")) bld.SAMBA3_MODULE('nss_info_sfu20', subsystem='nss_info', @@ -152,7 +152,7 @@ bld.SAMBA3_MODULE('nss_info_sfu20', allow_undefined_symbols=True, init_function='', internal_module=bld.SAMBA3_IS_STATIC_MODULE('idmap_ad'), - enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_ad') and bld.env.HAVE_LDAP) + enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_ad') and bld.CONFIG_SET("HAVE_LDAP")) bld.SAMBA3_MODULE('nss_info_sfu', subsystem='nss_info', @@ -161,4 +161,4 @@ bld.SAMBA3_MODULE('nss_info_sfu', allow_undefined_symbols=True, init_function='', internal_module=bld.SAMBA3_IS_STATIC_MODULE('idmap_ad'), - enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_ad') and bld.env.HAVE_LDAP) + enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_ad') and bld.CONFIG_SET("HAVE_LDAP")) diff --git a/source3/wscript_build b/source3/wscript_build index 0db13b0..4b9c3ec 100755 --- a/source3/wscript_build +++ b/source3/wscript_build @@ -742,7 +742,7 @@ bld.SAMBA3_LIBRARY('smbldaphelper', source='passdb/pdb_ldap_schema.c passdb/pdb_ldap_util.c', deps='smbldap secrets3', allow_undefined_symbols=True, - enabled=bld.env.HAVE_LDAP, + enabled=bld.CONFIG_SET('HAVE_LDAP'), private_library=True) bld.SAMBA3_SUBSYSTEM('SERVER_MUTEX', @@ -892,7 +892,7 @@ bld.SAMBA3_LIBRARY('smbldap', source=SMBLDAP_SRC, deps='ldap lber samba-util param', vars=locals(), - enabled=bld.env.HAVE_LDAP, + enabled=bld.CONFIG_SET("HAVE_LDAP"), private_library=False, abi_directory='lib/ABI', abi_match='smbldap_*', -- 1.7.11.7 From 4b7c953c4570d4e0918154600d8197191a762620 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 23 Sep 2012 13:57:44 +1000 Subject: [PATCH 07/39] build: Remove unused IRIX and IRIX6 defines --- source3/configure.in | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/source3/configure.in b/source3/configure.in index de62af4..39c28d0 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -1390,12 +1390,7 @@ DSO_EXPORTS="" AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block]) AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly]) ;; - *irix*) AC_DEFINE(IRIX,1,[Whether the host os is irix]) - case "$host_os" in - *irix6*) AC_DEFINE(IRIX6,1,[Whether the host os is irix6]) - ;; - esac - BLDSHARED="true" + *irix*) BLDSHARED="true" LDSHFLAGS="-Wl,-set_version,sgi1.0 -shared" SONAMEFLAG="-Wl,-soname," if test "${GCC}" = "yes"; then -- 1.7.11.7 From 6f7eeb910b7d2b9556e5ef22556a55a104996138 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 23 Sep 2012 14:25:00 +1000 Subject: [PATCH 08/39] lib/util: Remove unbuilt file util_getent.c and BROKEN_GETGRNAM Removing this unbuilt file allows removing BROKEN_GETGRNAM which was only ever defined per-OS, not based on an actual test. Andrew Bartlett --- lib/util/util_getent.c | 283 ------------------------------------------------- source3/configure.in | 5 - 2 files changed, 288 deletions(-) delete mode 100644 lib/util/util_getent.c diff --git a/lib/util/util_getent.c b/lib/util/util_getent.c deleted file mode 100644 index b9b2658..0000000 --- a/lib/util/util_getent.c +++ /dev/null @@ -1,283 +0,0 @@ -/* - Unix SMB/CIFS implementation. - Samba utility functions - Copyright (C) Simo Sorce 2001 - Copyright (C) Jeremy Allison 2001 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "includes.h" - - -/**************************************************************** - Returns a single linked list of group entries. - Use grent_free() to free it after use. -****************************************************************/ - -struct sys_grent * getgrent_list(void) -{ - struct sys_grent *glist; - struct sys_grent *gent; - struct group *grp; - - gent = malloc_p(struct sys_grent); - if (gent == NULL) { - DEBUG (0, ("Out of memory in getgrent_list!\n")); - return NULL; - } - memset(gent, '\0', sizeof(struct sys_grent)); - glist = gent; - - setgrent(); - grp = getgrent(); - if (grp == NULL) { - endgrent(); - SAFE_FREE(glist); - return NULL; - } - - while (grp != NULL) { - int i,num; - - if (grp->gr_name) { - if ((gent->gr_name = strdup(grp->gr_name)) == NULL) - goto err; - } - if (grp->gr_passwd) { - if ((gent->gr_passwd = strdup(grp->gr_passwd)) == NULL) - goto err; - } - gent->gr_gid = grp->gr_gid; - - /* number of strings in gr_mem */ - for (num = 0; grp->gr_mem[num]; num++) - ; - - /* alloc space for gr_mem string pointers */ - if ((gent->gr_mem = malloc_array_p(char *, num+1)) == NULL) - goto err; - - memset(gent->gr_mem, '\0', (num+1) * sizeof(char *)); - - for (i=0; i < num; i++) { - if ((gent->gr_mem[i] = strdup(grp->gr_mem[i])) == NULL) - goto err; - } - gent->gr_mem[num] = NULL; - - grp = getgrent(); - if (grp) { - gent->next = malloc_p(struct sys_grent); - if (gent->next == NULL) - goto err; - gent = gent->next; - memset(gent, '\0', sizeof(struct sys_grent)); - } - } - - endgrent(); - return glist; - - err: - - endgrent(); - DEBUG(0, ("Out of memory in getgrent_list!\n")); - grent_free(glist); - return NULL; -} - -/**************************************************************** - Free the single linked list of group entries made by - getgrent_list() -****************************************************************/ - -void grent_free (struct sys_grent *glist) -{ - while (glist) { - struct sys_grent *prev; - - SAFE_FREE(glist->gr_name); - SAFE_FREE(glist->gr_passwd); - if (glist->gr_mem) { - int i; - for (i = 0; glist->gr_mem[i]; i++) - SAFE_FREE(glist->gr_mem[i]); - SAFE_FREE(glist->gr_mem); - } - prev = glist; - glist = glist->next; - SAFE_FREE(prev); - } -} - -/**************************************************************** - Returns a single linked list of passwd entries. - Use pwent_free() to free it after use. -****************************************************************/ - -struct sys_pwent * getpwent_list(void) -{ - struct sys_pwent *plist; - struct sys_pwent *pent; - struct passwd *pwd; - - pent = malloc_p(struct sys_pwent); - if (pent == NULL) { - DEBUG (0, ("Out of memory in getpwent_list!\n")); - return NULL; - } - plist = pent; - - setpwent(); - pwd = getpwent(); - while (pwd != NULL) { - memset(pent, '\0', sizeof(struct sys_pwent)); - if (pwd->pw_name) { - if ((pent->pw_name = strdup(pwd->pw_name)) == NULL) - goto err; - } - if (pwd->pw_passwd) { - if ((pent->pw_passwd = strdup(pwd->pw_passwd)) == NULL) - goto err; - } - pent->pw_uid = pwd->pw_uid; - pent->pw_gid = pwd->pw_gid; - if (pwd->pw_gecos) { - if ((pent->pw_name = strdup(pwd->pw_gecos)) == NULL) - goto err; - } - if (pwd->pw_dir) { - if ((pent->pw_name = strdup(pwd->pw_dir)) == NULL) - goto err; - } - if (pwd->pw_shell) { - if ((pent->pw_name = strdup(pwd->pw_shell)) == NULL) - goto err; - } - - pwd = getpwent(); - if (pwd) { - pent->next = malloc_p(struct sys_pwent); - if (pent->next == NULL) - goto err; - pent = pent->next; - } - } - - endpwent(); - return plist; - - err: - - endpwent(); - DEBUG(0, ("Out of memory in getpwent_list!\n")); - pwent_free(plist); - return NULL; -} - -/**************************************************************** - Free the single linked list of passwd entries made by - getpwent_list() -****************************************************************/ - -void pwent_free (struct sys_pwent *plist) -{ - while (plist) { - struct sys_pwent *prev; - - SAFE_FREE(plist->pw_name); - SAFE_FREE(plist->pw_passwd); - SAFE_FREE(plist->pw_gecos); - SAFE_FREE(plist->pw_dir); - SAFE_FREE(plist->pw_shell); - - prev = plist; - plist = plist->next; - SAFE_FREE(prev); - } -} - -/**************************************************************** - Add the individual group users onto the list. -****************************************************************/ - -static struct sys_userlist *add_members_to_userlist(struct sys_userlist *list_head, const struct group *grp) -{ - size_t num_users, i; - - /* Count the number of users. */ - for (num_users = 0; grp->gr_mem[num_users]; num_users++) - ; - - for (i = 0; i < num_users; i++) { - struct sys_userlist *entry = malloc_p(struct sys_userlist); - if (entry == NULL) { - free_userlist(list_head); - return NULL; - } - entry->unix_name = (char *)strdup(grp->gr_mem[i]); - if (entry->unix_name == NULL) { - SAFE_FREE(entry); - free_userlist(list_head); - return NULL; - } - DLIST_ADD(list_head, entry); - } - return list_head; -} - -/**************************************************************** - Get the list of UNIX users in a group. - We have to enumerate the /etc/group file as some UNIX getgrnam() - calls won't do that for us (notably Tru64 UNIX). -****************************************************************/ - -struct sys_userlist *get_users_in_group(const char *gname) -{ - struct sys_userlist *list_head = NULL; - struct group *gptr; - -#if !defined(BROKEN_GETGRNAM) - if ((gptr = (struct group *)getgrnam(gname)) == NULL) - return NULL; - return add_members_to_userlist(list_head, gptr); -#else - /* BROKEN_GETGRNAM - True64 */ - setgrent(); - while((gptr = getgrent()) != NULL) { - if (strequal(gname, gptr->gr_name)) { - list_head = add_members_to_userlist(list_head, gptr); - if (list_head == NULL) - return NULL; - } - } - endgrent(); - return list_head; -#endif -} - -/**************************************************************** - Free list allocated above. -****************************************************************/ - -void free_userlist(struct sys_userlist *list_head) -{ - while (list_head) { - struct sys_userlist *old_head = list_head; - DLIST_REMOVE(list_head, list_head); - SAFE_FREE(old_head->unix_name); - SAFE_FREE(old_head); - } -} diff --git a/source3/configure.in b/source3/configure.in index 39c28d0..da92c7f 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -1363,7 +1363,6 @@ DSO_EXPORTS="" SONAMEFLAG="-Wl,-h," fi AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block]) - AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly]) ;; *sunos*) AC_DEFINE(SUNOS4,1,[Whether the host os is sunos4]) BLDSHARED="true" @@ -1371,7 +1370,6 @@ DSO_EXPORTS="" SONAMEFLAG="-Wl,-h," PICFLAG="-KPIC" # Is this correct for SunOS AC_DEFINE(STAT_ST_BLOCKSIZE,512) - AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly]) ;; *netbsd* | *freebsd* | *dragonfly* ) BLDSHARED="true" @@ -1380,7 +1378,6 @@ DSO_EXPORTS="" SONAMEFLAG="-Wl,-soname," PICFLAG="-fPIC -DPIC" AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block]) - AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly]) ;; *openbsd*) BLDSHARED="true" LDSHFLAGS="-shared" @@ -1388,7 +1385,6 @@ DSO_EXPORTS="" SONAMEFLAG="-Wl,-soname," PICFLAG="-fPIC" AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block]) - AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly]) ;; *irix*) BLDSHARED="true" LDSHFLAGS="-Wl,-set_version,sgi1.0 -shared" @@ -1469,7 +1465,6 @@ DSO_EXPORTS="" PICFLAG="-fPIC" fi AC_DEFINE(STAT_ST_BLOCKSIZE,512) - AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly]) for flags in "-expect_unresolved '*'" "-Wl,-expect_unresolved,'*'" ; do saved_ldflags="$LDFLAGS" AC_MSG_CHECKING([if $flags works]) -- 1.7.11.7 From dc3d6949b45fd7f88a2736fddaa381406b6bede6 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 23 Sep 2012 14:30:10 +1000 Subject: [PATCH 09/39] build: Rework waf STAT_ST_BLOCKSIZE to match autoconf, with 512 as the default The autoconf build simply has 512 as the default, without a warning. Rather than enumerate every OS ever made, just handle the known exceptions. Andrew Bartlett --- source3/wscript | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/source3/wscript b/source3/wscript index 7a4ffe0..6fe2fc9 100644 --- a/source3/wscript +++ b/source3/wscript @@ -287,22 +287,29 @@ utimensat vsyslog _write __write __xstat conf.DEFINE('STAT_ST_BLOCKSIZE', '512') elif (host_os.rfind('darwin') > -1): conf.DEFINE('DARWINOS', 1) - conf.DEFINE('STAT_ST_BLOCKSIZE', '512') conf.ADD_CFLAGS('-fno-common') + conf.DEFINE('STAT_ST_BLOCKSIZE', '512') elif (host_os.rfind('freebsd') > -1): if conf.CHECK_HEADERS('sunacl.h'): conf.DEFINE('HAVE_FREEBSD_SUNACL_H', '1') conf.CHECK_FUNCS_IN('acl', 'sunacl') conf.DEFINE('STAT_ST_BLOCKSIZE', '512') - elif (host_os.rfind('netbsd') > -1): - conf.DEFINE('STAT_ST_BLOCKSIZE', '512') - elif (host_os.rfind('openbsd') > -1): + elif (host_os.rfind('irix') > -1): + conf.DEFINE('IRIX', 1) conf.DEFINE('STAT_ST_BLOCKSIZE', '512') - elif (host_os.rfind('sunos') > -1): + elif (host_os.rfind('aix') > -1): + conf.DEFINE('AIX', 1) + conf.DEFINE('STAT_ST_BLOCKSIZE', 'DEV_BSIZE') + elif (host_os.rfind('hpux') > -1): + conf.DEFINE('HPUX', 1) + conf.DEFINE('STAT_ST_BLOCKSIZE', '8192') + elif (host_os.rfind('osf') > -1): + conf.DEFINE('OSF1', 1) conf.DEFINE('STAT_ST_BLOCKSIZE', '512') + # FIXME: Add more checks here. else: - Logs.warn("Unknown host_os '%s', please report this to samba-technical@samba.org" % host_os) + conf.DEFINE('STAT_ST_BLOCKSIZE', '512') if Options.options.with_acl_support: if (host_os.rfind('sysv5') > -1) and conf.CHECK_FUNCS_IN('sec', 'facl', checklibc=True): -- 1.7.11.7 From cc3c57b31e966ac4f5c92faf79305d04a998b0a3 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 23 Sep 2012 14:30:37 +1000 Subject: [PATCH 10/39] build: Make waf configure match autoconf for HPUX ACLs --- source3/wscript | 1 + 1 file changed, 1 insertion(+) diff --git a/source3/wscript b/source3/wscript index 6fe2fc9..46ad87b 100644 --- a/source3/wscript +++ b/source3/wscript @@ -323,6 +323,7 @@ utimensat vsyslog _write __write __xstat elif (host_os.rfind('hpux') > -1): Logs.info('Using HPUX ACLs') conf.DEFINE('HAVE_HPUX_ACLS',1) + conf.DEFINE('POSIX_ACL_NEEDS_MASK',1) default_static_modules.extend(TO_LIST('vfs_hpuxacl')) elif (host_os.rfind('irix') > -1): Logs.info('Using IRIX ACLs') -- 1.7.11.7 From f89f649bf810be59d9fccb939dfb3c064c429cca Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 23 Sep 2012 14:35:58 +1000 Subject: [PATCH 11/39] lib/replace: Remove unused nap and therefore the SCO define In any case, the Samba Team stopped supporting SCO systems a long time ago. Andrew Bartlett --- lib/replace/replace.c | 10 ---------- source3/configure.in | 3 +-- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/lib/replace/replace.c b/lib/replace/replace.c index 53d4df8..e461471 100644 --- a/lib/replace/replace.c +++ b/lib/replace/replace.c @@ -214,16 +214,6 @@ int rep_initgroups(char *name, gid_t id) #endif /* HAVE_INITGROUPS */ -#if (defined(SecureWare) && defined(SCO)) -/* This is needed due to needing the nap() function but we don't want - to include the Xenix libraries since that will break other things... - BTW: system call # 0x0c28 is the same as calling nap() */ -long nap(long milliseconds) { - return syscall(0x0c28, milliseconds); - } -#endif - - #ifndef HAVE_MEMMOVE /******************************************************************* safely copies memory, ensuring no overlap problems. diff --git a/source3/configure.in b/source3/configure.in index da92c7f..bbd584d 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -1477,8 +1477,7 @@ DSO_EXPORTS="" test x"$LDSHFLAGS_Z_NODEFS" != x && break done ;; - *sco*) AC_DEFINE(SCO,1,[Whether the host os is sco unix]) - AC_DEFINE(STAT_ST_BLOCKSIZE,512) + *sco*) AC_DEFINE(STAT_ST_BLOCKSIZE,512) ;; *unixware*) AC_DEFINE(UNIXWARE,1,[Whether the host os is unixware]) BLDSHARED="true" -- 1.7.11.7 From 72d99870c311e39e76c50eb96d0051e20e1d12f9 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 23 Sep 2012 14:37:24 +1000 Subject: [PATCH 12/39] build: Remove unused define UNIXWARE Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Sun Sep 23 08:33:02 CEST 2012 on sn-devel-104 --- source3/configure.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source3/configure.in b/source3/configure.in index bbd584d..d3d0257 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -1479,8 +1479,7 @@ DSO_EXPORTS="" ;; *sco*) AC_DEFINE(STAT_ST_BLOCKSIZE,512) ;; - *unixware*) AC_DEFINE(UNIXWARE,1,[Whether the host os is unixware]) - BLDSHARED="true" + *unixware*) BLDSHARED="true" LDSHFLAGS="-shared" SONAMEFLAG="-Wl,-soname," PICFLAG="-KPIC" -- 1.7.11.7 From ee918b6390dea4655796793d9a40b03ef0d21492 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 24 Sep 2012 07:06:53 +1000 Subject: [PATCH 13/39] build: Add missing dep on tdb_compat --- source4/ntvfs/posix/wscript_build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source4/ntvfs/posix/wscript_build b/source4/ntvfs/posix/wscript_build index ee0ef24..f6e1ef6 100644 --- a/source4/ntvfs/posix/wscript_build +++ b/source4/ntvfs/posix/wscript_build @@ -54,7 +54,7 @@ bld.SAMBA_LIBRARY('posix_eadb', bld.SAMBA_PYTHON('python_posix_eadb', source='python/pyposix_eadb.c', - deps='pyparam_util posix_eadb', + deps='pyparam_util posix_eadb tdb_compat', realname='samba/posix_eadb.so' ) -- 1.7.11.7 From 2270e4ff81e4f9a8be1fc802309a6a063f8bf240 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 24 Sep 2012 18:02:01 +1000 Subject: [PATCH 14/39] build: Fix detection of quotas on macos This is a weird one. While visually OK, the . in sys/types.h was not made up of the typical ASCII character, so of course did not find types.h! Andrew Bartlett Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Mon Sep 24 12:24:45 CEST 2012 on sn-devel-104 --- source3/configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/configure.in b/source3/configure.in index d3d0257..f1c801d 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -4635,7 +4635,7 @@ if test x"$samba_cv_HAVE_QUOTACTL_4B" = x"yes"; then samba_cv_sysquotas_file="lib/sysquotas_4B.c" AC_CHECK_MEMBERS([struct dqblk.dqb_curbytes], # Darwin bytecount style [ AC_DEFINE([HAVE_STRUCT_DQBLK_DQB_CURBYTES],[1],[darwin style quota bytecount])],, - [#include + [#include #include ]) fi -- 1.7.11.7 From 228a7d2819935fa502a18b0324fc3ec900d35341 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 26 Sep 2012 07:41:38 +1000 Subject: [PATCH 15/39] lib/util/charset: Try to find iconv on HP-UX --- lib/util/charset/wscript_configure | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/util/charset/wscript_configure b/lib/util/charset/wscript_configure index 98756fe..dc197c1 100644 --- a/lib/util/charset/wscript_configure +++ b/lib/util/charset/wscript_configure @@ -10,8 +10,11 @@ conf.CHECK_LIB(libs="iconv", shlib=True) +#HP-UX can use libiconv as an add-on package, which has #define iconv_open libiconv_open if (conf.CHECK_FUNCS_IN('iconv_open', 'iconv', checklibc=False, headers='iconv.h') or + conf.CHECK_FUNCS_IN('libiconv_open', 'iconv', checklibc=False, headers='iconv.h') or conf.CHECK_FUNCS('iconv_open', headers='iconv.h')): + if conf.env['HAVE_LIBICONV']: if conf.CHECK_FUNCS('mbrtowc', headers='wchar.h'): conf.DEFINE('HAVE_NATIVE_ICONV', 1) -- 1.7.11.7 From 00af30a1ab6c6904fc9a68178b084974804adbd9 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 26 Sep 2012 08:10:29 +1000 Subject: [PATCH 16/39] lib/util/charset: We do not use fucntions from wchar.h any more Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Wed Sep 26 02:13:10 CEST 2012 on sn-devel-104 --- lib/util/charset/wscript_configure | 8 +------- source3/passdb/pdb_nds.c | 1 - source3/registry/reg_parse.c | 1 - 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/util/charset/wscript_configure b/lib/util/charset/wscript_configure index dc197c1..804c266 100644 --- a/lib/util/charset/wscript_configure +++ b/lib/util/charset/wscript_configure @@ -15,10 +15,4 @@ if (conf.CHECK_FUNCS_IN('iconv_open', 'iconv', checklibc=False, headers='iconv.h conf.CHECK_FUNCS_IN('libiconv_open', 'iconv', checklibc=False, headers='iconv.h') or conf.CHECK_FUNCS('iconv_open', headers='iconv.h')): - if conf.env['HAVE_LIBICONV']: - if conf.CHECK_FUNCS('mbrtowc', headers='wchar.h'): - conf.DEFINE('HAVE_NATIVE_ICONV', 1) - elif conf.env.LIB_ICONV: - del conf.env['LIB_ICONV'] - else: - conf.DEFINE('HAVE_NATIVE_ICONV', 1) + conf.DEFINE('HAVE_NATIVE_ICONV', 1) diff --git a/source3/passdb/pdb_nds.c b/source3/passdb/pdb_nds.c index 3e1bdfc..cce4937 100644 --- a/source3/passdb/pdb_nds.c +++ b/source3/passdb/pdb_nds.c @@ -23,7 +23,6 @@ #include #include -#include #include "smbldap.h" #include "passdb/pdb_ldap.h" diff --git a/source3/registry/reg_parse.c b/source3/registry/reg_parse.c index babf5c0..c276c7e 100644 --- a/source3/registry/reg_parse.c +++ b/source3/registry/reg_parse.c @@ -34,7 +34,6 @@ #include "reg_format.h" #include -#include #include #include #include -- 1.7.11.7 From 2029d80509e7a87becac9415b016d6bb077fc1d1 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 26 Sep 2012 12:33:13 +1000 Subject: [PATCH 17/39] build: Add waf configure support for non-linux quotas --- source3/wscript | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/source3/wscript b/source3/wscript index 46ad87b..ff6aee9 100644 --- a/source3/wscript +++ b/source3/wscript @@ -1231,7 +1231,9 @@ main() { # For IRIX like dqb_isoftlimit instead of dqb_fsoftlimit in struc dqblk conf.CHECK_STRUCTURE_MEMBER('struct dqblk', 'dqb_fsoftlimit', define='HAVE_DQB_FSOFTLIMIT', headers='sys/quota.h') - + #darwin style quota bytecount + conf.CHECK_STRUCTURE_MEMBER('struct dqblk', 'dqb_curbytes', define='HAVE_STRUCT_DQBLK_DQB_CURBYTES', + headers='sys/quota.h') if conf.CHECK_HEADERS('rpcsvc/rquota.h'): conf.DEFINE('HAVE_NFS_QUOTAS', '1') conf.CHECK_STRUCTURE_MEMBER('struct getquota_rslt', 'getquota_rslt_u', @@ -1240,6 +1242,41 @@ main() { if (host_os.rfind('linux') > -1): conf.DEFINE('HAVE_QUOTACTL_LINUX', '1') + elif not conf.CONFIG_SET("HAVE_XFS_QUOTAS"): + if not conf.CHECK_CODE(''' + #define HAVE_QUOTACTL_4A 1 + #define AUTOCONF_TEST 1 + #include "confdefs.h" + #include "${srcdir-.}/../tests/sysquotas.c" + ''', + define='HAVE_QUOTACTL_4A', + msg='for QUOTACTL_4A: long quotactl(int cmd, char *special, qid_t id, caddr_t addr)', + execute=True, + local_include=False): + conf.CHECK_CODE(''' + #define HAVE_QUOTACTL_4B 1 + #define AUTOCONF_TEST 1 + #include "confdefs.h" + #include "${srcdir-.}/../tests/sysquotas.c" + ''', + define='HAVE_QUOTACTL_4B', + msg='for QUOTACTL_4B: int quotactl(const char *path, int cmd, int id, char *addr)', + execute=True, + local_include=False) + + conf.CHECK_CODE(''' + clnt_create("", RQUOTAPROG, RQUOTAVERS, "udp"); +''', + headers="rpc/rpc.h rpc/types.h rpcsvc/rquota.h rpc/nettype.h rpc/xdr.h", + define='HAVE_NFS_QUOTAS', + msg='for NFS QUOTAS', + execute=True, + local_include=False) + + conf.CHECK_STRUCTURE_MEMBER('struct getquota_rslt', + 'getquota_rslt_u', + define='HAVE_GETQUOTA_RSLT_GETQUOTA_RSLT_U', + headers='rpcsvc/rquota.h') if conf.CONFIG_SET('HAVE_QUOTACTL_LINUX') or \ conf.CONFIG_SET('HAVE_QUOTACTL_4A') or \ -- 1.7.11.7 From fcde08d3afd3647789aee4afc78d123ae26b4f9a Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 26 Sep 2012 12:33:50 +1000 Subject: [PATCH 18/39] build: Remove unused samba_cv_sysquotas_file variable from autoconf configure --- source3/configure.in | 3 --- 1 file changed, 3 deletions(-) diff --git a/source3/configure.in b/source3/configure.in index f1c801d..f3c1edc 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -4533,7 +4533,6 @@ case "$host_os" in *linux*) samba_cv_SYSQUOTA_FOUND=yes AC_DEFINE(HAVE_QUOTACTL_LINUX,1,[Whether Linux quota support is available]) - samba_cv_sysquotas_file="lib/sysquotas_linux.c" AC_MSG_CHECKING(whether to use the lib/sysquotas_linux.c builtin support) AC_MSG_RESULT(yes) @@ -4617,7 +4616,6 @@ AC_TRY_RUN_STRICT([ if test x"$samba_cv_HAVE_QUOTACTL_4A" = x"yes"; then samba_cv_SYSQUOTA_FOUND=yes; AC_DEFINE(HAVE_QUOTACTL_4A,1,[Whether long quotactl(int cmd, char *special, qid_t id, caddr_t addr) is available]) - samba_cv_sysquotas_file="lib/sysquotas_4A.c" fi fi @@ -4632,7 +4630,6 @@ AC_TRY_RUN_STRICT([ if test x"$samba_cv_HAVE_QUOTACTL_4B" = x"yes"; then samba_cv_SYSQUOTA_FOUND=yes; AC_DEFINE(HAVE_QUOTACTL_4B,1,[Whether int quotactl(const char *path, int cmd, int id, char *addr) is available]) - samba_cv_sysquotas_file="lib/sysquotas_4B.c" AC_CHECK_MEMBERS([struct dqblk.dqb_curbytes], # Darwin bytecount style [ AC_DEFINE([HAVE_STRUCT_DQBLK_DQB_CURBYTES],[1],[darwin style quota bytecount])],, [#include -- 1.7.11.7 From 50495740a2fd43a811f3b19db43152d2754dd0f8 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 26 Sep 2012 12:42:15 +1000 Subject: [PATCH 19/39] build: Set HAVE_SYS_QUOTAS and WITH_QUOTAS if we have any supported sysquota backend --- source3/wscript | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source3/wscript b/source3/wscript index ff6aee9..d896a4c 100644 --- a/source3/wscript +++ b/source3/wscript @@ -1280,8 +1280,10 @@ main() { if conf.CONFIG_SET('HAVE_QUOTACTL_LINUX') or \ conf.CONFIG_SET('HAVE_QUOTACTL_4A') or \ - conf.CONFIG_SET('HAVE_QUOTACTL_4B'): + conf.CONFIG_SET('HAVE_QUOTACTL_4B') or \ + conf.CONFIG_SET('HAVE_XFS_QUOTAS'): conf.DEFINE('HAVE_SYS_QUOTAS', '1') + conf.DEFINE('WITH_QUOTAS', '1') # # checking for clustering extensions (CTDB) -- 1.7.11.7 From 93e17c781223672070c8abf1c1faab34d33e8e9c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 26 Sep 2012 13:10:17 +1000 Subject: [PATCH 20/39] build: Remove unused --with-sys-quotas option --- source3/wscript | 1 - 1 file changed, 1 deletion(-) diff --git a/source3/wscript b/source3/wscript index d896a4c..230db59 100644 --- a/source3/wscript +++ b/source3/wscript @@ -31,7 +31,6 @@ def set_options(opt): opt.SAMBA3_ADD_OPTION('pam') opt.SAMBA3_ADD_OPTION('pam_smbpass') opt.SAMBA3_ADD_OPTION('quotas') - opt.SAMBA3_ADD_OPTION('sys-quotas') opt.SAMBA3_ADD_OPTION('sendfile-support') opt.SAMBA3_ADD_OPTION('utmp') opt.SAMBA3_ADD_OPTION('pthreadpool', with_name="enable", without_name="disable", default=True) -- 1.7.11.7 From 9ccc3ea71f86024334782726bec0bf59a94ca298 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 26 Sep 2012 18:09:20 +1000 Subject: [PATCH 21/39] nsswitch: Add waf tests for solaris special cases These are in configure.in for autoconf. Found in the config.h comparison on the smbtorture4 build. Andrew Bartlett Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Wed Sep 26 11:50:10 CEST 2012 on sn-devel-104 --- nsswitch/wscript_configure | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/nsswitch/wscript_configure b/nsswitch/wscript_configure index 7d6ea82..3048f48 100644 --- a/nsswitch/wscript_configure +++ b/nsswitch/wscript_configure @@ -4,3 +4,19 @@ conf.CHECK_HEADERS('nss.h nss_common.h ns_api.h') conf.CHECK_HEADERS('security/pam_appl.h security/pam_modules.h pam/pam_modules.h', together=True) conf.CHECK_FUNCS_IN('pam_start', 'pam', checklibc=True, headers='security/pam_appl.h') + +# Solaris 10 does have new member in nss_XbyY_key +conf.CHECK_STRUCTURE_MEMBER('union nss_XbyY_key', 'ipnode.af_family', + define='HAVE_NSS_XBYY_KEY_IPNODE', + headers='nss_dbdefs.h') + +# Solaris has some extra fields in struct passwd that need to be +# initialised otherwise nscd crashes. + +conf.CHECK_STRUCTURE_MEMBER('struct passwd', 'pw_comment', + define='HAVE_PASSWD_PW_COMMENT', + headers='pwd.h') + +conf.CHECK_STRUCTURE_MEMBER('struct passwd', 'pw_age', + define='HAVE_PASSWD_PW_AGE', + headers='pwd.h') -- 1.7.11.7 From af6f49caf6bc37165044c9ff6e23c3a5427c7cf9 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 29 Sep 2012 14:36:41 +1000 Subject: [PATCH 22/39] lib/replace: Add test for what flag we need for -Werror behaviour --- lib/replace/wscript | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/replace/wscript b/lib/replace/wscript index 0dbac06..2e1dd65 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -43,6 +43,15 @@ def configure(conf): conf.DEFINE('_XOPEN_SOURCE', 600, add_to_cflags=True) conf.DEFINE('_BSD_TYPES', 1, add_to_cflags=True) + # Try to find the right extra flags for -Werror behaviour + for f in ["-Werror", "-w2", "-errwarn"]: + if conf.CHECK_CFLAGS([f], ''' +'''): + if not 'WERROR_CFLAGS' in conf.env: + conf.env['WERROR_CFLAGS'] = [] + conf.env['WERROR_CFLAGS'].extend([f]) + break + conf.CHECK_HEADERS('linux/types.h crypt.h locale.h acl/libacl.h compat.h') conf.CHECK_HEADERS('acl/libacl.h attr/xattr.h compat.h ctype.h dustat.h') conf.CHECK_HEADERS('fcntl.h fnmatch.h glob.h history.h krb5.h langinfo.h') -- 1.7.11.7 From 6889bc960eb29ecbc87ab560bc5b87bba93961c8 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 29 Sep 2012 14:28:57 +1000 Subject: [PATCH 23/39] build: Fix quota tests, including move of sysquotas.c to the top level This correctly detects quotas on FreeBSD Andrew Bartlett --- source3/configure.in | 4 +-- source3/tests/sysquotas.c | 90 ----------------------------------------------- source3/wscript | 13 +++---- tests/sysquotas.c | 90 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 99 insertions(+), 98 deletions(-) delete mode 100644 source3/tests/sysquotas.c create mode 100644 tests/sysquotas.c diff --git a/source3/configure.in b/source3/configure.in index f3c1edc..2c5fbb3 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -4611,7 +4611,7 @@ AC_TRY_RUN_STRICT([ #define HAVE_QUOTACTL_4A 1 #define AUTOCONF_TEST 1 #include "confdefs.h" -#include "${srcdir-.}/../tests/sysquotas.c"],[$CFLAGS $Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS], +#include "${srcdir-.}/../../tests/sysquotas.c"],[$CFLAGS $Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS], samba_cv_HAVE_QUOTACTL_4A=yes,samba_cv_HAVE_QUOTACTL_4A=no,samba_cv_HAVE_QUOTACTL_4A=cross)]) if test x"$samba_cv_HAVE_QUOTACTL_4A" = x"yes"; then samba_cv_SYSQUOTA_FOUND=yes; @@ -4625,7 +4625,7 @@ AC_TRY_RUN_STRICT([ #define HAVE_QUOTACTL_4B 1 #define AUTOCONF_TEST 1 #include "confdefs.h" -#include "${srcdir-.}/../tests/sysquotas.c"],[$CFLAGS $Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS], +#include "${srcdir-.}/../../tests/sysquotas.c"],[$CFLAGS $Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS], samba_cv_HAVE_QUOTACTL_4B=yes,samba_cv_HAVE_QUOTACTL_4B=no,samba_cv_HAVE_QUOTACTL_4B=cross)]) if test x"$samba_cv_HAVE_QUOTACTL_4B" = x"yes"; then samba_cv_SYSQUOTA_FOUND=yes; diff --git a/source3/tests/sysquotas.c b/source3/tests/sysquotas.c deleted file mode 100644 index 1544dca..0000000 --- a/source3/tests/sysquotas.c +++ /dev/null @@ -1,90 +0,0 @@ -/* this test should find out what quota api is available on the os */ - - int autoconf_quota(void); - -#if defined(HAVE_QUOTACTL_4A) -/* long quotactl(int cmd, char *special, qid_t id, caddr_t addr) */ - -#ifdef HAVE_SYS_TYPES_H -#include -#endif - -#ifdef HAVE_ASM_TYPES_H -#include -#endif - -#if defined(HAVE_LINUX_QUOTA_H) -# include -# if defined(HAVE_STRUCT_IF_DQBLK) -# define SYS_DQBLK if_dqblk -# elif defined(HAVE_STRUCT_MEM_DQBLK) -# define SYS_DQBLK mem_dqblk -# endif -#elif defined(HAVE_SYS_QUOTA_H) -# include -#endif - -#ifdef HPUX -/* HPUX has no prototype for quotactl but we test compile with strict - error checks, which would fail without function prototype */ -extern int quotactl(int cmd, const char *special, uid_t uid, void *addr); -#endif - -#ifndef SYS_DQBLK -#define SYS_DQBLK dqblk -#endif - - int autoconf_quota(void); - - int autoconf_quota(void) -{ - int ret = -1; - struct SYS_DQBLK D; - - ret = quotactl(Q_GETQUOTA,"/dev/hda1",0,(void *)&D); - - return ret; -} - -#elif defined(HAVE_QUOTACTL_4B) -/* int quotactl(const char *path, int cmd, int id, char *addr); */ - -#ifdef HAVE_SYS_TYPES_H -#include -#endif - -#ifdef HAVE_SYS_QUOTA_H -#include -#else /* *BSD */ -#include -#ifdef HAVE_UFS_UFS_QUOTA_H -#include -#endif -#include -#endif - - int autoconf_quota(void) -{ - int ret = -1; - struct dqblk D; - - ret = quotactl("/",Q_GETQUOTA,0,(char *) &D); - - return ret; -} - -#elif defined(HAVE_QUOTACTL_2) - -#error HAVE_QUOTACTL_2 not implemented - -#else - -#error Unknow QUOTACTL prototype - -#endif - - int main(void) -{ - autoconf_quota(); - return 0; -} diff --git a/source3/wscript b/source3/wscript index 230db59..9cd66e1 100644 --- a/source3/wscript +++ b/source3/wscript @@ -1245,23 +1245,24 @@ main() { if not conf.CHECK_CODE(''' #define HAVE_QUOTACTL_4A 1 #define AUTOCONF_TEST 1 - #include "confdefs.h" - #include "${srcdir-.}/../tests/sysquotas.c" + #include "../tests/sysquotas.c" ''', + cflags=conf.env['WERROR_CFLAGS'], define='HAVE_QUOTACTL_4A', msg='for QUOTACTL_4A: long quotactl(int cmd, char *special, qid_t id, caddr_t addr)', execute=True, - local_include=False): + addmain=False): + conf.CHECK_CODE(''' #define HAVE_QUOTACTL_4B 1 #define AUTOCONF_TEST 1 - #include "confdefs.h" - #include "${srcdir-.}/../tests/sysquotas.c" + #include "../tests/sysquotas.c" ''', + cflags=conf.env['WERROR_CFLAGS'], define='HAVE_QUOTACTL_4B', msg='for QUOTACTL_4B: int quotactl(const char *path, int cmd, int id, char *addr)', execute=True, - local_include=False) + addmain=False) conf.CHECK_CODE(''' clnt_create("", RQUOTAPROG, RQUOTAVERS, "udp"); diff --git a/tests/sysquotas.c b/tests/sysquotas.c new file mode 100644 index 0000000..afec3f1 --- /dev/null +++ b/tests/sysquotas.c @@ -0,0 +1,90 @@ +/* this test should find out what quota api is available on the os */ + + int autoconf_quota(void); + +#if defined(HAVE_QUOTACTL_4A) +/* long quotactl(int cmd, char *special, qid_t id, caddr_t addr) */ + +#ifdef HAVE_SYS_TYPES_H +#include +#endif + +#ifdef HAVE_ASM_TYPES_H +#include +#endif + +#if defined(HAVE_LINUX_QUOTA_H) +# include +# if defined(HAVE_STRUCT_IF_DQBLK) +# define SYS_DQBLK if_dqblk +# elif defined(HAVE_STRUCT_MEM_DQBLK) +# define SYS_DQBLK mem_dqblk +# endif +#elif defined(HAVE_SYS_QUOTA_H) +# include +#endif + +#ifdef HPUX +/* HPUX has no prototype for quotactl but we test compile with strict + error checks, which would fail without function prototype */ +extern int quotactl(int cmd, const char *special, uid_t uid, void *addr); +#endif + +#ifndef SYS_DQBLK +#define SYS_DQBLK dqblk +#endif + + int autoconf_quota(void); + + int autoconf_quota(void) +{ + int ret = -1; + struct SYS_DQBLK D; + + ret = quotactl(Q_GETQUOTA,"/dev/hda1",0,(void *)&D); + + return ret; +} + +#elif defined(HAVE_QUOTACTL_4B) +/* int quotactl(const char *path, int cmd, int id, char *addr); */ + +#ifdef HAVE_SYS_TYPES_H +#include +#endif + +#ifdef HAVE_SYS_QUOTA_H +#include +#else /* *BSD */ +#include +#ifdef HAVE_UFS_UFS_QUOTA_H +#include +#endif +#include +#endif + + int autoconf_quota(void) +{ + int ret = -1; + struct dqblk D; + + ret = quotactl("/",Q_GETQUOTA,0,(char *) &D); + + return ret; +} + +#elif defined(HAVE_QUOTACTL_2) + +#error HAVE_QUOTACTL_2 not implemented + +#else + +#error Unknow QUOTACTL prototype + +#endif + + int main(void) +{ + autoconf_quota(); + return 0; +} -- 1.7.11.7 From b4c5528221fff994ad48c623644c6205b6109f9b Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 29 Sep 2012 14:31:28 +1000 Subject: [PATCH 24/39] build: Remove duplicate check for struct getquota_rslt member getquota_rslt_u Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Sat Sep 29 08:51:03 CEST 2012 on sn-devel-104 --- source3/wscript | 5 ----- 1 file changed, 5 deletions(-) diff --git a/source3/wscript b/source3/wscript index 9cd66e1..24bad56 100644 --- a/source3/wscript +++ b/source3/wscript @@ -1273,11 +1273,6 @@ main() { execute=True, local_include=False) - conf.CHECK_STRUCTURE_MEMBER('struct getquota_rslt', - 'getquota_rslt_u', - define='HAVE_GETQUOTA_RSLT_GETQUOTA_RSLT_U', - headers='rpcsvc/rquota.h') - if conf.CONFIG_SET('HAVE_QUOTACTL_LINUX') or \ conf.CONFIG_SET('HAVE_QUOTACTL_4A') or \ conf.CONFIG_SET('HAVE_QUOTACTL_4B') or \ -- 1.7.11.7 From e06648b3709e5b46d9323c3481aaa9bde267268c Mon Sep 17 00:00:00 2001 From: Ira Cooper Date: Sun, 30 Sep 2012 19:02:13 +0000 Subject: [PATCH 25/39] s3: Fix libnss_winbind.so's build on Illumos/Solaris Due to not building and linking in the winbind_nss_solaris bits in addition to the linux bits, nss was broken on Solaris. Autobuild-User(master): Ira Cooper Autobuild-Date(master): Sun Sep 30 22:56:30 CEST 2012 on sn-devel-104 --- nsswitch/winbind_nss_solaris.c | 6 ++++++ nsswitch/wscript_build | 21 ++++++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/nsswitch/winbind_nss_solaris.c b/nsswitch/winbind_nss_solaris.c index 5fb3764..92da859 100644 --- a/nsswitch/winbind_nss_solaris.c +++ b/nsswitch/winbind_nss_solaris.c @@ -26,6 +26,7 @@ #undef DEVELOPER + #include "winbind_client.h" #include #include @@ -34,6 +35,7 @@ #include #include "includes.h" #include + #if !defined(HPUX) #include #endif /*hpux*/ @@ -48,6 +50,10 @@ #define NSS_DEBUG(str) ; #endif +#if !defined(SMB_MALLOC_P) +#define SMB_MALLOC_P(type) (type *)malloc(sizeof(type)) +#endif + #define NSS_ARGS(args) ((nss_XbyY_args_t *)args) #ifdef HPUX diff --git a/nsswitch/wscript_build b/nsswitch/wscript_build index 0802687..3931445 100644 --- a/nsswitch/wscript_build +++ b/nsswitch/wscript_build @@ -1,4 +1,5 @@ #!/usr/bin/env python +import Utils bld.SAMBA_LIBRARY('winbind-client', source='wb_common.c', @@ -13,13 +14,19 @@ bld.SAMBA_BINARY('nsstest', deps='replace dl' ) - -bld.SAMBA_LIBRARY('nss_winbind', - source='winbind_nss_linux.c', - deps='winbind-client', - realname='libnss_winbind.so.2', - vnum='2') - +if Utils.unversioned_sys_platform() == 'linux': + bld.SAMBA_LIBRARY('nss_winbind', + source='winbind_nss_linux.c', + deps='winbind-client', + realname='libnss_winbind.so.2', + vnum='2') + +if Utils.unversioned_sys_platform() == 'sunos': + bld.SAMBA_LIBRARY('nss_winbind', + source='winbind_nss_solaris.c winbind_nss_linux.c', + deps='winbind-client', + realname='libnss_winbind.so.2', + vnum='2') if bld.CONFIG_SET('WITH_PAM_MODULES') and bld.CONFIG_SET('HAVE_PAM_START'): bld.SAMBA_LIBRARY('pamwinbind', -- 1.7.11.7 From f77ce420268db4f56b99cce490506c34af38974e Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Tue, 2 Oct 2012 14:53:38 +0300 Subject: [PATCH 26/39] Fix release script to build full set of documentation build-docs script was not setting XML catalog properly. In addition, some time ago pdf versions of images were introduced as generated dependencies in our books but svg -> pdf rule was not added, so building books never finished properly. Autobuild-User(master): Alexander Bokovoy Autobuild-Date(master): Tue Oct 2 16:21:23 CEST 2012 on sn-devel-104 --- docs-xml/Makefile | 3 +++ release-scripts/build-docs | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs-xml/Makefile b/docs-xml/Makefile index 6cb069f..f9c60d0 100644 --- a/docs-xml/Makefile +++ b/docs-xml/Makefile @@ -191,6 +191,9 @@ $(PSDIR)/%.ps: %/index.xml $(PSDIR) xslt/latex.xsl %-images-latex-eps %.eps: %.png $(PNGTOPNM) $< | $(PNMTOPS) > $@ +%.pdf: %.svg + $(INKSCAPE) -z -f $(abspath $<) --export-pdf=$(abspath $@) + $(HTMLHELPDIR)/%: $(DOCBOOKDIR)/%.xml %-images-htmlhelp $(XSLTPROC) --stringparam htmlhelp.chm $*.chm \ --stringparam manifest.in.base.dir "$@/" \ diff --git a/release-scripts/build-docs b/release-scripts/build-docs index 5da641a..e909e6e 100755 --- a/release-scripts/build-docs +++ b/release-scripts/build-docs @@ -11,6 +11,7 @@ DOCSRCDIR=`dirname $0`/../docs-xml pushd $DOCSRCDIR || exit 1 git clean -d -x -f +export XML_CATALOG_FILES="file:///etc/xml/catalog file://$(pwd)/build/catalog.xml" autoconf && \ ./configure --with-papersize=letter && \ make smbdotconf/parameters.all.xml && \ @@ -28,8 +29,6 @@ rsync -Ca --exclude=.svn archives/ ../docs/ cd ../docs || _exit "Error changing dir to ${DOCSDIR}/../docs/" /bin/rm -rf test.pdf Samba4*pdf htmldocs/Samba4* htmldocs/test -mv manpages-3 manpages -mv htmldocs/manpages-3 htmldocs/manpages cd ../docs-xml || _exit "Error changing dir to ${DOCSDIR}/../docs-xml/" make distclean -- 1.7.11.7 From 04c88477244bfe9aedea970e173ceedc683aa347 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 3 Oct 2012 16:36:34 +1000 Subject: [PATCH 27/39] selftest: Always build a linux-style nss_winbind for nss_wrapper --- nsswitch/wscript_build | 9 +++++++++ selftest/target/Samba.pm | 9 +++++++++ selftest/target/Samba3.pm | 5 +---- selftest/target/Samba4.pm | 2 +- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/nsswitch/wscript_build b/nsswitch/wscript_build index 3931445..97f0af5 100644 --- a/nsswitch/wscript_build +++ b/nsswitch/wscript_build @@ -14,6 +14,15 @@ bld.SAMBA_BINARY('nsstest', deps='replace dl' ) +# The nss_wrapper code relies strictly on the linux implementation and +# name, so compile but do not install a copy under this name. +bld.SAMBA_LIBRARY('nss_wrapper_winbind', + source='winbind_nss_linux.c', + deps='winbind-client', + realname='libnss_wrapper_winbind.so.2', + install=False, + vnum='2') + if Utils.unversioned_sys_platform() == 'linux': bld.SAMBA_LIBRARY('nss_winbind', source='winbind_nss_linux.c', diff --git a/selftest/target/Samba.pm b/selftest/target/Samba.pm index ec6fc48..d811053 100644 --- a/selftest/target/Samba.pm +++ b/selftest/target/Samba.pm @@ -64,6 +64,15 @@ sub bindir_path($$) { return $path; } +sub nss_wrapper_winbind_so_path($) { + my ($object) = @_; + my $ret = $ENV{NSS_WRAPPER_WINBIND_SO_PATH}; + if (not defined($ret)) { + $ret = bindir_path($object, "default/nsswitch/libnss-winbind.so"); + } + return $ret; +} + sub mk_krb5_conf($$) { my ($ctx, $other_realms_stanza) = @_; diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index 288439c..5c86612 100755 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -1098,10 +1098,7 @@ domusers:X:$gid_domusers: $ret{SOCKET_WRAPPER_DEFAULT_IFACE} = $swiface; $ret{NSS_WRAPPER_PASSWD} = $nss_wrapper_passwd; $ret{NSS_WRAPPER_GROUP} = $nss_wrapper_group; - $ret{NSS_WRAPPER_WINBIND_SO_PATH} = $ENV{NSS_WRAPPER_WINBIND_SO_PATH}; - if (not defined($ret{NSS_WRAPPER_WINBIND_SO_PATH})) { - $ret{NSS_WRAPPER_WINBIND_SO_PATH} = Samba::bindir_path($self, "default/nsswitch/libnss-winbind.so"); - } + $ret{NSS_WRAPPER_WINBIND_SO_PATH} = Samba::nss_wrapper_winbind_so_path($self); $ret{LOCAL_PATH} = "$shrdir"; return \%ret; diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm index 2f36930..fbc8117 100644 --- a/selftest/target/Samba4.pm +++ b/selftest/target/Samba4.pm @@ -682,7 +682,7 @@ nogroup:x:65534:nobody SAMBA_TEST_FIFO => "$ctx->{prefix}/samba_test.fifo", SAMBA_TEST_LOG => "$ctx->{prefix}/samba_test.log", SAMBA_TEST_LOG_POS => 0, - NSS_WRAPPER_WINBIND_SO_PATH => Samba::bindir_path($self, "default/nsswitch/libnss-winbind.so"), + NSS_WRAPPER_WINBIND_SO_PATH => Samba::nss_wrapper_winbind_so_path($self), LOCAL_PATH => $ctx->{share} }; -- 1.7.11.7 From c2825f1c2001b06a53ab94d9e56bd5b723d2a6c6 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 2 Oct 2012 08:12:16 +1000 Subject: [PATCH 28/39] nsswitch: Build nss_winbind on all supported platforms This matches what the autoconf build can do. Andrew Bartlett --- nsswitch/wscript_build | 59 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 49 insertions(+), 10 deletions(-) diff --git a/nsswitch/wscript_build b/nsswitch/wscript_build index 97f0af5..8499c62 100644 --- a/nsswitch/wscript_build +++ b/nsswitch/wscript_build @@ -1,5 +1,7 @@ #!/usr/bin/env python import Utils +import sys +host_os = sys.platform bld.SAMBA_LIBRARY('winbind-client', source='wb_common.c', @@ -23,19 +25,56 @@ bld.SAMBA_LIBRARY('nss_wrapper_winbind', install=False, vnum='2') -if Utils.unversioned_sys_platform() == 'linux': +# FIXME: original was *linux* | gnu* | k*bsd*-gnu | kopensolaris*-gnu) +# the search for .rfind('gnu') covers gnu* and *-gnu is that too broad? + +if (Utils.unversioned_sys_platform() == 'linux' or (host_os.rfind('gnu') > -1)): + bld.SAMBA_LIBRARY('nss_winbind', + source='winbind_nss_linux.c', + deps='winbind-client', + realname='libnss_winbind.so.2', + vnum='2') +elif (host_os.rfind('freebsd') > -1): + # FreeBSD winbind client is implemented as a wrapper around + # the Linux version. bld.SAMBA_LIBRARY('nss_winbind', - source='winbind_nss_linux.c', - deps='winbind-client', - realname='libnss_winbind.so.2', - vnum='2') + source='winbind_nss_linux.c winbind_nss_freebsd.c', + deps='winbind-client', + realname='libnss_winbind.so.1', + vnum='1') + +elif (host_os.rfind('netbsd') > -1): + # NetBSD winbind client is implemented as a wrapper + # around the Linux version. It needs getpwent_r() to + # indicate libc's use of the correct nsdispatch API. -if Utils.unversioned_sys_platform() == 'sunos': + if bld.CONFIG_SET("HAVE_GETPWENT_R"): + bld.SAMBA_LIBRARY('nss_winbind', + source='winbind_nss_linux.c winbind_nss_netbsd.c', + deps='winbind-client', + realname='libnss_winbind.so') +elif (host_os.rfind('irix') > -1): + bld.SAMBA_LIBRARY('ns_winbind', + source='winbind_nss_irix.c', + deps='winbind-client', + realname='libns_winbind.so') + +elif Utils.unversioned_sys_platform() == 'sunos': + bld.SAMBA_LIBRARY('nss_winbind', + source='winbind_nss_solaris.c winbind_nss_linux.c', + deps='winbind-client', + realname='nss_winbind.so.1', + vnum='1') +elif (host_os.rfind('hpux') > -1): + bld.SAMBA_LIBRARY('nss_winbind', + source='winbind_nss_linux.c', + deps='winbind-client', + realname='libnss_winbind.so') +elif (host_os.rfind('aix') > -1): bld.SAMBA_LIBRARY('nss_winbind', - source='winbind_nss_solaris.c winbind_nss_linux.c', - deps='winbind-client', - realname='libnss_winbind.so.2', - vnum='2') + source='winbind_nss_aix.c', + deps='winbind-client', + realname='libnss_winbind.so') if bld.CONFIG_SET('WITH_PAM_MODULES') and bld.CONFIG_SET('HAVE_PAM_START'): bld.SAMBA_LIBRARY('pamwinbind', -- 1.7.11.7 From 4c8366d79cc88b3c414af8b930e20033c0bb24ae Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 10 Oct 2012 12:44:14 +1100 Subject: [PATCH 29/39] build: Add vfs_media_harmony to the waf build --- source3/modules/wscript_build | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source3/modules/wscript_build b/source3/modules/wscript_build index 594b27c..d73a707 100644 --- a/source3/modules/wscript_build +++ b/source3/modules/wscript_build @@ -49,6 +49,7 @@ VFS_SCANNEDONLY_SRC = 'vfs_scannedonly.c' VFS_CROSSRENAME_SRC = 'vfs_crossrename.c' VFS_LINUX_XFS_SGID_SRC = 'vfs_linux_xfs_sgid.c' VFS_TIME_AUDIT_SRC = 'vfs_time_audit.c' +VFS_MEDIA_HARMONY_SRC = 'vfs_media_harmony.c' bld.SAMBA3_SUBSYSTEM('NFS4_ACLS', @@ -464,6 +465,14 @@ bld.SAMBA3_MODULE('vfs_time_audit', internal_module=bld.SAMBA3_IS_STATIC_MODULE('vfs_time_audit'), enabled=bld.SAMBA3_IS_ENABLED_MODULE('vfs_time_audit')) +bld.SAMBA3_MODULE('vfs_media_harmony', + subsystem='vfs', + source=VFS_MEDIA_HARMONY_SRC, + deps='samba-util', + init_function='', + internal_module=bld.SAMBA3_IS_STATIC_MODULE('vfs_media_harmony'), + enabled=bld.SAMBA3_IS_ENABLED_MODULE('vfs_media_harmony')) + bld.SAMBA3_MODULE('vfs_dfs_samba4', subsystem='vfs', source='vfs_dfs_samba4.c', -- 1.7.11.7 From d5b8869615bee0bb6fb625ab4ffea04768ca037d Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 10 Oct 2012 21:20:24 +1100 Subject: [PATCH 30/39] build: Remove --disable-shared This does not work, and has no known use cases. Remove it so we do not waste time trying to support it. This also removes it for ldb/tdb/ntdb/talloc, but as these are first shared libraries, and then tools on top of those, rpath or (for emergency tools) --nonshared-binary= seems more appropriate. Andrew Bartlett --- buildtools/wafsamba/samba_bundled.py | 4 ---- buildtools/wafsamba/wscript | 13 ++----------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/buildtools/wafsamba/samba_bundled.py b/buildtools/wafsamba/samba_bundled.py index b8a4101..afcf708 100644 --- a/buildtools/wafsamba/samba_bundled.py +++ b/buildtools/wafsamba/samba_bundled.py @@ -30,8 +30,6 @@ def target_in_list(target, lst, default): def BUILTIN_LIBRARY(bld, name): '''return True if a library should be builtin instead of being built as a shared lib''' - if bld.env.DISABLE_SHARED: - return True return target_in_list(name, bld.env.BUILTIN_LIBRARIES, False) Build.BuildContext.BUILTIN_LIBRARY = BUILTIN_LIBRARY @@ -249,8 +247,6 @@ def CHECK_BUNDLED_SYSTEM_PYTHON(conf, libname, modulename, minversion='0.0.0'): def NONSHARED_BINARY(bld, name): '''return True if a binary should be built without non-system shared libs''' - if bld.env.DISABLE_SHARED: - return True return target_in_list(name, bld.env.NONSHARED_BINARIES, False) Build.BuildContext.NONSHARED_BINARY = NONSHARED_BINARY diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript index 5e1898c..441e727 100755 --- a/buildtools/wafsamba/wscript +++ b/buildtools/wafsamba/wscript @@ -50,9 +50,6 @@ def set_options(opt): help=("list of minimum system library versions (LIBNAME1:version,LIBNAME2:version)"), action="store", dest='MINIMUM_LIBRARY_VERSION', default='') - gr.add_option('--disable-shared', - help=("Disable all use of shared libraries"), - action="store_true", dest='disable_shared', default=False) gr.add_option('--disable-rpath', help=("Disable use of rpath for build binaries"), action="store_true", dest='disable_rpath_build', default=False) @@ -248,7 +245,6 @@ def configure(conf): conf.env.BUNDLED_LIBS = Options.options.BUNDLED_LIBS.split(',') conf.env.PRIVATE_LIBS = Options.options.PRIVATE_LIBS.split(',') conf.env.BUILTIN_LIBRARIES = Options.options.BUILTIN_LIBRARIES.split(',') - conf.env.DISABLE_SHARED = Options.options.disable_shared conf.env.NONSHARED_BINARIES = Options.options.NONSHARED_BINARIES.split(',') conf.env.PRIVATE_EXTENSION = Options.options.PRIVATE_EXTENSION @@ -297,12 +293,8 @@ def configure(conf): headers='stdio.h', msg='Checking simple C program') - # see if we can build shared libs - if not conf.CHECK_LIBRARY_SUPPORT(): - conf.env.DISABLE_SHARED = True - # check for rpath - if not conf.env.DISABLE_SHARED and conf.CHECK_LIBRARY_SUPPORT(rpath=True): + if conf.CHECK_LIBRARY_SUPPORT(rpath=True): support_rpath = True conf.env.RPATH_ON_BUILD = not Options.options.disable_rpath_build conf.env.RPATH_ON_INSTALL = (conf.env.RPATH_ON_BUILD and @@ -322,8 +314,7 @@ def configure(conf): # the user can of course always override it. conf.env.PRIVATELIBDIR = conf.env.LIBDIR - if (not conf.env.DISABLE_SHARED and - not Options.options.disable_symbol_versions and + if (not Options.options.disable_symbol_versions and conf.CHECK_LIBRARY_SUPPORT(rpath=support_rpath, version_script=True, msg='-Wl,--version-script support')): -- 1.7.11.7 From 2feb0413eaeb48d027ed055ac321565725283b20 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 17 Oct 2012 18:03:55 +0200 Subject: [PATCH 31/39] wafsamba: If we define a realname and a soname create a symlink. This is needed that libnss_winbind.so.2 and libnss_wins.so.2 will get a corresponding symlinks. --- buildtools/wafsamba/samba_install.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/buildtools/wafsamba/samba_install.py b/buildtools/wafsamba/samba_install.py index 5e53989..aa7f143 100644 --- a/buildtools/wafsamba/samba_install.py +++ b/buildtools/wafsamba/samba_install.py @@ -103,6 +103,8 @@ def install_library(self): if getattr(self, 'samba_realname', None): install_name = self.samba_realname install_link = None + if getattr(self, 'soname', ''): + install_link = self.soname if getattr(self, 'samba_type', None) == 'PYTHON': inst_name = bld.make_libname(t.target, nolibprefix=True, python=True) else: -- 1.7.11.7 From 59b13c54bbdaef2d77e4bc28a067bf86f2dd59ca Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 17 Oct 2012 18:16:15 +0200 Subject: [PATCH 32/39] waf: Create a libnss_winbind.so symlink. This fixes bug #9299. --- nsswitch/wscript_build | 1 + 1 file changed, 1 insertion(+) diff --git a/nsswitch/wscript_build b/nsswitch/wscript_build index 8499c62..a94c02c 100644 --- a/nsswitch/wscript_build +++ b/nsswitch/wscript_build @@ -33,6 +33,7 @@ if (Utils.unversioned_sys_platform() == 'linux' or (host_os.rfind('gnu') > -1)): source='winbind_nss_linux.c', deps='winbind-client', realname='libnss_winbind.so.2', + soname='libnss_winbind.so', vnum='2') elif (host_os.rfind('freebsd') > -1): # FreeBSD winbind client is implemented as a wrapper around -- 1.7.11.7 From 15dbd17361570f0c0d38804e35f0430507a957fb Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 17 Oct 2012 18:17:27 +0200 Subject: [PATCH 33/39] waf: Create a libnss_wins.so symlink. The last 3 patches fixe bug #9299 - nsswitch modules under Linux need a symbolic to their so version library. https://bugzilla.samba.org/show_bug.cgi?id=9299 Reviewed-by: David Disseldorp Autobuild-User(master): Karolin Seeger Autobuild-Date(master): Mon Oct 22 10:48:16 CEST 2012 on sn-devel-104 --- source3/wscript_build | 1 + 1 file changed, 1 insertion(+) diff --git a/source3/wscript_build b/source3/wscript_build index 4b9c3ec..0634b8d 100755 --- a/source3/wscript_build +++ b/source3/wscript_build @@ -659,6 +659,7 @@ bld.SAMBA3_LIBRARY('nss_wins', source=WINBIND_WINS_NSS_SRC, deps='''param libsmb LIBTSOCKET''', realname='libnss_wins.so.2', + soname='libnss_wins.so', vnum='2') bld.SAMBA3_LIBRARY('gse', -- 1.7.11.7 From b78e71d406e789340c177b9fd3cde1c26066495f Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 23 Oct 2012 17:53:58 +1100 Subject: [PATCH 34/39] build: Add #define FREEBSD on FreeBSD This makes waf match autoconf Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Tue Oct 23 11:11:44 CEST 2012 on sn-devel-104 --- source3/wscript | 1 + 1 file changed, 1 insertion(+) diff --git a/source3/wscript b/source3/wscript index 24bad56..9c0fd72 100644 --- a/source3/wscript +++ b/source3/wscript @@ -289,6 +289,7 @@ utimensat vsyslog _write __write __xstat conf.ADD_CFLAGS('-fno-common') conf.DEFINE('STAT_ST_BLOCKSIZE', '512') elif (host_os.rfind('freebsd') > -1): + conf.DEFINE('FREEBSD', 1) if conf.CHECK_HEADERS('sunacl.h'): conf.DEFINE('HAVE_FREEBSD_SUNACL_H', '1') conf.CHECK_FUNCS_IN('acl', 'sunacl') -- 1.7.11.7 From 0025de6c7e18e40e11a22d60e7b088b475d0915f Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 23 Oct 2012 15:53:17 +0200 Subject: [PATCH 35/39] build(waf): Fix the --with-cluster build The problem with the cluster/ctdb configure checks in Samba currently is, that the headers need to include . If there are no system tdb headers, configure fails to find tdb headers at this stage. Since the include is only required for some defines (TDB_DATA), the workaround is to temporarily add the included tdb copy's include path to the include search path in the configure test. The ctdb we run against will most likely have been compiled against a different version of TDB anyways... To properly fix this, we might need to change ctdb to rely on an external tdb library. Or to incorporate ctdb into samba as a component that uses the same shipped tdb version. Signed-off-by: Michael Adam Signed-off-by: Volker Lendecke Signed-off-by: Stefan Metzmacher Autobuild-User(master): Michael Adam Autobuild-Date(master): Tue Oct 23 18:29:26 CEST 2012 on sn-devel-104 --- source3/wscript | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source3/wscript b/source3/wscript index 9c0fd72..5bd5152 100644 --- a/source3/wscript +++ b/source3/wscript @@ -1298,6 +1298,9 @@ main() { else: includes = '' + if not conf.env.USING_SYSTEM_TDB: + includes = includes + ' ' + srcdir + '/lib/tdb/include' + have_cluster_support = True ctdb_broken = "" -- 1.7.11.7 From 8cd61b28a52c67a523f164a4ca0e576a40b17830 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 28 Oct 2012 19:38:10 +1100 Subject: [PATCH 36/39] build: Remove support for IDL-generated files in git tree This was added in a9ea3d6fa510286b83c4bda42c9a857da3625451 but is no longer required, as we do not store IDL-generated files in GIT. Andrew Bartlett --- buildtools/wafsamba/samba_pidl.py | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/buildtools/wafsamba/samba_pidl.py b/buildtools/wafsamba/samba_pidl.py index ff13971..4056359 100644 --- a/buildtools/wafsamba/samba_pidl.py +++ b/buildtools/wafsamba/samba_pidl.py @@ -7,7 +7,6 @@ from samba_utils import * def SAMBA_PIDL(bld, pname, source, options='', output_dir='.', - symlink=False, generate_tables=True): '''Build a IDL file using pidl. This will produce up to 13 output files depending on the options used''' @@ -91,27 +90,7 @@ def SAMBA_PIDL(bld, pname, source, t.env.PIDL = os.path.join(bld.srcnode.abspath(), 'pidl/pidl') t.env.OPTIONS = TO_LIST(options) - - # this rather convoluted set of path calculations is to cope with the possibility - # that gen_ndr is a symlink into the source tree. By doing this for the source3 - # gen_ndr directory we end up generating identical output in gen_ndr for the old - # build system and the new one. That makes keeping things in sync much easier. - # eventually we should drop the gen_ndr files in git, but in the meanwhile this works - - found_dir = bld.path.find_dir(output_dir) - if not 'abspath' in dir(found_dir): - Logs.error('Unable to find pidl output directory %s' % - os.path.normpath(os.path.join(bld.curdir, output_dir))) - sys.exit(1) - - outdir = bld.path.find_dir(output_dir).abspath(t.env) - - if symlink and not os.path.lexists(outdir): - link_source = os.path.normpath(os.path.join(bld.curdir,output_dir)) - os.symlink(link_source, outdir) - - real_outputdir = os.path.realpath(outdir) - t.env.OUTPUTDIR = os_path_relpath(real_outputdir, os.path.dirname(bld.env.BUILD_DIRECTORY)) + t.env.OUTPUTDIR = bld.bldnode.name + '/' + bld.path.find_dir(output_dir).bldpath(t.env) if generate_tables and table_header_idx is not None: pidl_headers = LOCAL_CACHE(bld, 'PIDL_HEADERS') @@ -124,11 +103,10 @@ Build.BuildContext.SAMBA_PIDL = SAMBA_PIDL def SAMBA_PIDL_LIST(bld, name, source, options='', output_dir='.', - symlink=False, generate_tables=True): '''A wrapper for building a set of IDL files''' for p in TO_LIST(source): - bld.SAMBA_PIDL(name, p, options=options, output_dir=output_dir, symlink=symlink, generate_tables=generate_tables) + bld.SAMBA_PIDL(name, p, options=options, output_dir=output_dir, generate_tables=generate_tables) Build.BuildContext.SAMBA_PIDL_LIST = SAMBA_PIDL_LIST -- 1.7.11.7 From b5aed614bfe6da2c4034773291ad619e610f1115 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 23 Oct 2012 17:31:03 +1100 Subject: [PATCH 37/39] lib/replace: Fix configure on FreeBSD: define_ret is not correct here define_ret is for when the output of the compiled and run program should be put into the configure define. This is not the case here. Andrew Bartlett --- lib/replace/wscript | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/replace/wscript b/lib/replace/wscript index 2e1dd65..5249e40 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -217,7 +217,6 @@ def configure(conf): msg="Checking correct behavior of strtoll", headers = 'errno.h', execute = True, - define_ret = True, define = 'HAVE_BSD_STRTOLL', ) conf.CHECK_FUNCS('if_nametoindex strerror_r') -- 1.7.11.7 From dc3c774da1c3b67b0928584fd53cbfd991a72025 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 23 Oct 2012 17:14:43 +1100 Subject: [PATCH 38/39] lib/replace: Fix detection of rpcsrv/yp_prot.h on FreeBSD --- lib/replace/wscript | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/replace/wscript b/lib/replace/wscript index 5249e40..e4a0871 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -79,7 +79,10 @@ def configure(conf): conf.CHECK_HEADERS('rpcsvc/nis.h rpcsvc/ypclnt.h sys/prctl.h 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 rpcsvc/yp_prot.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') -- 1.7.11.7 From ba860658c36984f765cc2dd91326303f1fe77484 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 24 Sep 2012 06:03:31 +1000 Subject: [PATCH 39/39] lib/replace: Improve mkstemp test in autoconf and waf On the Sernet-solaris8 host, this test passed in the autoconf build, then failed in the recursive waf build. This newer test should probe the behaviour more closely, by checking we get two distinct, secure files. Andrew Bartlett --- lib/replace/libreplace.m4 | 21 ++++++++++++++++++--- lib/replace/wscript | 17 ++++++++++++++++- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/lib/replace/libreplace.m4 b/lib/replace/libreplace.m4 index d298b92..796069c 100644 --- a/lib/replace/libreplace.m4 +++ b/lib/replace/libreplace.m4 @@ -212,12 +212,27 @@ AC_TRY_RUN([#include #include main() { struct stat st; - char tpl[20]="/tmp/test.XXXXXX"; - int fd = mkstemp(tpl); - if (fd == -1) exit(1); + char tpl[20]="/tmp/test.XXXXXX"; + char tpl2[20]="/tmp/test.XXXXXX"; + int fd = mkstemp(tpl); + int fd2 = mkstemp(tpl2); + if (fd == -1) { + if (fd2 != -1) { + unlink(tpl2); + } + exit(1); + } + if (fd2 == -1) exit(1); unlink(tpl); + unlink(tpl2); if (fstat(fd, &st) != 0) exit(1); if ((st.st_mode & 0777) != 0600) exit(1); + if (strcmp(tpl, "/tmp/test.XXXXXX") == 0) { + exit(1); + } + if (strcmp(tpl, tpl2) == 0) { + exit(1); + } exit(0); }], libreplace_cv_HAVE_SECURE_MKSTEMP=yes, diff --git a/lib/replace/wscript b/lib/replace/wscript index e4a0871..25a9d20 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -412,11 +412,26 @@ removeea setea conf.CHECK_CODE(''' struct stat st; char tpl[20]="/tmp/test.XXXXXX"; + char tpl2[20]="/tmp/test.XXXXXX"; int fd = mkstemp(tpl); - if (fd == -1) exit(1); + int fd2 = mkstemp(tpl2); + if (fd == -1) { + if (fd2 != -1) { + unlink(tpl2); + } + exit(1); + } + if (fd2 == -1) exit(1); unlink(tpl); + unlink(tpl2); if (fstat(fd, &st) != 0) exit(1); if ((st.st_mode & 0777) != 0600) exit(1); + if (strcmp(tpl, "/tmp/test.XXXXXX") == 0) { + exit(1); + } + if (strcmp(tpl, tpl2) == 0) { + exit(1); + } exit(0); ''', define='HAVE_SECURE_MKSTEMP', -- 1.7.11.7