From 2435c6cf8e51ac2b5c027b532506b2793273906a Mon Sep 17 00:00:00 2001 From: sobomax Date: Sun, 19 Jan 2003 20:59:52 +0000 Subject: [PATCH] Add a new gettytab(5) option - `pl', which if set tells getty that the line in question is PPP-only line, i.e. no PPP-sequence detection is necessary and PPP login program referenced by `pp' should be started automatically instead of login(1) Feature suggested and sponsored by: United Networks of Ukraine No reply from: re MFC after: 2 weeks --- libexec/getty/gettytab.5 | 2 ++ libexec/getty/gettytab.h | 2 +- libexec/getty/init.c | 1 + libexec/getty/main.c | 6 +++--- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/libexec/getty/gettytab.5 b/libexec/getty/gettytab.5 index eaabac04e263..3e2e9b5808cd 100644 --- a/libexec/getty/gettytab.5 +++ b/libexec/getty/gettytab.5 @@ -159,6 +159,8 @@ hangup line on last close .It "pf num 0 delay" between first prompt and following flush (seconds) .It "pp str unused PPP authentication program" +.It "pl bool false don't detect PPP sequence, but start PPP login" +program referenced by pp automatically .It "ps bool false line connected to a" .Tn MICOM port selector diff --git a/libexec/getty/gettytab.h b/libexec/getty/gettytab.h index b8b03655e29e..1b95bf96d147 100644 --- a/libexec/getty/gettytab.h +++ b/libexec/getty/gettytab.h @@ -173,4 +173,4 @@ struct gettyflags { #define MB gettyflags[22].value #define HW gettyflags[23].value #define NC gettyflags[24].value - +#define PL gettyflags[25].value diff --git a/libexec/getty/init.c b/libexec/getty/init.c index dae64b274207..274e418b7b42 100644 --- a/libexec/getty/init.c +++ b/libexec/getty/init.c @@ -149,5 +149,6 @@ struct gettyflags gettyflags[] = { { "mb", 0 }, /* do MDMBUF flow control */ { "hw", 0 }, /* do CTSRTS flow control */ { "nc", 0 }, /* set clocal (no carrier) */ + { "pl", 0 }, /* use PPP instead of login(1) */ { 0 } }; diff --git a/libexec/getty/main.c b/libexec/getty/main.c index 1c1a7b8d891b..20a5d9aafdac 100644 --- a/libexec/getty/main.c +++ b/libexec/getty/main.c @@ -332,7 +332,7 @@ main(int argc, char *argv[]) } first_time = 0; - if (IM && *IM) + if (IM && *IM !(PL && PP)) putf(IM); if (setjmp(timeout)) { cfsetispeed(&tmode, B0); @@ -357,9 +357,9 @@ main(int argc, char *argv[]) digit++; *q++ = *p++; } - } else + } else if (!(PL && PP)) rval = getname(); - if (rval == 2) { + if (rval == 2 || (PL && PP)) { oflush(); alarm(0); limit.rlim_max = RLIM_INFINITY;