X-Git-Url: https://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fsession.c;h=2f1c83e5552cd3afd59813e82d6b8bdf3de6294b;hp=3d1fb6d7ccc1f912e1454eacdd10e20f2a22626d;hb=HEAD;hpb=92c5612fdb77e83e49c524ae46110c129e13429e diff --git a/pppd/session.c b/pppd/session.c index 3d1fb6d..f08d8e1 100644 --- a/pppd/session.c +++ b/pppd/session.c @@ -17,7 +17,7 @@ * 3. Redistributions of any form whatsoever must retain the following * acknowledgment: * "This product includes software developed by Paul Mackerras - * ". + * ". * * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY @@ -89,12 +89,12 @@ #include #include #include -#include "pppd.h" +#include "pppd-private.h" #include "session.h" -#ifdef USE_PAM +#ifdef PPP_WITH_PAM #include -#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) @@ -109,7 +109,7 @@ /* 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) {