]> granicus.if.org Git - sudo/commitdiff
Add check for syslog facilities and priorities tables in syslog.h
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 5 Aug 1999 10:21:28 +0000 (10:21 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 5 Aug 1999 10:21:28 +0000 (10:21 +0000)
aclocal.m4
config.h.in
configure
configure.in

index 12e8adc6d835f8ae9263d73d1f5cd94225fe292b..3fafe9d86c0f2e284255e53629555a79fd9474ea 100644 (file)
@@ -304,3 +304,23 @@ rm -f conftestdata
 AC_MSG_RESULT($sudo_cv_uid_t_len)
 AC_DEFINE_UNQUOTED(MAX_UID_T_LEN, $sudo_cv_uid_t_len)
 ])
+
+dnl
+dnl check for facilitynames and prioritynames in syslog.h
+dnl 4.4BSD has these but most others do not.
+dnl
+AC_DEFUN(SUDO_SYSLOG_NAMES,
+[AC_MSG_CHECKING(for facilitynames and prioritynames in syslog.h)
+AC_CACHE_VAL(sudo_cv_syslog_names,
+[
+AC_TRY_COMPILE([
+#define SYSLOG_NAMES
+#include <stdio.h>
+#include <syslog.h>
+], [ CODE *p=&prioritynames[0]; CODE *f=&facilitynames[0]; ],
+sudo_cv_syslog_names=yes, sudo_cv_syslog_names=no)])dnl
+AC_MSG_RESULT($sudo_cv_syslog_names)
+if test $sudo_cv_syslog_names = yes; then
+    AC_DEFINE(HAVE_SYSLOG_NAMES)
+fi
+])
index 8763714f127d60b9a50635d7d1c1d2be965516d6..1d9d7de8386639c079d5c48d49cd563bfbdf5faa 100644 (file)
 /* Define to be the max chars per log line (for line wrapping).  */
 #undef MAXLOGFILELEN
 
+/* Define if your syslog.h has the prioritynames and facilitynames tables.  */
+#undef HAVE_SYSLOG_NAMES
+
 /* Define if you want to ignore '.' and '' in $PATH */
 #undef IGNORE_DOT_PATH
 
index f13905217b3af6e512567418d225f42a6844b119..618c8196213674635ead64150f187ea9f8991b4b 100755 (executable)
--- a/configure
+++ b/configure
@@ -1087,7 +1087,7 @@ if test "${with_logging+set}" = set; then
     yes)       echo "Must give --with-logging an argument."
                exit 1
                ;;
-    no)                echo "Sorry, --without-logfile not supported."
+    no)                echo "Sorry, --without-logging not supported."
                exit 1
                ;;
     syslog)    cat >> confdefs.h <<\EOF
@@ -7288,9 +7288,47 @@ fi
 
 fi
 
+echo $ac_n "checking for facilitynames and prioritynames in syslog.h""... $ac_c" 1>&6
+echo "configure:7293: checking for facilitynames and prioritynames in syslog.h" >&5
+if eval "test \"`echo '$''{'sudo_cv_syslog_names'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+cat > conftest.$ac_ext <<EOF
+#line 7299 "configure"
+#include "confdefs.h"
+
+#define SYSLOG_NAMES
+#include <stdio.h>
+#include <syslog.h>
+
+int main() {
+ CODE *p=&prioritynames[0]; CODE *f=&facilitynames[0]; 
+; return 0; }
+EOF
+if { (eval echo configure:7310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  sudo_cv_syslog_names=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  sudo_cv_syslog_names=no
+fi
+rm -f conftest*
+fi
+echo "$ac_t""$sudo_cv_syslog_names" 1>&6
+if test $sudo_cv_syslog_names = yes; then
+    cat >> confdefs.h <<\EOF
+#define HAVE_SYSLOG_NAMES 1
+EOF
+
+fi
+
+
 if test "$with_kerb5" = "yes"; then
                     echo $ac_n "checking for krb5_get_init_creds_opt in -lkrb5""... $ac_c" 1>&6
-echo "configure:7294: checking for krb5_get_init_creds_opt in -lkrb5" >&5
+echo "configure:7332: checking for krb5_get_init_creds_opt in -lkrb5" >&5
 if test -n ""; then
   ac_lib_var=`echo krb5'_'krb5_get_init_creds_opt | sed 'y% ./+-%___p_%'`
 else
@@ -7302,7 +7340,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb5  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7306 "configure"
+#line 7344 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7313,7 +7351,7 @@ int main() {
 krb5_get_init_creds_opt()
 ; return 0; }
 EOF
-if { (eval echo configure:7317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7372,21 +7410,21 @@ EOF
 
     if test "$with_kerb5" = "yes"; then
        echo $ac_n "checking for -lkrb4""... $ac_c" 1>&6
-echo "configure:7376: checking for -lkrb4" >&5
+echo "configure:7414: checking for -lkrb4" >&5
 if eval "test \"`echo '$''{'ac_cv_lib_krb4'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb4  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7383 "configure"
+#line 7421 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:7390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_lib_krb4=yes
 else
@@ -7407,21 +7445,21 @@ else
 fi
 
        echo $ac_n "checking for -ldes""... $ac_c" 1>&6
-echo "configure:7411: checking for -ldes" >&5
+echo "configure:7449: checking for -ldes" >&5
 if eval "test \"`echo '$''{'ac_cv_lib_des'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
 LIBS="-ldes  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7418 "configure"
+#line 7456 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:7425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_lib_des=yes
 else
@@ -7442,21 +7480,21 @@ fi
        SUDO_LIBS="${SUDO_LIBS} -ldes425 -lkrb5 -lcrypto -lcom_err"
     else
        echo $ac_n "checking for -ldes""... $ac_c" 1>&6
-echo "configure:7446: checking for -ldes" >&5
+echo "configure:7484: checking for -ldes" >&5
 if eval "test \"`echo '$''{'ac_cv_lib_des'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
 LIBS="-ldes  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7453 "configure"
+#line 7491 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:7460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_lib_des=yes
 else
@@ -7580,7 +7618,7 @@ if test "$with_authenticate" = "yes"; then
 fi
 
 echo $ac_n "checking for log file location""... $ac_c" 1>&6
-echo "configure:7584: checking for log file location" >&5
+echo "configure:7622: checking for log file location" >&5
 if test -n "$with_logpath"; then
     echo "$ac_t""$with_logpath" 1>&6
     cat >> confdefs.h <<EOF
@@ -7610,7 +7648,7 @@ else
 fi
 
 echo $ac_n "checking for timestamp file location""... $ac_c" 1>&6
-echo "configure:7614: checking for timestamp file location" >&5
+echo "configure:7652: checking for timestamp file location" >&5
 if test -n "$with_timedir"; then
     echo "$ac_t""$with_timedir" 1>&6
     cat >> confdefs.h <<EOF
index 73e970e57c319512a900fb3f9b58c2acf6dce285..0f3de8aa714e2a213487423b88e16f4572ff7d4c 100644 (file)
@@ -338,7 +338,7 @@ AC_ARG_WITH(logging, [  --with-logging          log via syslog, file, or both],
     yes)       echo "Must give --with-logging an argument."
                exit 1
                ;;
-    no)                echo "Sorry, --without-logfile not supported."
+    no)                echo "Sorry, --without-logging not supported."
                exit 1
                ;;
     syslog)    AC_DEFINE(LOGGING, SLOG_SYSLOG)
@@ -1384,6 +1384,11 @@ if test "$with_DCE" = "yes" -o "$ac_cv_prog_YACC" = "bison -y"; then
     AC_FUNC_ALLOCA
 fi
 
+dnl
+dnl Check to see if the facility and priority names live in syslog.h
+dnl
+SUDO_SYSLOG_NAMES
+
 dnl
 dnl Kerberos 5
 dnl