From a28a4764e68d90a76be7b2bfb9be79e6132557c8 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 11 Jun 2010 10:53:44 -0400 Subject: [PATCH] Print configure args with verbose version information. --- configure | 33 ++++++++++++++++++--------------- configure.in | 2 ++ src/sudo.c | 3 +++ src/sudo_usage.h.in | 5 +++++ 4 files changed, 28 insertions(+), 15 deletions(-) diff --git a/configure b/configure index 4aad53cd0..9460f5365 100755 --- a/configure +++ b/configure @@ -816,6 +816,7 @@ sudo_umask password_timeout timeout timedir +CONFIGURE_ARGS ac_config_libobj_dir LIBTOOL_DEPS ZLIB @@ -2775,6 +2776,7 @@ $as_echo "$as_me: Configuring Sudo version $PACKAGE_VERSION" >&6;} + timeout=5 @@ -2828,6 +2830,7 @@ shadow_defs= shadow_funcs= shadow_libs= shadow_libs_optional= +CONFIGURE_ARGS="$@" if test X"$prefix" = X"NONE"; then test "$mandir" = '${datarootdir}/man' && mandir='$(prefix)/man' @@ -6593,13 +6596,13 @@ if test "${lt_cv_nm_interface+set}" = set; then : else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:6596: $ac_compile\"" >&5) + (eval echo "\"\$as_me:6599: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:6599: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:6602: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:6602: output\"" >&5) + (eval echo "\"\$as_me:6605: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -7804,7 +7807,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 7807 "configure"' > conftest.$ac_ext + echo '#line 7810 "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -9196,11 +9199,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9199: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9202: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:9203: \$? = $ac_status" >&5 + echo "$as_me:9206: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -9535,11 +9538,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9538: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9541: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:9542: \$? = $ac_status" >&5 + echo "$as_me:9545: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -9640,11 +9643,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9643: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9646: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:9647: \$? = $ac_status" >&5 + echo "$as_me:9650: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -9695,11 +9698,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9698: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9701: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:9702: \$? = $ac_status" >&5 + echo "$as_me:9705: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12062,7 +12065,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12065 "configure" +#line 12068 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12158,7 +12161,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12161 "configure" +#line 12164 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15167,7 +15170,7 @@ esac fi -for ac_func in memrchr strerror strcasecmp sigaction strlcpy strlcat +for ac_func in memrchr strerror strcasecmp strlcpy strlcat do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" diff --git a/configure.in b/configure.in index 1beb04955..a7809f265 100644 --- a/configure.in +++ b/configure.in @@ -58,6 +58,7 @@ AC_SUBST([NONUNIX_GROUPS_IMPL]) AC_SUBST([ZLIB]) AC_SUBST([LIBTOOL_DEPS]) AC_SUBST([ac_config_libobj_dir]) +AC_SUBST([CONFIGURE_ARGS]) dnl dnl Variables that get substituted in docs (not overridden by environment) dnl @@ -153,6 +154,7 @@ shadow_defs= shadow_funcs= shadow_libs= shadow_libs_optional= +CONFIGURE_ARGS="$@" dnl dnl Override default configure dirs... diff --git a/src/sudo.c b/src/sudo.c index 9708023fc..39c148adf 100644 --- a/src/sudo.c +++ b/src/sudo.c @@ -76,6 +76,7 @@ #include "sudo.h" #include "sudo_plugin.h" #include "sudo_plugin_int.h" +#include #ifdef USING_NONUNIX_GROUPS # include "nonunix.h" @@ -161,6 +162,8 @@ main(int argc, char *argv[], char *envp[]) switch (sudo_mode & MODE_MASK) { case MODE_VERSION: printf("Sudo version %s\n", PACKAGE_VERSION); + if (user_details.uid == ROOT_UID) + (void) printf("Configure args: %s\n", CONFIGURE_ARGS); policy_plugin.u.policy->show_version(!user_details.uid); tq_foreach_fwd(&io_plugins, plugin) { ok = plugin->u.io->open(SUDO_API_VERSION, sudo_conversation, diff --git a/src/sudo_usage.h.in b/src/sudo_usage.h.in index 7d8e1e92f..49d07e766 100644 --- a/src/sudo_usage.h.in +++ b/src/sudo_usage.h.in @@ -29,4 +29,9 @@ #define SUDO_USAGE4 " [-AbEHknPS] @BSDAUTH_USAGE@@SELINUX_USAGE@[-C fd] [-D level] @LOGINCAP_USAGE@[-g groupname|#gid] [-p prompt] [-u user name|#uid] [-g groupname|#gid] [VAR=value] [-i|-s] []" #define SUDO_USAGE5 " -e [-AknS] @BSDAUTH_USAGE@@SELINUX_USAGE@[-C fd] [-D level] @LOGINCAP_USAGE@[-g groupname|#gid] [-p prompt] [-u user name|#uid] file ..." +/* + * Configure script arguments used to build sudo. + */ +#define CONFIGURE_ARGS "@CONFIGURE_ARGS@" + #endif /* _SUDO_USAGE_H */