]> git.ozlabs.org Git - ppp.git/commitdiff
Changing USE_PAM to PPP_WITH_PAM for consistency.
authorEivind Næss <eivnaes@yahoo.com>
Sat, 7 Aug 2021 21:52:39 +0000 (14:52 -0700)
committerEivind Næss <eivnaes@yahoo.com>
Fri, 15 Jul 2022 22:25:39 +0000 (15:25 -0700)
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
configure.ac
pppd/Makefile.am
pppd/pppdconf.h.in
pppd/session.c

index 19e981c63dbc090d41598ef676e0414a66ef863f..1248b8431ad6695778f8e04e21db3c8844f11f56 100644 (file)
@@ -275,8 +275,8 @@ AX_CHECK_ATM
 
 #
 # With libpam support
-AX_CHECK_PAM(AC_DEFINE([USE_PAM], 1, ["Support for Pluggable Authentication Modules"]))
-AM_CONDITIONAL(WITH_PAM, test "x${with_pam}" = "xyes")
+AX_CHECK_PAM(AC_DEFINE([PPP_WITH_PAM], 1, [Support for Pluggable Authentication Modules]))
+AM_CONDITIONAL(PPP_WITH_PAM, test "x${with_pam}" = "xyes")
 
 #
 # With libpcap support, activate pppd on network activity
index a7d64cf089de78eb5bfad3f05d4154ea9cee6670..c3f512fbd4497467c4b0eb548bcbae2882541740 100644 (file)
@@ -127,8 +127,10 @@ if PPP_WITH_IPV6CP
 pppd_SOURCES += ipv6cp.c eui64.c
 endif
 
-if WITH_PAM
-pppd_LIBS += -lpam -ldl
+if PPP_WITH_PAM
+pppd_CPPFLAGS += $(PAM_CFLAGS)
+pppd_LIBS += $(PAM_LIBS) -ldl
+pppd_LDFLAGS += $(PAM_LDFLAGS)
 endif
 
 if PPP_WITH_EAPTLS
index 0b46a1e2a5cfadf38c39f0f887d8caedea1f745a..d12dc82d267b03ab602281e5e171d1a1bf90dbaa 100644 (file)
 /* "Have IPv6 support" */
 #undef PPP_WITH_IPV6CP
 
-/* "Support for Pluggable Authentication Modules" */
-#undef USE_PAM
+/* Support for Pluggable Authentication Modules */
+#undef PPP_WITH_PAM
 
-/* "Have EAP-SRP authentication support" */
+/* Have EAP-SRP authentication support */
 #undef USE_SRP
 
 /* Have EAP-TLS authentication support */
index 3d1fb6d7ccc1f912e1454eacdd10e20f2a22626d..8ab5b8b294d7f37ddd95c865fe37a3dca70b630e 100644 (file)
@@ -92,9 +92,9 @@
 #include "pppd.h"
 #include "session.h"
 
-#ifdef USE_PAM
+#ifdef PPP_WITH_PAM
 #include <security/pam_appl.h>
-#endif /* #ifdef USE_PAM */
+#endif /* #ifdef PPP_WITH_PAM */
 
 #define SET_MSG(var, msg) if (var != NULL) { var[0] = msg; }
 #define COPY_STRING(s) ((s) ? strdup(s) : NULL)
 /* We have successfully started a session */
 static bool logged_in = 0;
 
-#ifdef USE_PAM
+#ifdef PPP_WITH_PAM
 /*
  * Static variables used to communicate between the conversation function
  * and the server_login function
@@ -167,17 +167,17 @@ static struct pam_conv pam_conv_data = {
     &conversation,
     NULL
 };
-#endif /* #ifdef USE_PAM */
+#endif /* #ifdef PPP_WITH_PAM */
 
 int
 session_start(const int flags, const char *user, const char *passwd, const char *ttyName, char **msg)
 {
-#ifdef USE_PAM
+#ifdef PPP_WITH_PAM
     bool ok = 1;
     const char *usr;
     int pam_error;
     bool try_session = 0;
-#else /* #ifdef USE_PAM */
+#else /* #ifdef PPP_WITH_PAM */
     struct passwd *pw;
     char *cbuf;
 #ifdef HAVE_SHADOW_H
@@ -185,7 +185,7 @@ session_start(const int flags, const char *user, const char *passwd, const char
     struct spwd *getspnam();
     long now = 0;
 #endif /* #ifdef HAVE_SHADOW_H */
-#endif /* #ifdef USE_PAM */
+#endif /* #ifdef PPP_WITH_PAM */
 
     SET_MSG(msg, SUCCESS_MSG);
 
@@ -199,7 +199,7 @@ session_start(const int flags, const char *user, const char *passwd, const char
        return SESSION_FAILED;
     }
 
-#ifdef USE_PAM
+#ifdef PPP_WITH_PAM
     /* Find the '\\' in the username */
     /* This needs to be fixed to support different username schemes */
     if ((usr = strchr(user, '\\')) == NULL)
@@ -295,7 +295,7 @@ session_start(const int flags, const char *user, const char *passwd, const char
     /* If our PAM checks have already failed, then we must return a failure */
     if (!ok) return SESSION_FAILED;
 
-#else /* #ifdef USE_PAM */
+#else /* #ifdef PPP_WITH_PAM */
 
 /*
  * Use the non-PAM methods directly.  'pw' will remain NULL if the user
@@ -359,7 +359,7 @@ session_start(const int flags, const char *user, const char *passwd, const char
             return SESSION_FAILED;
     }
 
-#endif /* #ifdef USE_PAM */
+#endif /* #ifdef PPP_WITH_PAM */
 
     /*
      * Write a wtmp entry for this user.
@@ -371,7 +371,7 @@ session_start(const int flags, const char *user, const char *passwd, const char
        logwtmp(ttyName, user, ifname); /* Add wtmp login entry */
        logged_in = 1;
 
-#if defined(_PATH_LASTLOG) && !defined(USE_PAM)
+#if defined(_PATH_LASTLOG) && !defined(PPP_WITH_PAM)
        /*
         * Enter the user in lastlog only if he has been authenticated using
         * local system services.  If he has not, then we don't know what his
@@ -393,7 +393,7 @@ session_start(const int flags, const char *user, const char *passwd, const char
                 (void)close(fd);
             }
        }
-#endif /* _PATH_LASTLOG and not USE_PAM */
+#endif /* _PATH_LASTLOG and not PPP_WITH_PAM */
        info("user %s logged in on tty %s intf %s", user, ttyName, ifname);
     }
 
@@ -406,7 +406,7 @@ session_start(const int flags, const char *user, const char *passwd, const char
 void
 session_end(const char* ttyName)
 {
-#ifdef USE_PAM
+#ifdef PPP_WITH_PAM
     int pam_error = PAM_SUCCESS;
 
     if (pamh != NULL) {