-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywithfp.pl
More file actions
executable file
·30 lines (25 loc) · 844 Bytes
/
playwithfp.pl
File metadata and controls
executable file
·30 lines (25 loc) · 844 Bytes
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
#!/usr/bin/perl
use Passwd::Linux qw(modpwinfo mgetpwnam);
my $MIN_UID = 999; # Only change passwords greater than this UID
open USERNAMES, "< usernames2.txt" or die "Can't open usernames.txt\n";
while (<USERNAMES>) {
(my $USER, my $DOMAIN) = split /,/,$_,2;
# print "Processing user $USER : $DOMAIN";
my @PWDATA = mgetpwnam("$USER");
if ( $PWDATA[2] > $MIN_UID ) {
my $FPDIR = $PWDATA[5] . "/html/_vti_pvt";
if ( -e "$FPDIR/service.pwd" ) { # Frontpage extensions are installed
open FPPWDFILE, "< $FPDIR/service.pwd";
open TMPFILE, "> /tmp/tmpfile";
while (<FPPWDFILE>) {
if ($_ =~ m/^#/) { print TMPFILE $_; }
else {
(my $FPNAME, my $FPPWD) = split /:/, $_, 2;
print TMPFILE "$FPNAME:$FPPWD";
}
}
close FPPWDFILE;
close TMPFILE;
}
}
}