diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-10-08 11:15:50 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2012-10-19 12:14:59 +0200 |
commit | 92d53dd7dc8ca71ae28d2a8762524396cd3c6f58 (patch) | |
tree | e6fa4de8788d0d3aed45cdf9899763ceb28ebe76 /source3/configure.in | |
parent | e24b1041b1f6e5b1c5a258a2cbe058f134a45ed9 (diff) | |
download | samba-92d53dd7dc8ca71ae28d2a8762524396cd3c6f58.tar.gz samba-92d53dd7dc8ca71ae28d2a8762524396cd3c6f58.tar.bz2 samba-92d53dd7dc8ca71ae28d2a8762524396cd3c6f58.zip |
s3:configure: check that struct utmp.ut_line is large enough for our use case
We use "smb/%u" with a 32-bit number, "smb/4294967295\0" requires
15 chars (including the '\0').
metze
Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/configure.in')
-rw-r--r-- | source3/configure.in | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source3/configure.in b/source3/configure.in index 70632bc3cb..fb00feeb8c 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -2238,6 +2238,19 @@ if test x"$samba_cv_HAVE_UX_UT_SYSLEN" = x"yes"; then AC_DEFINE(HAVE_UX_UT_SYSLEN,1,[Whether the utmpx struct has a property ut_syslen]) fi +AC_CACHE_CHECK([whether sizeof ut_line in utmp is ok],samba_cv_HAVE_UX_UT_LINE,[ +AC_TRY_RUN([#include <stdio.h> +#include <sys/types.h> +#include <utmp.h> +int main(void) { + if (sizeof(((struct utmp *)NULL)->ut_line) < 15) { + return 1; + } + return 0; +} +], +samba_cv_HAVE_UX_UT_LINE=yes,samba_cv_HAVE_UX_UT_LINE=no,samba_cv_HAVE_UX_UT_LINE=cross)]) + fi # end utmp details @@ -4703,6 +4716,11 @@ if test x"$WITH_UTMP" = x"yes" -a x"$ac_cv_header_utmp_h" = x"no"; then WITH_UTMP=no fi +if test x"$WITH_UTMP" = x"yes" -a x"$samba_cv_HAVE_UX_UT_LINE" != x"yes"; then + utmp_no_reason=", sizeof ut_line not ok" + WITH_UTMP=no +fi + # Display test results if test x"$WITH_UTMP" = x"yes"; then |