[Pkg-shadow-devel] [PATCH 2/2] Check size of uid_t and gid_t using AC_CHECK_SIZEOF

Serge Hallyn serge.hallyn at ubuntu.com
Mon Sep 1 16:17:05 UTC 2014


Quoting James Le Cuirot (chewi at aura-online.co.uk):
> This built-in check is simpler than the previous method and, most
> importantly, works when cross-compiling.

Thanks, James.  I was a bit worired about AC_CHECK_SIZEOF as google
seems to point in some bugs in certain autoconf versions, but it
seems to be working for me in several releases, so

Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>

> ---
>  configure.in | 14 ++++----------
>  1 file changed, 4 insertions(+), 10 deletions(-)
> 
> diff --git a/configure.in b/configure.in
> index 1a3f841..4a4d6d0 100644
> --- a/configure.in
> +++ b/configure.in
> @@ -335,16 +335,10 @@ if test "$enable_subids" != "no"; then
>  	dnl
>  	dnl FIXME: check if 32 bit UIDs/GIDs are supported by libc
>  	dnl
> -	AC_RUN_IFELSE([AC_LANG_SOURCE([
> -#include <sys/types.h>
> -int main(void) {
> -	uid_t u;
> -	gid_t g;
> -	return (sizeof u < 4) || (sizeof g < 4);
> -}
> -	])], [id32bit="yes"], [id32bit="no"])
> -
> -	if test "x$id32bit" = "xyes"; then
> +	AC_CHECK_SIZEOF([uid_t],, [#include "sys/types.h"])
> +	AC_CHECK_SIZEOF([gid_t],, [#include "sys/types.h"])
> +
> +	if test "$ac_cv_sizeof_uid_t" -ge 4 && test "$ac_cv_sizeof_gid_t" -ge 4; then
>  		AC_DEFINE(ENABLE_SUBIDS, 1, [Define to support the subordinate IDs.])
>  		enable_subids="yes"
>  	else
> -- 
> 2.0.4
> 
> 
> _______________________________________________
> Pkg-shadow-devel mailing list
> Pkg-shadow-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-shadow-devel



More information about the Pkg-shadow-devel mailing list