Commit 9112cee9 authored by peter's avatar peter
Browse files

Take $ENV{'USER'} for the login name, as rshd, telnetd and rlogind all

set it.  I'm still at a loss to explain why getlogin and `logname`
(which make a supposedly secure system call) are returning somebody else's
username when cvs (a non privileged process) is run on the end of a rsh.
If I do: rsh freefall 'print getlogin' it always seems to work...

(If this doesn't work after this commit, I might commandeer Jeffrey Hsu's
login.. :-)  This commit may say 'hsu' though.)
parent 7fd2ad89
#!/usr/bin/perl -w
#
# $Id: log_accum.pl,v 1.10 1995/10/31 23:17:11 peter Exp $
# $Id: log_accum.pl,v 1.11 1995/11/02 07:33:22 peter Exp $
#
# Perl filter to handle the log messages from the checkin of files in
# a directory. This script will group the lists of files by log
......@@ -279,7 +279,7 @@ sub mail_notification {
#
$id = getpgrp();
$state = $STATE_NONE;
$login = `logname` || (getpwuid($<))[0] || die("Unknown user $<.\n");
$login = $ENV{'USER'} || getlogin || (getpwuid($<))[0] || sprintf("uid#%d",$<);
chop($login);
@files = split(' ', $ARGV[0]);
@path = split('/', $files[0]);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment