From 74f2e8d978dc1cfe4b4ef6158e3c0ca232a6cd2e 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/50] wafbuild: check for dn_expand also in libinet see bug #7472 --- source3/wscript | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) 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.7 From 4a040da744dcc3179f9bf85c7b1cfced97c985de 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/50] autoconf: check for dn_expand also in libinet see bug #7472 --- source3/configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) 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.7 From 47cbf54cec3278386c720ea56371cf88f5c5d05c 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/50] 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 files changed, 1 insertions(+), 1 deletions(-) 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.7 From 647830c7d3d1083a8e448791d81aa0c81daf1c18 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 24 Sep 2012 06:03:31 +1000 Subject: [PATCH 04/50] 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 (cherry picked from commit 0727ad73212ff3cfe7e78249504b0209e082d7c4) --- 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 0dbac06..f230160 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -401,11 +401,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.7 From 1ded192f4cc49f9170efd84bd4d9c98e51b21bb5 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 24 Sep 2012 06:45:05 +1000 Subject: [PATCH 05/50] lib/replace: Look for special flags needed for c99 This is normally handled by the waf core, but for HP-UX we currently fail. The autoconf code hard-codes a case for HP-UX, but I want to try testing it using a generic system first. Andrew Bartlett (cherry picked from commit 2e51c386beff808e74c8c1f360a6f4db30fe74b5) --- lib/replace/wscript | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/lib/replace/wscript b/lib/replace/wscript index f230160..f1f1cef 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -43,6 +43,16 @@ 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 C99 initialisers + for f in ["", "-AC99", "-qlanglvl=extc99", "-qlanglvl=stdc99", "-c99"]: + if conf.CHECK_CFLAGS([f], ''' +struct foo {int x;char y;}; +struct foo bar = { .y = 'X', .x = 1 }; +'''): + if f != "": + conf.ADD_CFLAGS(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.7 From 13089f7c41070fbe1e1e472ae00760a4d585e9e6 Mon Sep 17 00:00:00 2001 From: Ira Cooper Date: Thu, 20 Sep 2012 19:38:12 +0000 Subject: [PATCH 06/50] 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 files 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.7 From 2969547cc11eda0651461f894632dbdbd586c39b Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 21 Sep 2012 21:57:22 -0700 Subject: [PATCH 07/50] build: Try not build with LDAP if we do not have ldap.h --- source3/wscript | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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.7 From 1009e242570c7b333493d5469b99de69e0d1d376 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 21 Sep 2012 22:27:24 -0700 Subject: [PATCH 08/50] 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.7 From 16026365be05032124ef8712fc4c9b4c705bf3d4 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 23 Sep 2012 13:57:44 +1000 Subject: [PATCH 09/50] build: Remove unused IRIX and IRIX6 defines --- source3/configure.in | 7 +------ 1 files changed, 1 insertions(+), 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.7 From 3da347e377ed0144e23caedd979fed62e735e6f7 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 23 Sep 2012 14:25:00 +1000 Subject: [PATCH 10/50] 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, 0 insertions(+), 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.7 From 1344646a7e5697155943578acd9eff1805e7f9cd Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 23 Sep 2012 14:30:10 +1000 Subject: [PATCH 11/50] 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 files 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.7 From 39fd9353f7cc2f7841b5127041118dcf725f1aa9 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 23 Sep 2012 14:30:37 +1000 Subject: [PATCH 12/50] build: Make waf configure match autoconf for HPUX ACLs --- source3/wscript | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) 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.7 From 69e5ad9bd13b774716a39fe07f8cd45905bcf3df Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 23 Sep 2012 14:35:58 +1000 Subject: [PATCH 13/50] 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 insertions(+), 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.7 From 53520972bf27254854064c5a6b4690970b33f91c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 23 Sep 2012 14:37:24 +1000 Subject: [PATCH 14/50] 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 files changed, 1 insertions(+), 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.7 From 51434f12541bfe0c0eff36c1175b418485f33621 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 24 Sep 2012 07:06:53 +1000 Subject: [PATCH 15/50] build: Add missing dep on tdb_compat --- source4/ntvfs/posix/wscript_build | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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.7 From c9e667c56013656101d1ac43fc3dfc768320a02c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 24 Sep 2012 18:02:01 +1000 Subject: [PATCH 16/50] 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 files changed, 1 insertions(+), 1 deletions(-) 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.7 From a40f45646e4d8c083b4f2291cc3c8213a22fd920 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 26 Sep 2012 07:41:38 +1000 Subject: [PATCH 17/50] lib/util/charset: Try to find iconv on HP-UX --- lib/util/charset/wscript_configure | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) 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.7 From 6d048c692d06c3cf638b0668251244edb5b57fd1 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 26 Sep 2012 08:10:29 +1000 Subject: [PATCH 18/50] 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 insertions(+), 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.7 From f8e128016b303209b05470afc7c9e597d40fe271 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 26 Sep 2012 12:33:13 +1000 Subject: [PATCH 19/50] build: Add waf configure support for non-linux quotas --- source3/wscript | 39 ++++++++++++++++++++++++++++++++++++++- 1 files changed, 38 insertions(+), 1 deletions(-) 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.7 From 44336aee48c2dd06c825fbf6416f5bcc3aa95800 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 26 Sep 2012 12:33:50 +1000 Subject: [PATCH 20/50] build: Remove unused samba_cv_sysquotas_file variable from autoconf configure --- source3/configure.in | 3 --- 1 files changed, 0 insertions(+), 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.7 From 8ba6be67e76034bfaeb364a0c69b23615ed2c059 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 26 Sep 2012 12:42:15 +1000 Subject: [PATCH 21/50] build: Set HAVE_SYS_QUOTAS and WITH_QUOTAS if we have any supported sysquota backend --- source3/wscript | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) 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.7 From 528c9fc34212af9d8fe0f3678080f9e76319792a Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 26 Sep 2012 13:10:17 +1000 Subject: [PATCH 22/50] build: Remove unused --with-sys-quotas option --- source3/wscript | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) 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.7 From ccb96ee0cbb595d0d0f19fbb8ac0fe643ac65b4c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 26 Sep 2012 18:09:20 +1000 Subject: [PATCH 23/50] 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 files changed, 16 insertions(+), 0 deletions(-) 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.7 From 6d6cf39fb989e721476253fd70f8eab3a5c29801 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 29 Sep 2012 14:36:41 +1000 Subject: [PATCH 24/50] lib/replace: Add test for what flag we need for -Werror behaviour (cherry picked from commit 931ed2509d93110b525f763ffb15ee3feff87fa0) --- lib/replace/wscript | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/lib/replace/wscript b/lib/replace/wscript index f1f1cef..732c664 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -53,6 +53,15 @@ struct foo bar = { .y = 'X', .x = 1 }; conf.ADD_CFLAGS(f) break + # 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.7 From 1ff3c5ae73375c482880fb2af5d3cbe7b9ab439e Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 29 Sep 2012 14:28:57 +1000 Subject: [PATCH 25/50] 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/wscript | 13 +++++++------ {source3/tests => tests}/sysquotas.c | 4 ++-- 3 files changed, 11 insertions(+), 10 deletions(-) rename {source3/tests => tests}/sysquotas.c (99%) 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/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/source3/tests/sysquotas.c b/tests/sysquotas.c similarity index 99% rename from source3/tests/sysquotas.c rename to tests/sysquotas.c index 1544dca..afec3f1 100644 --- a/source3/tests/sysquotas.c +++ b/tests/sysquotas.c @@ -42,7 +42,7 @@ extern int quotactl(int cmd, const char *special, uid_t uid, void *addr); struct SYS_DQBLK D; ret = quotactl(Q_GETQUOTA,"/dev/hda1",0,(void *)&D); - + return ret; } @@ -84,7 +84,7 @@ extern int quotactl(int cmd, const char *special, uid_t uid, void *addr); #endif int main(void) -{ +{ autoconf_quota(); return 0; } -- 1.7.7 From 914159c8bc3a4e8bc6db5259caffbfb84017c73e Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 29 Sep 2012 14:31:28 +1000 Subject: [PATCH 26/50] 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 files changed, 0 insertions(+), 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.7 From 5f8d57407190852ec901fd6c198302a7887f386d Mon Sep 17 00:00:00 2001 From: Ira Cooper Date: Sun, 30 Sep 2012 19:02:13 +0000 Subject: [PATCH 27/50] 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 | 19 +++++++++++++------ 2 files changed, 19 insertions(+), 6 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' ) +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') -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.7 From f4581f3bb1d0e7867de41595ec74fb5a5a57dbd8 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Tue, 2 Oct 2012 14:53:38 +0300 Subject: [PATCH 28/50] 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.7 From 4ffd5244475b7f3b21a369f2eea2ec66f17028e4 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 3 Oct 2012 16:36:34 +1000 Subject: [PATCH 29/50] 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.7 From 1ccce5281ab573ab43d7426a80abf274f2348453 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 2 Oct 2012 08:12:16 +1000 Subject: [PATCH 30/50] nsswitch: Build nss_winbind on all supported platforms This matches what the autoconf build can do. Andrew Bartlett --- nsswitch/wscript_build | 59 +++++++++++++++++++++++++++++++++++++++-------- 1 files 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.7 From cce83c96d1aade821af9ea1d7dca37dbef40fa92 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 10 Oct 2012 12:44:14 +1100 Subject: [PATCH 31/50] build: Add vfs_media_harmony to the waf build --- source3/modules/wscript_build | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) 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.7 From 1b7076582f4c01c75cd4541a8003ecc5a6015377 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 10 Oct 2012 21:20:24 +1100 Subject: [PATCH 32/50] 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.7 From 9b41aa701dbd20f8ba673d9b7ba2262c9ff0121a Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 17 Oct 2012 18:03:55 +0200 Subject: [PATCH 33/50] 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 files changed, 2 insertions(+), 0 deletions(-) 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.7 From 3a3dbb228778afa8f00c22fe5bde13d9f8972576 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 17 Oct 2012 18:16:15 +0200 Subject: [PATCH 34/50] waf: Create a libnss_winbind.so symlink. This fixes bug #9299. --- nsswitch/wscript_build | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) 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.7 From 85639a0e4a09e8cd54c35340d0d56ad79e2a8230 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 17 Oct 2012 18:17:27 +0200 Subject: [PATCH 35/50] 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 files changed, 1 insertions(+), 0 deletions(-) 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.7 From 12dfc7c41a0b04f19461a535a620e65b551b0ff1 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 23 Oct 2012 17:53:58 +1100 Subject: [PATCH 36/50] 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 files changed, 1 insertions(+), 0 deletions(-) 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.7 From 8124f4fcb97975444e738ee0f3c87822c4901703 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 23 Oct 2012 15:53:17 +0200 Subject: [PATCH 37/50] 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 files changed, 3 insertions(+), 0 deletions(-) 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.7 From cca231ec3fad0864288d3fcd8d4fedf390ba1050 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 28 Oct 2012 19:38:10 +1100 Subject: [PATCH 38/50] 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 files 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.7 From a77ff573e80aceff68d0d79cb87a4e81766066e7 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 28 Oct 2012 19:57:58 +1100 Subject: [PATCH 39/50] pidl: Remove depends_on=PIDL_MISC as it sets -I/ into CFLAGS This in turn causes an include of to hang on some systems, as /net/ means to run the automounter! Andrew Bartlett Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Mon Oct 29 01:23:39 CET 2012 on sn-devel-104 (cherry picked from commit aa411045a5ee52d440ccb259a37c6c7489099884) --- librpc/wscript_build | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/librpc/wscript_build b/librpc/wscript_build index ee8483b..0eeb01b 100644 --- a/librpc/wscript_build +++ b/librpc/wscript_build @@ -632,7 +632,6 @@ bld.SAMBA_LIBRARY('ndr', public_deps='errors talloc samba-util', public_headers='gen_ndr/misc.h gen_ndr/ndr_misc.h ndr/libndr.h:ndr.h', header_path= [('*gen_ndr*', 'gen_ndr')], - depends_on='PIDL_MISC', vnum='0.0.1', abi_directory='ABI', abi_match='ndr_* GUID_*', -- 1.7.7 From eb3cea941cb4c59fcb21837006d1461b7c6972be Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 23 Oct 2012 17:31:03 +1100 Subject: [PATCH 40/50] 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 files changed, 0 insertions(+), 1 deletions(-) diff --git a/lib/replace/wscript b/lib/replace/wscript index 732c664..29d1922 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -227,7 +227,6 @@ struct foo bar = { .y = 'X', .x = 1 }; 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.7 From e76ef27376f4e9ae35b3011ad2bfa8c85ca1d821 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 23 Oct 2012 17:14:43 +1100 Subject: [PATCH 41/50] lib/replace: Fix detection of rpcsrv/yp_prot.h on FreeBSD --- lib/replace/wscript | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/lib/replace/wscript b/lib/replace/wscript index 29d1922..c21a8f8 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -89,7 +89,10 @@ struct foo bar = { .y = 'X', .x = 1 }; 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.7 From 47668fe30acc9ebd7da926e4f0b42aa2aa2f91db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Jacke?= Date: Tue, 30 Oct 2012 11:32:52 +0100 Subject: [PATCH 42/50] wfabuild: fix the -errwarn compile flag test as in the autoconf build this must be "-errwarn=%all" (cherry picked from commit 0342ca40629d5a57db02c7f840809dfa0bde6780) --- lib/replace/wscript | 2 +- lib/util/util_net.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/lib/replace/wscript b/lib/replace/wscript index c21a8f8..7c2d519 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -54,7 +54,7 @@ struct foo bar = { .y = 'X', .x = 1 }; break # Try to find the right extra flags for -Werror behaviour - for f in ["-Werror", "-w2", "-errwarn"]: + for f in ["-Werror", "-w2", "-errwarn=%all"]: if conf.CHECK_CFLAGS([f], ''' '''): if not 'WERROR_CFLAGS' in conf.env: diff --git a/lib/util/util_net.c b/lib/util/util_net.c index 83afda4..536c0a4 100644 --- a/lib/util/util_net.c +++ b/lib/util/util_net.c @@ -817,6 +817,9 @@ static const smb_socket_option socket_options[] = { #ifdef TCP_QUICKACK {"TCP_QUICKACK", IPPROTO_TCP, TCP_QUICKACK, 0, OPT_BOOL}, #endif +#ifdef TCP_FASTOPEN + {"TCP_FASTOPEN", IPPROTO_TCP, TCP_FASTOPEN, 0, OPT_BOOL}, +#endif #ifdef TCP_NODELAYACK {"TCP_NODELAYACK", IPPROTO_TCP, TCP_NODELAYACK, 0, OPT_BOOL}, #endif -- 1.7.7 From d45b55db88cf431827f9605735f7c345f237bae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Jacke?= Date: Tue, 30 Oct 2012 11:37:34 +0100 Subject: [PATCH 43/50] wafbuild: merge the missing IBM compiler Werror flag "-qhalt=w" to waf (cherry picked from commit 51692042d9f898c5e8f1cbc78031e37d23ec032a) --- lib/replace/wscript | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/replace/wscript b/lib/replace/wscript index 7c2d519..8d97f5b 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -54,7 +54,7 @@ struct foo bar = { .y = 'X', .x = 1 }; break # Try to find the right extra flags for -Werror behaviour - for f in ["-Werror", "-w2", "-errwarn=%all"]: + for f in ["-Werror", "-w2", "-errwarn=%all", "-qhalt=w"]: if conf.CHECK_CFLAGS([f], ''' '''): if not 'WERROR_CFLAGS' in conf.env: -- 1.7.7 From 091a98fc6d6722a3a69a5c8ed05d6018dadb5a27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Jacke?= Date: Tue, 30 Oct 2012 11:48:25 +0100 Subject: [PATCH 44/50] wafbuild: reorder the Werror checks so that the ambigous w2 option is being checked last (cherry picked from commit 7fcb2532b99ddf65d78dd02ea06ce8a1a6229949) --- lib/replace/wscript | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/lib/replace/wscript b/lib/replace/wscript index 8d97f5b..9a6be20 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -54,7 +54,11 @@ struct foo bar = { .y = 'X', .x = 1 }; break # Try to find the right extra flags for -Werror behaviour - for f in ["-Werror", "-w2", "-errwarn=%all", "-qhalt=w"]: + for f in ["-Werror", # GCC + "-errwarn=%all", # Sun Studio + "-qhalt=w", # IBM xlc + "-w2", # Tru64 + ]: if conf.CHECK_CFLAGS([f], ''' '''): if not 'WERROR_CFLAGS' in conf.env: -- 1.7.7 From 31993a415ccfb26acfb4fc61ef3a9ced63d41fe0 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sun, 14 Oct 2012 16:05:58 +1030 Subject: [PATCH 45/50] ccan: check for all the used config.h defines In particular, not checking for byteswap.h meant we defined duplicates: https://bugzilla.samba.org/show_bug.cgi?id=9286 Signed-off-by: Rusty Russell Autobuild-User(master): Rusty Russell Autobuild-Date(master): Wed Oct 17 01:55:14 CEST 2012 on sn-devel-104 (cherry picked from commit 029654897d721308c9ee782aee420abddce7edee) --- lib/ccan/libccan.m4 | 16 ++++++++++++++++ lib/ccan/wscript | 21 +++++++++++++++++++++ 2 files changed, 37 insertions(+), 0 deletions(-) diff --git a/lib/ccan/libccan.m4 b/lib/ccan/libccan.m4 index 0d391ad..7b27c69 100644 --- a/lib/ccan/libccan.m4 +++ b/lib/ccan/libccan.m4 @@ -23,6 +23,8 @@ AC_SUBST(CCAN_CFLAGS) # fairly harmless. AC_CHECK_HEADERS(err.h) +AC_CHECK_HEADERS(byteswap.h) + AC_CACHE_CHECK([whether we can compile with __attribute__((cold))], samba_cv_attribute_cold, [ @@ -270,6 +272,19 @@ if test x"$samba_cv_compound_literals" = xyes ; then [whether we have compound literals]) fi +AC_CACHE_CHECK([whether we have flexible array members], + samba_cv_have_flex_arr_member, + [ + AC_COMPILE_IFELSE([AC_LANG_SOURCE( + [struct foo { unsigned int x; int arr@<:@@:>@; }; ])], + samba_cv_have_flex_arr_member=yes) + ]) + +if test x"$samba_cv_have_flex_arr_member" = xyes ; then + AC_DEFINE(HAVE_FLEXIBLE_ARRAY_MEMBER, 1, + [whether we have flexible array member support]) +fi + AC_CACHE_CHECK([whether we have isblank], samba_cv_have_isblank, [ @@ -331,3 +346,4 @@ if test x"$samba_cv_warn_unused_result" = xyes ; then AC_DEFINE(HAVE_WARN_UNUSED_RESULT, 1, [whether we have __attribute__((warn_unused_result))]) fi +AC_HAVE_DECL(bswap_64, [#include ]) diff --git a/lib/ccan/wscript b/lib/ccan/wscript index be5eab2..523b2c9 100644 --- a/lib/ccan/wscript +++ b/lib/ccan/wscript @@ -5,6 +5,9 @@ import Logs, sys, Options def configure(conf): conf.DEFINE('HAVE_CCAN', 1) conf.CHECK_HEADERS('err.h') + conf.CHECK_HEADERS('byteswap.h') + conf.CHECK_FUNCS('bswap_64', link=False, headers="byteswap.h") + # FIXME: if they don't have -Werror, these will all fail. But they # probably will anyway... conf.CHECK_CODE('int __attribute__((cold)) func(int x) { return x; }', @@ -107,6 +110,9 @@ def configure(conf): define='HAVE_BUILTIN_TYPES_COMPATIBLE_P') conf.CHECK_CODE('int *foo = (int[]) { 1, 2, 3, 4 }; return foo[0] ? 0 : 1;', define='HAVE_COMPOUND_LITERALS') + conf.CHECK_CODE('struct foo { unsigned int x; int arr[]; };', + addmain=False, link=False, + define='HAVE_FLEXIBLE_ARRAY_MEMBER') conf.CHECK_CODE("""#include int main(void) { return isblank(' ') ? 0 : 1; }""", link=True, addmain=False, add_headers=False, @@ -121,6 +127,21 @@ def configure(conf): # backtrace could be in libexecinfo or in libc conf.CHECK_FUNCS_IN('backtrace backtrace_symbols', 'execinfo', checklibc=True, headers='execinfo.h') + # Only check for FILE_OFFSET_BITS=64 if off_t is normally small: + # use raw routines because wrappers include previous _GNU_SOURCE + # or _FILE_OFFSET_BITS defines. + conf.check(fragment="""#include + int main(void) { return !(sizeof(off_t) < 8); }""", + execute=True, msg='Checking for small off_t', + define_name='SMALL_OFF_T') + # Unreliable return value above, hence use define. + if conf.CONFIG_SET('SMALL_OFF_T'): + conf.check(fragment="""#include + int main(void) { return !(sizeof(off_t) >= 8); }""", + execute=True, msg='Checking for -D_FILE_OFFSET_BITS=64', + ccflags='-D_FILE_OFFSET_BITS=64', + define_name='HAVE_FILE_OFFSET_BITS') + def ccan_module(bld, name, deps=''): bld.SAMBA_SUBSYSTEM('ccan-%s' % name, source=bld.path.ant_glob('%s/*.c' % name), -- 1.7.7 From 0ce2f3256b100d39a30af92dbf4ac6e33930006b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Jacke?= Date: Tue, 30 Oct 2012 12:07:26 +0100 Subject: [PATCH 46/50] ccan/wafbuild: use WERROR_CFLAGS instead of -Werror (cherry picked from commit fdead585dc11101761ac975935134c6a84ea3b4f) --- lib/ccan/wscript | 17 +++++++---------- 1 files changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/ccan/wscript b/lib/ccan/wscript index 523b2c9..10eeb31 100644 --- a/lib/ccan/wscript +++ b/lib/ccan/wscript @@ -7,26 +7,23 @@ def configure(conf): conf.CHECK_HEADERS('err.h') conf.CHECK_HEADERS('byteswap.h') conf.CHECK_FUNCS('bswap_64', link=False, headers="byteswap.h") - - # FIXME: if they don't have -Werror, these will all fail. But they - # probably will anyway... conf.CHECK_CODE('int __attribute__((cold)) func(int x) { return x; }', - addmain=False, link=False, cflags="-Werror", + addmain=False, link=False, cflags=conf.env['WERROR_CFLAGS'], define='HAVE_ATTRIBUTE_COLD') conf.CHECK_CODE('int __attribute__((const)) func(int x) { return x; }', - addmain=False, link=False, cflags="-Werror", + addmain=False, link=False, cflags=conf.env['WERROR_CFLAGS'], define='HAVE_ATTRIBUTE_CONST') conf.CHECK_CODE('void __attribute__((noreturn)) func(int x) { exit(x); }', - addmain=False, link=False, cflags="-Werror", + addmain=False, link=False, cflags=conf.env['WERROR_CFLAGS'], define='HAVE_ATTRIBUTE_NORETURN') conf.CHECK_CODE('void __attribute__((format(__printf__, 1, 2))) func(const char *fmt, ...) { }', - addmain=False, link=False, cflags="-Werror", + addmain=False, link=False, cflags=conf.env['WERROR_CFLAGS'], define='HAVE_ATTRIBUTE_PRINTF') conf.CHECK_CODE('int __attribute__((unused)) func(int x) { return x; }', - addmain=False, link=False, cflags="-Werror", + addmain=False, link=False, cflags=conf.env['WERROR_CFLAGS'], define='HAVE_ATTRIBUTE_UNUSED') conf.CHECK_CODE('int __attribute__((used)) func(int x) { return x; }', - addmain=False, link=False, cflags="-Werror", + addmain=False, link=False, cflags=conf.env['WERROR_CFLAGS'], define='HAVE_ATTRIBUTE_USED') # We try to use headers for a compile-time test. conf.CHECK_CODE(code = """#ifdef __BYTE_ORDER @@ -121,7 +118,7 @@ def configure(conf): link=True, define='HAVE_TYPEOF') conf.CHECK_CODE('int __attribute__((warn_unused_result)) func(int x) { return x; }', - addmain=False, link=False, cflags="-Werror", + addmain=False, link=False, cflags=conf.env['WERROR_CFLAGS'], define='HAVE_WARN_UNUSED_RESULT') # backtrace could be in libexecinfo or in libc -- 1.7.7 From a39bed9d6adac2bbd0270f42f0473f129fa67fa0 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 23 Sep 2012 13:20:45 +1000 Subject: [PATCH 47/50] ntdb: Try to fix the build on Solaris which does not have err (cherry picked from commit 08d3062fc3ece6b5d98e32bad5f1d54c088b0dd0) --- lib/ccan/wscript | 2 +- lib/ntdb/wscript | 2 +- lib/replace/replace-testsuite.h | 13 +++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 lib/replace/replace-testsuite.h diff --git a/lib/ccan/wscript b/lib/ccan/wscript index 10eeb31..59b8205 100644 --- a/lib/ccan/wscript +++ b/lib/ccan/wscript @@ -165,11 +165,11 @@ def build(bld): ccan_module(bld, 'endian') ccan_module(bld, 'likely', 'ccan-str') ccan_module(bld, 'typesafe_cb') + ccan_module(bld, 'err', 'ccan-compiler') # Failtest pulls in a lot of stuff, and it's only for unit tests. if bld.env.DEVELOPER_MODE: ccan_module(bld, 'container_of', 'ccan-check_type') - ccan_module(bld, 'err', 'ccan-compiler') ccan_module(bld, 'htable', 'ccan-compiler') ccan_module(bld, 'list', 'ccan-container_of') ccan_module(bld, 'time') diff --git a/lib/ntdb/wscript b/lib/ntdb/wscript index 39802db..1a4b02b 100644 --- a/lib/ntdb/wscript +++ b/lib/ntdb/wscript @@ -155,7 +155,7 @@ def build(bld): bld.SAMBA_BINARY('ntdbtorture', 'tools/ntdbtorture.c', - deps='ntdb', + deps='ntdb ccan-err', install=False) bld.SAMBA_BINARY('ntdbtool', diff --git a/lib/replace/replace-testsuite.h b/lib/replace/replace-testsuite.h new file mode 100644 index 0000000..a522853 --- /dev/null +++ b/lib/replace/replace-testsuite.h @@ -0,0 +1,13 @@ +#ifndef __LIB_REPLACE_REPLACE_TEST_H__ +#define __LIB_REPLACE_REPLACE_TEST_H__ + +#include +struct torture_context; + +bool torture_local_replace(struct torture_context *ctx); +int libreplace_test_strptime(void); +int test_readdir_os2_delete(void); +int getifaddrs_test(void); + +#endif /* __LIB_REPLACE_REPLACE_TEST_H__ */ + -- 1.7.7 From e95c162a4f386d64dbd21653a39317960cfc25f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Jacke?= Date: Tue, 30 Oct 2012 12:19:24 +0100 Subject: [PATCH 48/50] wafbuild: use WERROR_FLAGS in wscript_configure_system_mitkrb5 (cherry picked from commit 9a03cc93f45a6908c73afe2d059a4ebf5534fdb7) --- wscript_configure_system_mitkrb5 | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wscript_configure_system_mitkrb5 b/wscript_configure_system_mitkrb5 index 31ed7f7..a62d00b 100644 --- a/wscript_configure_system_mitkrb5 +++ b/wscript_configure_system_mitkrb5 @@ -154,7 +154,7 @@ conf.CHECK_CODE(''' }''', 'HAVE_KRB5_ENCTYPE_TO_STRING_WITH_SIZE_T_ARG', headers='krb5.h', lib='krb5 k5crypto', - addmain=False, cflags='-Werror', + addmain=False, cflags=conf.env['WERROR_CFLAGS'], msg="Checking whether krb5_enctype_to_string takes size_t argument") conf.CHECK_CODE(''' @@ -167,7 +167,7 @@ conf.CHECK_CODE(''' }''', 'HAVE_KRB5_ENCTYPE_TO_STRING_WITH_KRB5_CONTEXT_ARG', headers='krb5.h stdlib.h', lib='krb5', - addmain=False, cflags='-Werror', + addmain=False, cflags=conf.env['WERROR_CFLAGS'], msg="Checking whether krb5_enctype_to_string takes krb5_context argument") conf.CHECK_CODE(''' int main(void) { -- 1.7.7 From b2a3b7f5f85c5ce335689f89bb12e7eac06f6287 Mon Sep 17 00:00:00 2001 From: Ricky Nance Date: Tue, 25 Sep 2012 01:10:42 -0500 Subject: [PATCH 49/50] wscript: Removed executable bit. Removed the executable for both wscript and wscript_build. (cherry picked from commit 6146b609e7add16a34067a4c40902f63d19fe5fe) --- 0 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 wscript mode change 100755 => 100644 wscript_build diff --git a/wscript b/wscript old mode 100755 new mode 100644 diff --git a/wscript_build b/wscript_build old mode 100755 new mode 100644 -- 1.7.7 From b30edd17c835d26e4b623fc7f61751b8abbb2fd4 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 23 Oct 2012 17:14:55 +1100 Subject: [PATCH 50/50] lib/replace: Fix detection of prctl (cherry picked from commit 80f42df4ec9194ff00aeeb3c2cf6acfa1f2ab5c3) The last 50 patches address bug #9339 - Build and quota fixes from master. --- source3/wscript | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/source3/wscript b/source3/wscript index 5bd5152..3e11715 100644 --- a/source3/wscript +++ b/source3/wscript @@ -266,6 +266,14 @@ __sys_llseek syslog _telldir __telldir textdomain timegm utimensat vsyslog _write __write __xstat ''') + conf.CHECK_CODE(''' +#ifdef HAVE_SYS_PRCTL_H +#include +#endif +int i; i = prtcl(0); +''', + 'HAVE_PRCTL', link=False) + conf.CHECK_SAMBA3_CHARSET() # see build/charset.py # FIXME: these should be tests for features, but the old build system just -- 1.7.7