[pptp-server] Patch for pptpd-1.0.0 (small utmp/wtmp entries)

Vanja Hrustic vanja at relaygroup.com
Sat Jun 10 17:59:03 CDT 2000


Hi!

I needed a small 'feature' that would show me (on 'last' or 'w' output)
if someone is logged in using PoPToP. This is a very silly/dirty hack
that inputs some information into utmp/wtmp and result is like:

(hostnames and IP addresses are modified - sorry about that :)

[root at aaaaa /]# w
  4:28am  up  4:41,  3 users,  load average: 0.00, 0.02, 0.00
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT
vanja    pts/1    bbbbbb.bbbbbbbbb 11:57pm  0.00s  0.53s   ?     -
vanja    pts/4    bbbbbb.bbbbbbbbb  2:15am  6:55   0.27s   ?     -
PPTP     3871     202.122.1.227     4:08am  0.00s 27.63s   ?     -
[root at aaaaa /]# last -9
PPTP     3871         202.122.1.227    Sun Jun 11 04:08   still logged
in   
PPTP     3827         202.122.1.227    Sun Jun 11 04:06 - 04:07 
(00:00)    
PPTP     3771         202.122.1.226    Sun Jun 11 04:04 - 04:06 
(00:01)    
PPTP     3769         202.122.1.227    Sun Jun 11 04:04 - 04:04 
(00:00)    
PPTP     3014         202.122.1.227    Sun Jun 11 03:56 - 03:59 
(00:02)    
PPTP     2042         202.122.1.226    Sun Jun 11 03:21 - 03:24 
(00:02)    
PPTP     1950         202.122.1.227    Sun Jun 11 03:04 - 03:07 
(00:02)    
PPTP     1858         202.122.1.227    Sun Jun 11 02:59 - 03:03 
(00:04)    
vanja    pts/4        bbbbbb.bbbbbbbbb Sun Jun 11 02:15   still logged
in   

wtmp begins Sat Jun 10 00:11:12 2000
[root at aaaaa /]#

The TTY is actually a PID of the current pptpctrl process - as much as I
could understand, real ttys are assigned by pppd, not pptpctrl, so... I
needed something 'unique'. PID does the job, helps me track active
sessions, and doesn't break anything. I hope...

For me, it was more important to see an active session from the outside,
than to have a real username and IP address as authenticated/assigned by
pppd. That's the reason why I wanted pptpctrl to write into utmp/wtmp.
pppd can probably be modified (it does have its own logwtmp() already,
and quick hack is to put it in chap.c, after the authentication is made,
and close the utmp in auth.c after the "connection is terminated" notice
- or I am wrong? :) to show the authenticated user and his 'local' IP
address, but I didn't need it. Sorry :)

The patch is gzipp'ed because of stupid Netscape - it likes to send text
attachments in the body of the mail. Ugh...

Please, review the patch before actually applying it - maybe I've made
some mistake (I am not skilled programmer, so... :). I'd be happy if
someone more experienced would review it and fix it.

It will probably work on Linux only.

Thanks.

Vanja Hrustic
The Relay Group
http://relaygroup.com
Technology Ahead of Time
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pptpd-1.0.0.utmp.diff.gz
Type: application/x-gzip
Size: 838 bytes
Desc: not available
URL: <http://lists.schulte.org/mailman/private/pptp-server/attachments/20000611/ce8171a2/attachment.bin>


More information about the pptp-server mailing list