Mercurial > hg > octave-kai > gnulib-hg
changeset 13540:a4b0494e2b96
mknod: be more vocal about danger of running tests as root
* m4/mknod.m4 (gl_FUNC_MKNOD): Make it harder to run configure as
root, since that is just asking for problems.
Suggested by Bruno Haible, based on a report by Rainer Tammer.
Signed-off-by: Eric Blake <eblake@redhat.com>
author | Eric Blake <eblake@redhat.com> |
---|---|
date | Fri, 30 Jul 2010 17:29:43 -0600 |
parents | 56e31af9a41e |
children | a9d7c0f9973e |
files | ChangeLog m4/mknod.m4 |
diffstat | 2 files changed, 13 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2010-08-09 Eric Blake <eblake@redhat.com> + mknod: be more vocal about danger of running tests as root + * m4/mknod.m4 (gl_FUNC_MKNOD): Make it harder to run configure as + root, since that is just asking for problems. + Suggested by Bruno Haible, based on a report by Rainer Tammer. + readlinkat: split into its own module * modules/symlinkat: Split readlinkat... * modules/readlinkat: ...into separate module.
--- a/m4/mknod.m4 +++ b/m4/mknod.m4 @@ -1,4 +1,4 @@ -# serial 1 +# serial 2 # See if we need to provide mknod replacement. dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc. @@ -27,9 +27,14 @@ #include <unistd.h> ]], [[/* Indeterminate for super-user, assume no. Why are you running configure as root, anyway? */ - if (!geteuid ()) return 1; + if (!geteuid ()) return 99; if (mknod ("conftest.fifo", S_IFIFO | 0600, 0)) return 2;]])], - [gl_cv_func_mknod_works=yes], [gl_cv_func_mknod_works=no], + [gl_cv_func_mknod_works=yes], + [if test $? == 99 && test x"$FORCE_UNSAFE_CONFIGURE" = x; then + AC_MSG_FAILURE([you should not run configure as root ]dnl +[(set FORCE_UNSAFE_CONFIGURE=1 in environment to bypass this check)]) + fi + gl_cv_func_mknod_works=no], [gl_cv_func_mknod_works="guessing no"]) rm -f conftest.fifo]) if test "$gl_cv_func_mknod_works" != yes; then