Skip Menu |
 

Subject: Define _GNU_SOURCE as part of build
Download (untitled) / with headers
text/plain 2.4KiB
glibc's position on namespaces, at least under Ulrich Drepper's
leadership, was that everything not in POSIX should be off by default
unless it was present in ancient BSD and System V. Programs are
encouraged to define _GNU_SOURCE to enable extensions. See, for
example:

https://sourceware.org/bugzilla/show_bug.cgi?id=6775

This position has created at least three problems for us:

* asprintf is not declared in stdio.h by default (r19735; I suspect this
is only needed for Linux, but can't be certain).
* EAI_NODATA is not declared in netdb.h by default but can be returned
by getaddrinfo (#7526).
* ip6_pktinfo is not declared in netinet/in.h by default even though it
is on basically all other modern platforms (#7960).

Declaring _GNU_SOURCE has at least one negative consequence we must be
aware of: it causes a non-POSIX version of strerror_r to be declared.
There may be other consequences I'm not yet aware of. But it seems
plausible that in the long run, defining _GNU_SOURCE would solve more
problems than it creates. I am confident that _GNU_SOURCE creates no
ABI compatibility issues between libraries which use it and applications
which don't, so the issues would be limited to our own correctness.

We would need to define _GNU_SOURCE early in configure.in so that it is
available for configure tests. We can define it explicitly with
AC_DEFINE, we can use the deprecated AC_GNU_SOURCE, or we can use
AC_USE_SYSTEM_EXTENSIONS which would also define certain symbols on
other platforms as well. If we use the latter, we would need to test
the build on Solaris/FreeBSD/OS X. AC_USE_SYSTEM_EXTENSIONS is new in
autoconf 2.59c (we currently require 2.52).

A brief survey of other open-source software finds:

* Heimdal defines _GNU_SOURCE explicitly.
* cpython uses AC_USE_SYSTEM_EXTENSIONS and also defines _GNU_SOURCE
explicitly. (I think the cpython configure script took a wrong turn at
some point because it's mucking around with _POSIX_C_SOURCE and
_XOPEN_SOURCE.)
* remctl and krb5-strength use AC_USE_SYSTEM_EXTENSIONS. Probably other
rra software does as well.
* Samba uses _GNU_SOURCE at least in some builds (it shows up in some
packaging files).
* sssd uses AC_USE_SYSTEM_EXTENSIONS or AC_GNU_SOURCE depending on the
autoconf version.
* OpenLDAP defines _GNU_SOURCE in a couple of specific source files.
* OpenSSL defines _GNU_SOURCE in one specific file (to get dladdr).
* FreeIPA defines _GNU_SOURCE in several source files.
From: ghudson@mit.edu
Subject: git commit

Define k5-platform.h wrapper for strerror_r

On systems where strerror_r is not the POSIX version, define it to
k5_strerror_r. Implement k5_strerror_r in libkrb5support using
strerror_s, strerror, or the GNU strerror_r as appropriate.

https://github.com/krb5/krb5/commit/6351586a771e9a99e1e946cc9a0b6a87bbb14094
Author: Greg Hudson <ghudson@mit.edu>
Commit: 6351586a771e9a99e1e946cc9a0b6a87bbb14094
Branch: master
src/aclocal.m4 | 2 +-
src/configure.in | 3 +-
src/include/k5-platform.h | 6 ++
src/util/support/Makefile.in | 5 +-
src/util/support/libkrb5support-fixed.exports | 1 +
src/util/support/strerror_r.c | 96 +++++++++++++++++++++++++
6 files changed, 110 insertions(+), 3 deletions(-)
From: ghudson@mit.edu
Subject: git commit

Simplify usage of strerror_r

Take advantage of the strerror_r portability wrapper to simplify code
using it. Remove unused macros related to strerror_r in
ldap_service_stash.c and plugins.c.

https://github.com/krb5/krb5/commit/6a8da91b691b8f51ac62d8142cd2fa32a69f3d15
Author: Greg Hudson <ghudson@mit.edu>
Commit: 6a8da91b691b8f51ac62d8142cd2fa32a69f3d15
Branch: master
src/lib/krb5/os/trace.c | 9 ++-------
.../kdb/ldap/libkdb_ldap/ldap_service_stash.c | 5 -----
src/util/et/error_message.c | 19 ++-----------------
src/util/support/errors.c | 2 --
src/util/support/plugins.c | 9 ---------
5 files changed, 4 insertions(+), 40 deletions(-)
From: ghudson@mit.edu
Subject: git commit
Download (untitled) / with headers
text/plain 8.5KiB

Include autoconf.h before system headers

Include autoconf.h (either directly or via proxy) before system
headers, so that feature test macros defined there can affect the
system namespace. Where include order was changed, eliminate some
redundant or unnecessary includes.

https://github.com/krb5/krb5/commit/02a1123cf44381690c28f18ab2c4ba8036200539
Author: Greg Hudson <ghudson@mit.edu>
Commit: 02a1123cf44381690c28f18ab2c4ba8036200539
Branch: master
src/appl/gss-sample/gss-misc.c | 4 ++--
src/appl/simple/client/sim_client.c | 15 +++++----------
src/appl/user_user/client.c | 9 +++------
src/appl/user_user/server.c | 12 +++++-------
src/clients/kpasswd/kpasswd.c | 3 +--
src/clients/kpasswd/ksetpwd.c | 4 +---
src/clients/ksu/setenv.c | 2 +-
src/clients/ksu/xmalloc.c | 3 +--
src/clients/kswitch/kswitch.c | 2 +-
src/clients/kvno/kvno.c | 4 +---
src/kadmin/cli/keytab.c | 5 -----
src/kadmin/cli/ss_wrapper.c | 2 +-
src/kadmin/dbutil/dump.c | 1 -
src/kadmin/dbutil/kadm5_create.c | 5 +----
src/kadmin/dbutil/kdb5_create.c | 1 -
src/kadmin/dbutil/kdb5_mkey.c | 3 +--
src/kadmin/dbutil/kdb5_util.c | 1 -
src/kadmin/dbutil/ovload.c | 8 +-------
src/kadmin/server/ipropd_svc.c | 4 +---
src/kadmin/server/ovsec_kadmd.c | 1 +
src/kdc/kdc_transit.c | 2 --
src/kdc/main.c | 18 ++++++++----------
src/lib/crypto/crypto_tests/t_pkcs5.c | 5 -----
src/lib/crypto/nss/hash_provider/hash_gen.h | 2 +-
src/lib/gssapi/krb5/k5sealiov.c | 5 +----
src/lib/gssapi/krb5/k5sealv3.c | 5 +----
src/lib/gssapi/krb5/k5sealv3iov.c | 5 +----
src/lib/gssapi/krb5/k5unsealiov.c | 5 +----
src/lib/gssapi/krb5/naming_exts.c | 4 +---
src/lib/gssapi/krb5/prf.c | 4 +---
src/lib/gssapi/krb5/store_cred.c | 4 +---
src/lib/gssapi/spnego/spnego_mech.c | 4 ----
src/lib/kadm5/alt_prof.c | 2 +-
src/lib/kadm5/chpass_util.c | 5 +----
src/lib/kadm5/clnt/client_init.c | 11 +----------
src/lib/kadm5/srv/server_acl.c | 3 +--
src/lib/kadm5/srv/server_init.c | 5 +----
src/lib/kadm5/srv/server_kdb.c | 2 --
src/lib/kadm5/unit-test/setkey-test.c | 1 -
src/lib/kdb/kdb5.c | 3 ---
src/lib/kdb/kdb5.h | 4 ++--
src/lib/kdb/kdb_convert.c | 3 +--
src/lib/krb5/krb/appdefault.c | 2 --
src/lib/krb5/krb/bld_princ.c | 1 -
src/lib/krb5/krb/chpw.c | 1 -
src/lib/krb5/krb/deltat.c | 3 +--
src/lib/krb5/krb/get_in_tkt.c | 2 --
src/lib/krb5/krb/kerrs.c | 1 -
src/lib/krb5/krb/t_kerb.c | 2 +-
src/lib/krb5/krb/x-deltat.y | 3 +--
src/lib/krb5/krb5_libinit.c | 3 ---
src/lib/krb5/os/changepw.c | 2 +-
src/lib/krb5/os/locate_kdc.c | 3 +--
src/lib/krb5/os/sendto_kdc.c | 2 +-
src/lib/krb5/os/t_locate_kdc.c | 5 ++---
src/lib/krb5/os/t_std_conf.c | 2 +-
src/lib/krb5/os/t_trace.c | 9 ++-------
src/lib/krb5/rcache/rc_dfl.c | 2 +-
src/lib/krb5/rcache/t_replay.c | 5 -----
src/lib/rpc/auth_unix.c | 3 +--
src/lib/rpc/clnt_generic.c | 2 +-
src/lib/rpc/clnt_perror.c | 3 +--
src/lib/rpc/clnt_simple.c | 2 +-
src/lib/rpc/getrpcport.c | 2 +-
src/lib/rpc/pmap_rmt.c | 5 +----
src/lib/rpc/svc_auth_gss.c | 5 +----
src/lib/rpc/svc_tcp.c | 7 +------
src/lib/rpc/svc_udp.c | 6 +-----
src/lib/rpc/unit-test/client.c | 2 +-
src/plugins/audit/kdc_j_encode.c | 2 +-
src/plugins/authdata/greet_client/greet.c | 2 --
src/plugins/authdata/greet_server/greet_auth.c | 2 --
src/plugins/kdb/db2/adb_openclose.c | 2 +-
src/plugins/kdb/db2/libdb2/btree/bt_open.c | 4 ++--
src/plugins/kdb/ldap/ldap_util/kdb5_ldap_policy.c | 2 --
src/plugins/kdb/ldap/ldap_util/kdb5_ldap_realm.c | 1 -
.../kdb/ldap/ldap_util/kdb5_ldap_services.c | 1 -
src/plugins/kdb/ldap/ldap_util/kdb5_ldap_util.c | 4 +---
src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.h | 12 ++++++------
src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c | 5 ++---
src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c | 2 +-
.../kdb/ldap/libkdb_ldap/ldap_service_stash.c | 2 +-
src/plugins/kdb/ldap/libkdb_ldap/lockout.c | 3 ---
src/plugins/preauth/pkinit/pkinit.h | 3 +--
src/plugins/preauth/pkinit/pkinit_clnt.c | 14 ++++----------
src/plugins/preauth/pkinit/pkinit_crypto_nss.c | 10 +++++-----
src/plugins/preauth/pkinit/pkinit_crypto_openssl.c | 11 ++---------
src/plugins/preauth/pkinit/pkinit_crypto_openssl.h | 4 ++--
src/plugins/preauth/pkinit/pkinit_kdf_constants.c | 13 -------------
src/plugins/preauth/pkinit/pkinit_kdf_test.c | 11 +----------
src/plugins/preauth/pkinit/pkinit_lib.c | 10 ----------
src/plugins/preauth/pkinit/pkinit_profile.c | 5 -----
src/plugins/preauth/pkinit/pkinit_srv.c | 5 -----
src/slave/kprop.c | 6 +-----
src/slave/kprop_sock.c | 7 +++----
src/slave/kpropd.c | 11 ++++-------
src/slave/kproplog.c | 3 +--
src/tests/asn.1/krb5_decode_leak.c | 4 ----
src/tests/asn.1/krb5_encode_test.c | 1 -
src/tests/asn.1/utility.h | 2 +-
src/tests/gss-threads/gss-client.c | 6 +-----
src/tests/gss-threads/gss-misc.c | 2 +-
src/tests/gss-threads/gss-server.c | 2 +-
src/tests/gssapi/t_enctypes.c | 3 ---
src/tests/hammer/kdc5_hammer.c | 4 +---
src/tests/misc/test_getsockname.c | 2 +-
src/tests/resolve/addrinfo-test.c | 6 +-----
src/tests/responder.c | 6 ++----
src/tests/shlib/t_loader.c | 6 +-----
src/tests/threads/init_ctx.c | 8 +-------
src/tests/threads/profread.c | 8 +-------
src/tests/threads/t_rcache.c | 4 +---
src/util/et/error_message.c | 8 +-------
src/util/et/test_et.c | 2 +-
src/util/profile/prof_int.h | 8 ++++----
src/util/ss/error.c | 6 ++----
src/util/ss/ss_internal.h | 9 +--------
src/util/support/cache-addrinfo.h | 5 ++---
src/util/support/errors.c | 7 +------
src/util/support/fake-addrinfo.c | 7 ++-----
src/util/support/gmt_mktime.c | 2 +-
src/util/support/init-addrinfo.c | 7 ++-----
src/util/support/plugins.c | 7 +------
src/util/support/t_unal.c | 1 -
src/util/support/threads.c | 5 +----
src/util/support/utf8_conv.c | 1 -
src/util/verto/verto-k5ev.c | 2 +-
127 files changed, 145 insertions(+), 429 deletions(-)
From: ghudson@mit.edu
Subject: git commit

Define _GNU_SOURCE for glibc extensions

glibc does not declare a number of common, useful extensions such as
asprintf unless _GNU_SOURCE is defined. Define it early in the
configure process so that it is available for autoconf tests.

Defining _GNU_SOURCE unfortunately causes glibc to use the non-POSIX
version of strerror_r, which we now handle using the k5-platform.h
wrapper.

https://github.com/krb5/krb5/commit/7ecf85644d8ef616781e6689a8dd504316cb6d7a
Author: Greg Hudson <ghudson@mit.edu>
Commit: 7ecf85644d8ef616781e6689a8dd504316cb6d7a
Branch: master
src/aclocal.m4 | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)