From df84d23467f30f09ef725fce23bf9b3fa4fb0eec Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Thu, 19 May 2011 09:58:09 +0200 Subject: [PATCH 1/2] Set _GNU_SOURCE globally --- configure.ac | 4 ++++ src/confdb/confdb.c | 3 +-- src/external/platform.m4 | 3 +-- src/krb5_plugin/sssd_krb5_locator_plugin.c | 4 +++- src/monitor/monitor.c | 1 - src/responder/common/responder_common.c | 4 +--- src/sss_client/common.c | 4 +--- src/sss_client/pam_sss.c | 4 ---- src/tools/selinux.c | 1 - src/util/crypto/libcrypto/crypto_sha512crypt.c | 1 - src/util/crypto/nss/nss_obfuscate.c | 4 ++-- src/util/crypto/nss/nss_sha512crypt.c | 3 ++- src/util/debug.c | 3 ++- src/util/server.c | 1 - 14 files changed, 17 insertions(+), 23 deletions(-) diff --git a/configure.ac b/configure.ac index b96c42a..a31f97d 100644 --- a/configure.ac +++ b/configure.ac @@ -17,6 +17,10 @@ AC_INIT([sssd], VERSION_NUMBER, [sssd-devel@lists.fedorahosted.org]) +m4_ifdef([AC_USE_SYSTEM_EXTENSIONS], + [AC_USE_SYSTEM_EXTENSIONS], + [AC_GNU_SOURCE]) + CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE" AC_CONFIG_SRCDIR([BUILD.txt]) diff --git a/src/confdb/confdb.c b/src/confdb/confdb.c index 87d33f9..3f668dd 100644 --- a/src/confdb/confdb.c +++ b/src/confdb/confdb.c @@ -19,10 +19,9 @@ along with this program. If not, see . */ -#define _GNU_SOURCE +#include "config.h" #include -#include "config.h" #include "util/util.h" #include "confdb/confdb.h" #include "confdb/confdb_private.h" diff --git a/src/external/platform.m4 b/src/external/platform.m4 index 051fe07..c67e081 100644 --- a/src/external/platform.m4 +++ b/src/external/platform.m4 @@ -37,8 +37,7 @@ AM_CONDITIONAL([HAVE_DEBIAN], [test x"$osname" = xdebian]) AM_CONDITIONAL([HAVE_GENTOO], [test x"$osname" = xgentoo]) AC_CHECK_MEMBERS([struct ucred.pid, struct ucred.uid, struct ucred.gid], , , - [[#define _GNU_SOURCE - #include ]]) + [[#include ]]) if test x"$ac_cv_member_struct_ucred_pid" = xyes -a \ x"$ac_cv_member_struct_ucred_uid" = xyes -a \ diff --git a/src/krb5_plugin/sssd_krb5_locator_plugin.c b/src/krb5_plugin/sssd_krb5_locator_plugin.c index a4dc31c..d6e90a7 100644 --- a/src/krb5_plugin/sssd_krb5_locator_plugin.c +++ b/src/krb5_plugin/sssd_krb5_locator_plugin.c @@ -17,7 +17,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#define _GNU_SOURCE + +#include "config.h" + #include #include #include diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c index 59ffeb3..5559bd9 100644 --- a/src/monitor/monitor.c +++ b/src/monitor/monitor.c @@ -19,7 +19,6 @@ along with this program. If not, see . */ -#define _GNU_SOURCE #include #include #include diff --git a/src/responder/common/responder_common.c b/src/responder/common/responder_common.c index 37761ae..c8647e0 100644 --- a/src/responder/common/responder_common.c +++ b/src/responder/common/responder_common.c @@ -19,8 +19,7 @@ along with this program. If not, see . */ -/* for struct ucred */ -#define _GNU_SOURCE +#include "config.h" #include #include @@ -33,7 +32,6 @@ #include #include #include -#include "config.h" #include "util/util.h" #include "db/sysdb.h" #include "confdb/confdb.h" diff --git a/src/sss_client/common.c b/src/sss_client/common.c index c8a9515..b603305 100644 --- a/src/sss_client/common.c +++ b/src/sss_client/common.c @@ -23,8 +23,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* for struct ucred */ -#define _GNU_SOURCE +#include "config.h" #include #include @@ -43,7 +42,6 @@ #include #define _(STRING) dgettext (PACKAGE, STRING) -#include "config.h" #include "sss_cli.h" #if HAVE_PTHREAD diff --git a/src/sss_client/pam_sss.c b/src/sss_client/pam_sss.c index 66de232..d54c025 100644 --- a/src/sss_client/pam_sss.c +++ b/src/sss_client/pam_sss.c @@ -24,10 +24,6 @@ #define PAM_SM_SESSION #define PAM_SM_PASSWORD -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif - #include #include #include diff --git a/src/tools/selinux.c b/src/tools/selinux.c index 647fc17..45672d1 100644 --- a/src/tools/selinux.c +++ b/src/tools/selinux.c @@ -21,7 +21,6 @@ #include "config.h" -#define _GNU_SOURCE #include #ifdef HAVE_SELINUX diff --git a/src/util/crypto/libcrypto/crypto_sha512crypt.c b/src/util/crypto/libcrypto/crypto_sha512crypt.c index 29900cc..5073431 100644 --- a/src/util/crypto/libcrypto/crypto_sha512crypt.c +++ b/src/util/crypto/libcrypto/crypto_sha512crypt.c @@ -10,7 +10,6 @@ /* SHA512-based Unix crypt implementation. Released into the Public Domain by Ulrich Drepper . */ -#define _GNU_SOURCE #include #include #include diff --git a/src/util/crypto/nss/nss_obfuscate.c b/src/util/crypto/nss/nss_obfuscate.c index bd8688e..cbd8984 100644 --- a/src/util/crypto/nss/nss_obfuscate.c +++ b/src/util/crypto/nss/nss_obfuscate.c @@ -183,13 +183,13 @@ done: static int nss_encrypt_decrypt_init(TALLOC_CTX *mem_ctx, struct crypto_mech_data *mech_props, - bool encrypt, + bool do_encrypt, struct sss_nss_crypto_ctx *cctx) { CK_ATTRIBUTE_TYPE op; int ret; - op = encrypt ? CKA_ENCRYPT : CKA_DECRYPT; + op = do_encrypt ? CKA_ENCRYPT : CKA_DECRYPT; /* turn the raw key into a key object */ cctx->keyobj = PK11_ImportSymKey(cctx->slot, mech_props->cipher, diff --git a/src/util/crypto/nss/nss_sha512crypt.c b/src/util/crypto/nss/nss_sha512crypt.c index 514e4d9..76eb8a6 100644 --- a/src/util/crypto/nss/nss_sha512crypt.c +++ b/src/util/crypto/nss/nss_sha512crypt.c @@ -8,7 +8,8 @@ /* SHA512-based Unix crypt implementation. Released into the Public Domain by Ulrich Drepper . */ -#define _GNU_SOURCE +#include "config.h" + #include #include #include diff --git a/src/util/debug.c b/src/util/debug.c index dbd54c1..18bfda4 100644 --- a/src/util/debug.c +++ b/src/util/debug.c @@ -19,7 +19,8 @@ along with this program. If not, see . */ -#define _GNU_SOURCE +#include "config.h" + #include #include #include diff --git a/src/util/server.c b/src/util/server.c index e126237..d33c5cb 100644 --- a/src/util/server.c +++ b/src/util/server.c @@ -23,7 +23,6 @@ along with this program. If not, see . */ -#define _GNU_SOURCE #include #include #include -- 1.7.5.1