From vasim@uddias.diaspro.com  Sun Oct 26 22:15:55 1997
Received: from uddias.diaspro.com (root@uddias.diaspro.com [194.84.211.1])
          by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id WAA18105
          for <FreeBSD-gnats-submit@freebsd.org>; Sun, 26 Oct 1997 22:15:47 -0800 (PST)
          (envelope-from vasim@uddias.diaspro.com)
Received: (from vasim@localhost)
	by uddias.diaspro.com (8.8.7/8.8.7) id LAA11655;
	Mon, 27 Oct 1997 11:11:44 +0500 (ES)
Message-Id: <199710270611.LAA11655@uddias.diaspro.com>
Date: Mon, 27 Oct 1997 11:11:44 +0500 (ES)
From: Vasim Valejev <vasim@uddias.diaspro.com>
Reply-To: vasim@uddias.diaspro.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: pppd with PAP logs one user twice in wtmp
X-Send-Pr-Version: 3.2

>Number:         4862
>Category:       bin
>Synopsis:       pppd with PAP logs one user twice in wtmp
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 26 22:20:01 PST 1997
>Closed-Date:    Tue Oct 28 08:51:05 PST 1997
>Last-Modified:  Tue Oct 28 09:00:01 PST 1997
>Originator:     Vasim Valejev
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
DiasPro
>Environment:

	FreeBSD 3.0-CURRENT

>Description:

	when user logging via PAP , pppd creates two records in wtmp file with one username and tty . Example (from last command) :

***
baheman          ttyd5    :PPP               27  09:44 - 09:44  (00:00)
baheman          ttyd5                       27  09:44   still logged in
***

	pppd options : modem auth +pap -chap login

>How-To-Repeat:


>Fix:
	
	I use next fix :

*** auth.c.orig	Fri Oct 10 12:02:54 1997
--- auth.c	Mon Oct 27 11:10:48 1997
***************
*** 910,914 ****
  	tty += 5;
  
-     logwtmp(tty, user, remote_name);		/* Add wtmp login entry */
      logged_in = TRUE;
  
--- 910,913 ----
>Release-Note:
>Audit-Trail:

From: Brian Somers <brian@awfulhak.org>
To: vasim@uddias.diaspro.com
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/4862: pppd with PAP logs one user twice in wtmp 
Date: Tue, 28 Oct 1997 00:15:52 +0000

 [.....]
 > >Description:
 > 
 > 	when user logging via PAP , pppd creates two records in wtmp file with one username and tty . Example (from last command) :
 > 
 > ***
 > baheman          ttyd5    :PPP               27  09:44 - 09:44  (00:00)
 > baheman          ttyd5                       27  09:44   still logged in
 > ***
 
 Are you actually "logging in" as well as using pap ?  This would 
 explain the duplicate.  IMHO, pppd needs a -utmp option for when 
 people wanna do both. 
 
 -- 
 Brian <brian@Awfulhak.org>, <brian@FreeBSD.org>, <bri@OpenBSD.org>
       <http://www.Awfulhak.org>
 Don't _EVER_ lose your sense of humour....
 
 

From: Vasim Valejev <vasim@diaspro.com>
To: Brian Somers <brian@awfulhak.org>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/4862: pppd with PAP logs one user twice in wtmp 
Date: Tue, 28 Oct 1997 10:19:24 +0500 (ES)

 Hi !
 
 On Tue, 28 Oct 1997, Brian Somers wrote:
 
 > > 	when user logging via PAP , pppd creates two records in wtmp file with one username and tty . Example (from last command) :
 > > 
 > > ***
 > > baheman          ttyd5    :PPP               27  09:44 - 09:44  (00:00)
 > > baheman          ttyd5                       27  09:44   still logged in
 > > ***
 > 
 > Are you actually "logging in" as well as using pap ?
 
 Yes . And this bug appears only in 3.0-CURRENT . In 2.2-STABLE , no
  logwtmp() call when user logged in and pppd from 2.2-STABLE works fine .
  For example (on 3.0-CURRENT) :
 
 I have mgetty on ttyd* with AUTO_PPP support . mgetty execute next
  command when receive ppp-handshake :
 
 /usr/sbin/pppd -detach modem crtscts auth +pap -chap login lcp-restart 10
  pap-max-authreq 1 dns1 $myaddr ms-dns $myaddr name $myname
  $myaddr:$addr
 
 On other machine i run 'ppp papsite' with next /etc/ppp/ppp.conf :
 
 default:
  set device /dev/cuaa0
  set speed 57600
  set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \"\" ATE1Q0 OK-AT-OK \\dATDP\\T TIMEOUT 40 CONNECT"
 
 papsite:
  set phone ******
  set login ""
  deny chap
  accept pap
 # enable pap
  set authname joe
  set authkey *******
 
 And last command says after this call :
 
 ***
 joe              ttyd5    :PPP               28  09:19 - 09:19  (00:00)
 joe              ttyd5                       28  09:19   still logged in
 ***
 
 (There russian letters in date)
 
 It cause problems to my accounting program :( .
 
 >  This would 
 > explain the duplicate.  IMHO, pppd needs a -utmp option for when 
 > people wanna do both. 
 
 May be . But remove logwtmp call before :) . login(&utmp) appends
  record in wtmp file and call 'logwtmp(tty, user, remote_name)' in line
  913 auth.c not need !
 
 Vasim V. (2:5011/27 http://members.tripod.com/~Vasim VV86-RIPE)
 
State-Changed-From-To: open->closed 
State-Changed-By: brian 
State-Changed-When: Tue Oct 28 08:51:05 PST 1997 
State-Changed-Why:  
Now fixed in -current (not broken in 2.2) 

From: Brian Somers <brian@awfulhak.org>
To: Vasim Valejev <vasim@diaspro.com>
Cc: Brian Somers <brian@awfulhak.org>, FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/4862: pppd with PAP logs one user twice in wtmp 
Date: Tue, 28 Oct 1997 16:53:00 +0000

 > May be . But remove logwtmp call before :) . login(&utmp) appends
 >  record in wtmp file and call 'logwtmp(tty, user, remote_name)' in line
 >  913 auth.c not need !
 
 Gotcha.  Consider it done (auth.c 1.20)
 
 > Vasim V. (2:5011/27 http://members.tripod.com/~Vasim VV86-RIPE)
 > 
 
 -- 
 Brian <brian@Awfulhak.org>, <brian@FreeBSD.org>, <bri@OpenBSD.org>
       <http://www.Awfulhak.org>
 Don't _EVER_ lose your sense of humour....
 
 
>Unformatted:
