http://paperlined.org/dev/src/pl/show_user_ids.pl

#!/usr/bin/perl

# Shows the current status of various user-IDs:
#
#   http://paperlined.org/apps/host_sudo_su_boundaries/user_ids.html

    use strict;
    use warnings;

    use Data::Dumper;
    #use Devel::Comments;           # uncomment this during development to enable the ### debugging statements


printf "     Real UID:  %s (%d)\n",
            scalar(getpwuid($>)),
            $>;

printf "Effective UID:  %s (%d)\n",
            scalar(getpwuid($<)),
            $<;

printf "   \$SUDO_USER:  %s\n",
            (exists $ENV{SUDO_USER} ? $ENV{SUDO_USER} : '(not set)');



Generated by GNU enscript 1.6.4.