X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fsession.c;h=491d3bfaac11c79791f5fd3eba2628aa89397a4a;hb=5dce043b4b7e32d41598442361736a927a5db5e4;hp=f9f8fc011b1b27b3098a80cec3364dfa9f2bc910;hpb=5bf6b47df03c7d16ffbebfd83d4f0b5fee146dab;p=ppp.git diff --git a/pppd/session.c b/pppd/session.c index f9f8fc0..491d3bf 100644 --- a/pppd/session.c +++ b/pppd/session.c @@ -294,9 +294,11 @@ session_start(flags, user, passwd, ttyName, msg) #else /* #ifdef USE_PAM */ /* - * Use the non-PAM methods directly + * Use the non-PAM methods directly. 'pw' will remain NULL if the user + * has not been authenticated using local UNIX system services. */ + pw = NULL; if ((SESS_AUTH & flags)) { pw = getpwnam(user); @@ -362,7 +364,12 @@ session_start(flags, user, passwd, ttyName, msg) logged_in = 1; #if defined(_PATH_LASTLOG) && !defined(USE_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 + * UID might be, and lastlog is indexed by UID. + */ + if (pw != NULL) { struct lastlog ll; int fd;