Change the script to generate the list of personal homepages away from

using "ypcat passwd" and towards "getent passwd".  With work taking place
on the FreeBSD cluster, the former will eventually start failing.

While here, increase the lowest UID we care about from 100 to 500.
In reality, daemons may get any user ID below 1000, but the FreeBSD
cluster has some longstanding users with IDs in the 500s.  At the
very least, this change is no less wrong than the existing code.

Approved by:	bcr (mentor)
This commit is contained in:
Gavin Atkinson 2012-08-31 12:19:04 +00:00
parent 6caae5c602
commit ebd1077a36
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=39478

View file

@ -1,11 +1,12 @@
#!/usr/bin/perl
$passwd = '/etc/passwd';
# $FreeBSD$
$homepagedir = 'public_html';
@index = ('index.html', 'index.cgi');
$noindex = '.noindex';
open(P, 'ypcat passwd |') || die "open $passwd: $!\n";
open(P, 'getent passwd |') || die "getent passwd: $!\n";
undef @pages;
while(<P>) {
($login,$password,$uid,$gid,$gcos,$home,$shell) = split(/:/);
@ -14,7 +15,7 @@ while(<P>) {
$gcos =~ s/,.*//;
# disable daemons
next if $uid <= 100;
next if $uid < 500;
next if $login eq 'nobody';
next if $shell =~ ~ m%/(pppd|sliplogin|nologin|nonexistent)$%;