/usr/share/weblogin/pwchange.fcgi is in webauth-weblogin 4.0.2-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | #!/usr/bin/perl -w
#
# pwchange.fcgi -- WebLogin password change page for WebAuth.
#
# This is the page to change user password for weblogin. It accepts
# information from the user, passes it to the WebKDC for authentication, and
# changes password if credentials match.
#
# It should use FastCGI if available, using the Perl CGI::Fast module's
# ability to fall back on regular operation if FastCGI isn't available.
#
# Written by Jon Robertson <jonrober@stanford.edu>
# Copyright 2010, 2011
# The Board of Trustees of the Leland Stanford Junior University
#
# See LICENSE for licensing terms.
##############################################################################
# Modules and declarations
##############################################################################
require 5.006;
use strict;
use CGI ();
use CGI::Cookie ();
use CGI::Fast ();
use WebAuth qw(:base64 :const :krb5 :key);
use WebLogin;
use WebKDC ();
use WebKDC::Config ();
use WebKDC::WebKDCException;
# Set to true in our signal handler to indicate that the script should exit
# once it finishes processing the current request.
our $EXITING = 0;
# The name of the template to use for logout.
our %PAGES = (login => 'login.tmpl',
logout => 'logout.tmpl',
confirm => 'confirm.tmpl',
pwchange => 'pwchange.tmpl',
error => 'error.tmpl');
##############################################################################
# Debugging
##############################################################################
# Dump as much information as possible about the environment and input to
# standard output. Not currently used anywhere, just left in here for use
# with debugging.
sub dump_stuff {
my ($var, $val);
foreach $var (sort keys %ENV) {
$val = $ENV{$var};
$val =~ s|\n|\\n|g;
$val =~ s|\"|\\\"|g;
print "${var}=\"${val}\"\n";
}
print "\n";
print "\n";
local $_;
print "INPUT: $_" while <STDIN>;
}
##############################################################################
# Main routine
##############################################################################
# Exit safely if we get a SIGTERM.
$SIG{TERM} = sub { $EXITING = 1 };
# The main loop. If we're not running under FastCGI, CGI::Fast will detect
# that and only run us through the loop once. Otherwise, we live in this
# processing loop until the FastCGI socket closes.
while (my $q = CGI::Fast->new) {
# Could try $weblogin->start_mode ('pwchange'); if following doesn't work.
$q->param ('rm', 'pwchange') unless defined $q->param ('rm');
my $weblogin = WebLogin->new (PARAMS => { pages => \%PAGES },
QUERY => $q);
$weblogin->run;
# Done on each pass through the FastCGI loop. Restart the script if its
# modification time has changed.
} continue {
exit if $EXITING;
exit if -M $ENV{SCRIPT_FILENAME} < 0;
}
|