pap.c (31962) | pap.c (33603) |
---|---|
1/* 2 * PPP PAP Module 3 * 4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp) 5 * 6 * Copyright (C) 1993-94, Internet Initiative Japan, Inc. 7 * All rights reserverd. 8 * --- 4 unchanged lines hidden (view full) --- 13 * distribution and use acknowledge that the software was developed 14 * by the Internet Initiative Japan, Inc. The name of the 15 * IIJ may not be used to endorse or promote products derived 16 * from this software without specific prior written permission. 17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 18 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 19 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 20 * | 1/* 2 * PPP PAP Module 3 * 4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp) 5 * 6 * Copyright (C) 1993-94, Internet Initiative Japan, Inc. 7 * All rights reserverd. 8 * --- 4 unchanged lines hidden (view full) --- 13 * distribution and use acknowledge that the software was developed 14 * by the Internet Initiative Japan, Inc. The name of the 15 * IIJ may not be used to endorse or promote products derived 16 * from this software without specific prior written permission. 17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 18 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 19 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 20 * |
21 * $Id: pap.c,v 1.19 1997/11/22 03:37:43 brian Exp $ | 21 * $Id: pap.c,v 1.20 1997/12/24 09:29:11 brian Exp $ |
22 * 23 * TODO: 24 */ 25#include <sys/param.h> 26#include <netinet/in.h> 27 28#include <pwd.h> 29#include <stdio.h> --- 16 unchanged lines hidden (view full) --- 46#include "lcp.h" 47#include "pap.h" 48#include "loadalias.h" 49#include "vars.h" 50#include "hdlc.h" 51#include "lcpproto.h" 52#include "phase.h" 53#include "auth.h" | 22 * 23 * TODO: 24 */ 25#include <sys/param.h> 26#include <netinet/in.h> 27 28#include <pwd.h> 29#include <stdio.h> --- 16 unchanged lines hidden (view full) --- 46#include "lcp.h" 47#include "pap.h" 48#include "loadalias.h" 49#include "vars.h" 50#include "hdlc.h" 51#include "lcpproto.h" 52#include "phase.h" 53#include "auth.h" |
54#include "id.h" |
|
54 55static const char *papcodes[] = { "???", "REQUEST", "ACK", "NAK" }; 56 57static void 58SendPapChallenge(int papid) 59{ 60 struct fsmheader lh; 61 struct mbuf *bp; --- 106 unchanged lines hidden (view full) --- 168 if ((mode & MODE_DIRECT) && isatty(modem) && Enabled(ConfUtmp)) 169 if (Utmp) 170 LogPrintf(LogERROR, "Oops, already logged in on %s\n", 171 VarBaseDevice); 172 else { 173 struct utmp ut; 174 memset(&ut, 0, sizeof ut); 175 time(&ut.ut_time); | 55 56static const char *papcodes[] = { "???", "REQUEST", "ACK", "NAK" }; 57 58static void 59SendPapChallenge(int papid) 60{ 61 struct fsmheader lh; 62 struct mbuf *bp; --- 106 unchanged lines hidden (view full) --- 169 if ((mode & MODE_DIRECT) && isatty(modem) && Enabled(ConfUtmp)) 170 if (Utmp) 171 LogPrintf(LogERROR, "Oops, already logged in on %s\n", 172 VarBaseDevice); 173 else { 174 struct utmp ut; 175 memset(&ut, 0, sizeof ut); 176 time(&ut.ut_time); |
176 strncpy(ut.ut_name, cp+1, sizeof ut.ut_name - 1); | 177 strncpy(ut.ut_name, cp+1, sizeof ut.ut_name); |
177 strncpy(ut.ut_line, VarBaseDevice, sizeof ut.ut_line - 1); | 178 strncpy(ut.ut_line, VarBaseDevice, sizeof ut.ut_line - 1); |
178 if (logout(ut.ut_line)) 179 logwtmp(ut.ut_line, "", ""); 180 login(&ut); | 179 ID0login(&ut); |
181 Utmp = 1; 182 } 183 NewPhase(PHASE_NETWORK); 184 } 185 } else { 186 SendPapCode(php->id, PAP_NAK, "Login incorrect"); 187 reconnect(RECON_FALSE); 188 LcpClose(); --- 28 unchanged lines hidden --- | 180 Utmp = 1; 181 } 182 NewPhase(PHASE_NETWORK); 183 } 184 } else { 185 SendPapCode(php->id, PAP_NAK, "Login incorrect"); 186 reconnect(RECON_FALSE); 187 LcpClose(); --- 28 unchanged lines hidden --- |