diff options
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r-- | usr.sbin/ppp/physical.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.sbin/ppp/physical.c b/usr.sbin/ppp/physical.c index 89ccad8..04de982 100644 --- a/usr.sbin/ppp/physical.c +++ b/usr.sbin/ppp/physical.c @@ -831,11 +831,20 @@ physical_Login(struct physical *p, const char *name) if (p->type == PHYS_DIRECT && *p->name.base && !p->Utmp) { struct utmp ut; const char *connstr; + char *colon; memset(&ut, 0, sizeof ut); time(&ut.ut_time); strncpy(ut.ut_name, name, sizeof ut.ut_name); - strncpy(ut.ut_line, p->name.base, sizeof ut.ut_line); + if (p->handler && (p->handler->type == TCP_DEVICE || + p->handler->type == UDP_DEVICE)) { + strncpy(ut.ut_line, "ppp", sizeof ut.ut_line); + strncpy(ut.ut_host, p->name.base, sizeof ut.ut_host); + colon = memchr(ut.ut_host, ':', sizeof ut.ut_host); + if (colon) + *colon = '\0'; + } else + strncpy(ut.ut_line, p->name.base, sizeof ut.ut_line); if ((connstr = getenv("CONNECT"))) /* mgetty sets this to the connection speed */ strncpy(ut.ut_host, connstr, sizeof ut.ut_host); |