Browse Source

Added server-side username to output.

Alois Mahdal (@azzgoat) 11 years ago
parent
commit
c05b6197e5
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      cgi-bin/hello_host.cgi

+ 2
- 1
cgi-bin/hello_host.cgi View File

@@ -21,12 +21,13 @@ my $myip = $ENV{'SERVER_ADDR'};
21 21
 my $myport = $ENV{'SERVER_PORT'};
22 22
 my $myhostname = hostname;
23 23
 my $mylocaltime = &mygetstrtime;
24
+my $username = getpwuid( $< );
24 25
 
25 26
 print "Client:\n";
26 27
 print "  $ip:$port\n";
27 28
 print "\n";
28 29
 print "Server:\n";
29 30
 print "  $myip:$myport\n";
30
-print "  $myhostname:$myport\n";
31
+print "  $username\@$myhostname:$myport\n";
31 32
 print "  $mylocaltime\n";
32 33