[PATCH] fix for warning in pam check

Oswald Buddenhagen ossi at kde.org
Sun Jul 6 12:36:00 BST 2003


On Sun, Jul 06, 2003 at 01:34:39PM +0200, Oswald Buddenhagen wrote:
> the patch should:
>
yeah, right, the patch ... :}

greetings

-- 
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
--
Chaos, panic, and disorder - my work here is done.
-------------- next part --------------
Index: acinclude.m4.in
===================================================================
RCS file: /home/kde/kde-common/admin/acinclude.m4.in,v
retrieving revision 2.372
diff -u -r2.372 acinclude.m4.in
--- acinclude.m4.in	30 Jun 2003 11:18:09 -0000	2.372
+++ acinclude.m4.in	6 Jul 2003 11:21:58 -0000
@@ -3106,7 +3106,7 @@
   fi
   dnl $x_libraries is set to /usr/lib in case
   if test -n "$X_LDFLAGS"; then
-    X_RPATH="-R \$(x_libraries)" 
+    X_RPATH="-R \$(x_libraries)"
     KDE_RPATH="$KDE_RPATH $X_RPATH"
   fi
   if test -n "$KDE_EXTRA_RPATH"; then
@@ -3595,57 +3595,62 @@
 AC_DEFUN(KDE_PAM, [
   AC_REQUIRE([KDE_CHECK_LIBDL])
 
+  AC_MSG_CHECKING(whether PAM usage is requested)
   AC_ARG_WITH(pam,
     [  --with-pam[=ARG]        enable support for PAM: ARG=[yes|no|service name]],
-    [ if test "x$withval" = "xyes"; then
-        use_pam=yes
+    [ ac_cv_with_pam=$withval ],
+    [ AC_CACHE_VAL(ac_cv_with_pam, []) ])
+  if test "x$ac_cv_with_pam" = xno; then
+    AC_MSG_RESULT(no)
+    use_pam=no
+    PAMLIBS=
+  else
+    if test -z "$ac_cv_with_pam"; then
+      AC_MSG_RESULT(detect)
+    else
+      AC_MSG_RESULT(yes)
+    fi
+
+    pam_header=
+    AC_CHECK_LIB(pam, pam_start,
+      [ AC_CHECK_HEADER(security/pam_appl.h,
+          [ pam_header=security/pam_appl.h ],
+          [ AC_CHECK_HEADER(pam/pam_appl.h,
+              [ pam_header=pam/pam_appl.h ])
+          ]) 
+      ], , $LIBDL)
+
+    if test -z "$pam_header"; then
+      if test -n "$ac_cv_with_pam"; then
+        AC_MSG_ERROR([You have requested PAM usage, but PAM was not detected!])
+      fi
+      use_pam=no
+      PAMLIBS=
+    else
+      use_pam=yes
+      if test "x$ac_cv_with_pam" = xyes; then
         pam_service=kde
-      elif test "x$withval" = "xno"; then
-        use_pam=no
       else
-        use_pam=yes
-        pam_service=$withval
+        pam_service=$ac_cv_with_pam
       fi
-      ac_cv_path_pam="use_pam=$use_pam pam_service=$pam_service"
-    ], [
-      AC_CACHE_VAL(ac_cv_path_pam,
-        [ use_pam=no
-          AC_CHECK_LIB(pam, pam_start,
-            [ AC_CHECK_HEADER(security/pam_appl.h,
-                [ use_pam=yes
-		  pam_header=security/pam_appl.h
-                  pam_service=kde ],
-		[ AC_CHECK_HEADER(pam/pam_appl.h,
-			[ use_pam=yes
-			  pam_header=pam/pam_appl.h
-			  pam_service=kde
-    			  AC_DEFINE(HAVE_PAM_PAM_APPL_H, 1, [Define if your pam headers are in pam/ instead of security/])
-			])
-		]) 
-            ], , $LIBDL)
-          ac_cv_path_pam="use_pam=$use_pam pam_service=$pam_service"
-        ])
-    ])
-  eval "$ac_cv_path_pam"
+      AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
+      PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
 
-  AC_MSG_CHECKING(for PAM)
-  if test "x$use_pam" = xno; then
-    AC_MSG_RESULT(no)
-    PAMLIBS=""
-  else
-    AC_MSG_RESULT(yes)
-    AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
-    PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
+      dnl darwin claims to be something special
+      if test "$pam_header" = "pam/pam_appl.h"; then
+        AC_DEFINE(HAVE_PAM_PAM_APPL_H, 1, [Define if your PAM headers are in pam/ instead of security/])
+      fi
 
-    dnl test whether struct pam_message is const (Linux) or not (Sun)
-    AC_MSG_CHECKING(for const pam_message)
-    AC_EGREP_HEADER([struct pam_message], $pam_header,
-      [ AC_EGREP_HEADER([const struct pam_message], $pam_header,
-                        [AC_MSG_RESULT([const: Linux-type PAM])],
-                        [AC_MSG_RESULT([nonconst: Sun-type PAM])
-                        AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
-                        )],
-      [AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
+      dnl test whether struct pam_message is const (Linux) or not (Sun)
+      AC_MSG_CHECKING(for const pam_message)
+      AC_EGREP_HEADER([struct pam_message], $pam_header,
+        [ AC_EGREP_HEADER([const struct pam_message], $pam_header,
+                          [AC_MSG_RESULT([const: Linux-type PAM])],
+                          [AC_MSG_RESULT([nonconst: Sun-type PAM])
+                          AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
+                          )],
+        [AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
+    fi
   fi
 
   AC_SUBST(PAMLIBS)
@@ -3658,8 +3663,8 @@
     [ if test "x$use_pam" = xyes; then
         $3_PAM_SERVICE="$withval"
       else
-        AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
-You may want to enforce it by using --with-pam.])
+        AC_MSG_ERROR([Cannot use --with-$1-pam, as no PAM is used.
+You may want to enable it by using --with-pam.])
       fi
     ], 
     [ if test "x$use_pam" = xyes; then
@@ -3694,30 +3699,28 @@
   AC_SUBST(LIBGEN)
   
   AC_MSG_CHECKING([for shadow passwords])
-
   AC_ARG_WITH(shadow,
     [  --with-shadow		  If you want shadow password support ],
-    [ if test "x$withval" != "xno"; then
-        use_shadow=yes
-      else
-        use_shadow=no
-      fi
+    [ ac_cv_use_shadow=$withval
     ], [
-      use_shadow="$ac_use_shadow"
+      AC_CACHE_VAL(ac_cv_use_shadow, [ac_cv_use_shadow=$ac_use_shadow])
     ])
+  AC_MSG_RESULT($ac_cv_use_shadow)
 
-  if test "x$use_shadow" = xyes; then
-    AC_MSG_RESULT(yes)
+  if test "x$ac_cv_use_shadow" = xyes; then
+    if test "x$ac_use_shadow" = xno; then
+      AC_MSG_ERROR([You have requested use of shadow passwords,
+but shadow password support was not detected!])
+    fi
     AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
   else
-    AC_MSG_RESULT(no)
     LIBSHADOW=
     LIBGEN=
   fi
 
   dnl finally make the relevant binaries setuid root, if we have shadow passwds.
   dnl this still applies, if we could use it indirectly through pam.
-  if test "x$use_shadow" = xyes || 
+  if test "x$ac_cv_use_shadow" = xyes || 
      ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
       case $host in
       *-*-freebsd* | *-*-netbsd* | *-*-openbsd*)


More information about the kde-core-devel mailing list