Subject: Browser-proofing patch for wu-2.4.2-academ[BETA-12]

From: Tom Christiansen <[email-masked]>
Date: Fri, 14 Feb 1997 11:36:49 -0700

#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.2).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 1997-02-14 11:34 MST by <[email-masked]>.
# Source directory was `/tmp'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode       name
# ------ ---------- ------------------------------------------
#   2158 -rw-r--r-- wu-ftpd-b12-browser-patch/README
#  11143 -rwxr-xr-x wu-ftpd-b12-browser-patch/ckaddr
#   1330 -rw-r--r-- wu-ftpd-b12-browser-patch/msg.badpass
#   4599 -rw-r--r-- wu-ftpd-b12-browser-patch/wu-ftpd-b12.patch
#
save_IFS="${IFS}"
IFS="${IFS}:"
gettext_dir=FAILED
locale_dir=FAILED
first_param="$1"
for dir in $PATH
do
  if test "$gettext_dir" = FAILED && test -f $dir/gettext \
     && ($dir/gettext --version >/dev/null 2>&1)
  then
    set `$dir/gettext --version 2>&1`
    if test "$3" = GNU
    then
      gettext_dir=$dir
    fi
  fi
  if test "$locale_dir" = FAILED && test -f $dir/shar \
     && ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
  then
    locale_dir=`$dir/shar --print-text-domain-dir`
  fi
done
IFS="$save_IFS"
if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
then
  echo=echo
else
  TEXTDOMAINDIR=$locale_dir
  export TEXTDOMAINDIR
  TEXTDOMAIN=sharutils
  export TEXTDOMAIN
  echo="$gettext_dir/gettext -s"
fi
touch -am 1231235999 $$.touch >/dev/null 2>&1
if test ! -f 1231235999 && test -f $$.touch; then
  shar_touch=touch
else
  shar_touch=:
  echo
  $echo 'WARNING: not restoring timestamps.  Consider getting and'
  $echo "installing GNU \`touch', distributed in GNU File Utilities..."
  echo
fi
rm -f 1231235999 $$.touch
#
if mkdir _sh06204; then
  $echo 'x -' 'creating lock directory'
else
  $echo 'failed to create lock directory'
  exit 1
fi
# ============= wu-ftpd-b12-browser-patch/README ==============
if test ! -d 'wu-ftpd-b12-browser-patch'; then
  $echo 'x -' 'creating directory' 'wu-ftpd-b12-browser-patch'
  mkdir 'wu-ftpd-b12-browser-patch'
fi
if test -f 'wu-ftpd-b12-browser-patch/README' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'wu-ftpd-b12-browser-patch/README' '(file already exists)'
else
  $echo 'x -' extracting 'wu-ftpd-b12-browser-patch/README' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'wu-ftpd-b12-browser-patch/README' &&
( This one is just *bound* to get me talked about. :-)
X
Because I have a slow modem link, I offer an http server that does
dynamic redirections on requests to fetch for the big stuff via the web.
X
But ftp doesn't support such things, so I'm stuck with my line getting
sucked down by the mad clickers who've never done anything more with a
computer than click the mouse in a web browser.
X
I prefer that people not use ftp for large transfers, but I can't stop
them.  Well, couldn't.  Here's a patch that allows for flexible password
validation checking.  The goal is not to create junk mail, but rather
to dissuade the neophyte internet wannabes from using ftp instead of http.
X
It is enabled by this line in the ftpaccess file:
X
X    # passwd-check  <none|trivial|rfc822|bogus>  [<enforce|warn>]
X    passwd-check  bogus  enforce
X
That means it will do a password verification check by calling an external
filter.  This filter defaults to a program called "ftpdckr" (_PATH_PWDCHK)
in the same place as the other ftp{users,access,conversions,groups} go.
You may set this to another program by placing this in the ftpaccess file:
X
X    bogus-filter /usr/local/etc/ftpucheck
X
If you wish to issue a special message upon failure, you can do 
with a line like this:
X
X    passwd-failure  /usr/etc/msg.badpass
X
The bogus passwd filter program is expected to take as its first argument
the password supplied, and to exit 0 if it's ok, and non-zero if it's not
ok.  Any extra logging is up to the filter.
X
X    SECURITY WARNING: You must be careful if using this checker from other
X    programs to take care to use only execvp() (or its moral equivalent)
X    and not a random system() on it, because there could of course be
X    shell escapes in the argument.
X
A sample checker is supplied (called ckaddr in this distribution).  It is
more than slightly persnicketty.  It will serve as a general-purpose
[email-masked] checker as well, such as for CGI programs, etc.
X
I don't know for sure whether this should make its way into the standard
wu-ftpd, but I've had it asked for so many times that here it is.
X
Tom Christiansen
[email-masked]
Fri Feb 14 11:33:58 MST 1997
X
SHAR_EOF
  $shar_touch -am 0214113497 'wu-ftpd-b12-browser-patch/README' &&
  chmod 0644 'wu-ftpd-b12-browser-patch/README' ||
  $echo 'restore of' 'wu-ftpd-b12-browser-patch/README' 'failed'
  shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'wu-ftpd-b12-browser-patch/README'`"
  test 2158 -eq "$shar_count" ||
  $echo 'wu-ftpd-b12-browser-patch/README:' 'original size' '2158,' 'current size' "$shar_count!"
fi
# ============= wu-ftpd-b12-browser-patch/ckaddr ==============
if test -f 'wu-ftpd-b12-browser-patch/ckaddr' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'wu-ftpd-b12-browser-patch/ckaddr' '(file already exists)'
else
  $echo 'x -' extracting 'wu-ftpd-b12-browser-patch/ckaddr' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'wu-ftpd-b12-browser-patch/ckaddr' &&
#!/usr/bin/perl
#
# addrcheck - mail address checker
# by [email-masked]
# Copyright 1997 Tom Christiansen
# version 1.0 Fri Feb 14 10:49:23 MST 1997
X
####################################
# this program takes an email address as its argument
# and decides whether you're being spoofed or not.
# it exists 0 if it likes the address, and 1 if it doesn't.
# 
# can be tested interactively.  if not interactive, it will
# use syslog.
#
# should be rewritten instead of just growing via hacks.
####################################
X
$LOGGER   = '/usr/bin/logger';  # or /usr/ucb?
$NSLOOKUP = '/usr/bin/nslookup';  # or /usr/ucb?
X
$DEBUG = -t STDIN && -t STDOUT;
$address = shift || die "usage: $0 address\n";
X
for ($address) {
X    s/^-+//;
X    tr/A-Z/a-z/;
}
X
($user, $host) = split /\@/, $address;
X
# we check in this order because of speed;
# this way it will fail more quickly.
X
check_passwd($user);	# picky
check_host($host);
ck822($address);   	# inscrutable
dns_check($host);  	# slow
X
Xexit 0;
X
####################################
X 
sub bad {
X    # GLOBAL $hispass and $what
X    if ($DEBUG) {
X	print "$what `$hispass' is bad: @_\n";
X    } else {
X	system $LOGGER,
X		    "-p", "daemon.notice", 
X		    "-t", "ftpucheck",
X		"BOGUS \U$what\E $hispass (@_)";
X    } 
X    exit 1;
} 
X
####################################
X
#############
X
sub check_passwd {  
X    local $what = 'user';
X    local $hispass = shift;
X
X    for (@rude) {
X	bad("rude") if index($hispass, lc $_) != -1;
X    } 
X
X    for (@full) {
X	bad("full") if $hispass eq lc $_;
X    } 
X
X    # single char
X    bad("single") if length($hispass) == 1;
X
X    study $hispass;
X
X    bad("dup letters") if $hispass =~ /(\w)\1{3,}/;
X
X    bad("white") if $hispass =~ /\s/;
X
X    bad("junk") if $hispass =~ /[;,\/#^*]/;
X
X    $V = 'aeiouy';
X    if ($hispass =~ /netscape/ || $hispass =~ /^m[$V]*[sz]+[$V]*l+[$V]*\W*$/) {
X	bad("mozilla");
X    } 
X
X    if ($hispass =~ /xyz+y/) {
X	bad("xyzzy");
X    } 
X
X    # all same letter
X    bad("dup letters") if $hispass =~ /^(.)\1+$/;
X
X    # want letters
X    bad("ugly") unless $hispass =~ /[a-z]/;
X
X    bad("backspace") if $hispass =~ /[\010\177]/;
X
X    $letters = "qwertyuiopasdfghjklzxcvbnmmnbvcxzlkjhgfrdsapoiuytrewq";
X
X    # consecutive
X    bad("consecutive") if 
X	    length($hispass) > 2 &&
X		( index($letters, $hispass) != -1
X		    ||
X		  ($hispass =~ /^(\w+)\1$/ && length($1) > 2
X		    && index($letters, $1) != -1)
X		);
X
X    print "$what: $hispass is good\n" if $DEBUG;
X
}
X
X
#############
X
sub check_host {
X    local $what = 'host';
X    local $hispass = shift;
X
X    bad("dotless") unless index($hispass, '.') >= 0;
X
X    for (@rude) {
X	bad("rude") if index($hispass, lc $_) != -1;
X    } 
X
X    for (@full) {
X	bad("full") if $hispass eq lc $_;
X    } 
X
X    # single char
X    bad("single") if length($hispass) == 1;
X
X    study $hispass;
X
X    bad("white") if $hispass =~ /\s/;
X
X    bad("junk") if $hispass =~ /[;,\/#^*]/;
X
X    # want letters, darnit;  this will cause 127.1 to fail though
X    bad("ugly") unless $hispass =~ /[a-z]/;
X
X    bad("backspace") if $hispass =~ /[\010\177]/;
X
X    $letters = "qwertyuiopasdfghjklzxcvbnmmnbvcxzlkjhgfrdsapoiuytrewq";
X
X    # consecutive
X    bad("consecutive") if 
X	    length($hispass) > 2 &&
X		( index($letters, $hispass) != -1
X		    ||
X		  ($hispass =~ /^(\w+)\1$/ && length($1) > 2
X		    && index($letters, $1) != -1)
X		);
X
X    print "$what: $hispass is good\n" if $DEBUG;
X
}
X
sub dns_check {
X    # first try an MX record, then an A rec (for badly configged hosts)
X
X    my $host = shift;
X    local $/ = undef;
X    local $what = "DNS record";
X    local $hispass = $host;
X
X
X    # the following is comment out for security reasons:
X    #	if ( `nslookup -query=mx $host` =~ /mail exchanger/
X    # otherwise there could be naughty bits in $host
X    # we'll bypass system() and get right at execvp()
X
X    if (open(NS, "-|")) {
X	if (<NS> =~ /mail exchanger/) {
X	    print "$what MX: $hispass is good\n" if $DEBUG;
X	    close NS;
X	    return;
X	}
X    } else {
X	open(SE, ">&STDERR");
X	open(STDERR, ">/dev/null");
X	exec $NSLOOKUP, '-query=mx', $host;
X	open(STDERR, ">&SE");
X	die "can't exec nslookup: $!";
X    } 
X
X    if (open(NS, "-|")) {
X	if (<NS> =~ /answer:.*Address/s) {
X	    print "$what A: $hispass is good\n" if $DEBUG;
X	    close NS;
X	    return;
X	}
X    } else {
X	open(SE, ">&STDERR");
X	open(STDERR, ">/dev/null");
X	exec $NSLOOKUP, '-query=a', $host;
X	open(STDERR, ">&SE");
X	die "can't exec nslookup: $!";
X    } 
X
X    bad("No DNS");
} 
X
X
sub ck822 { 
X
X    # ck822 -- check whether address is valid rfc 822 address
X    # [email-masked]
X    #
X    # pattern developed in program by jfriedl; 
X    # see "Mastering Regular Expressions" from ORA for details
X
X    # this will error on something like "ftp.perl.com." because
X    # even though dns wants it, rfc822 hates it.  shucks.
X
X    local $what = 'address';
X
X    local $hispass = shift;
X    local $_;
X
X    $is_a_valid_rfc_822_addr = '';
X
X    while (<DATA>) {
X	chomp;
X	$is_a_valid_rfc_822_addr .= $_;
X    } 
X
X
X    bad("rfc822 failure") unless $hispass =~ /^${is_a_valid_rfc_822_addr}$/o;
X    print "$what: $hispass is good\n" if $DEBUG;
}
X
##############################
# initializations
##############################
X
BEGIN {
X
X    @full = qw{
X
X	admin
X	anon
X	anonymous
X	bar
X	big-liar
X	bin
X	bizarre
X	bla
X	blah
X	bogus
X	cache
X	collect
X	compuserve
X	cool
X	crud
X	DeleGateMaster
X	devnull
X	dialup
X	dork
X	dummy
X	employee
X	first1
X	foo
X	friendly
X	ftpsearch-collect
X	fu
X	god
X	guest
X	gunk
X	gw
X	harvest
X	here
X	hi
X	ident
X	ident
X	ie30user
X	info
X	internet
X	junk
X	liar
X	login
X	lycos
X	maxima
X	me
X	mirror
X	mosaic
X	nobody
X	none
X	none-known
X	nouser
X	ntcon
X	ok
X	outbound
X	postmaster
X	president
X	public
X	Put_Your_Email_Address
X	report_abuse
X	root
X	satan
X	socks
X	spanky
X	src
X	sticky
X	system
X	there
X	Unknown_Netscape_User
X	Unregistered
X	unverified
X	user
X	UserName
X	vice-president
X	vividnet
X	whoever
X	wow
X	xyz
X	xyz
X
X    };
X
X    @start = qw{
X
X	aaa
X	abc
X	account
X	anon
X	anon
X	asquid
X	daemon 
X	delegate
X	ftp
X	gopher
X	gotch
X	oracle
X	otthttp
X	pass
X	satan
X	squid
X	student
X	test
X	web
X	xx
X
X    };
X
X    @anywhere = qw{
X
X	adresse
X	asdf
X	asfd
X	cache
X	firewall
X	-gw
X	http
X	mail
X	mirror
X	mother
X	name
X	nobody
X	proxy
X	sadf
X	system
X	user
X	www
X
X    }; 
X
X    @rude = qw{
X
X	asshole
X	crap
X	cunt
X	damn
X	fuck
X	piss
X	shit
X	suck
X	tits
X	upyour
X
X    };
X
}
X
# don't touch this stuff down here or you'll break the rfc822 matcher.
__END__
(?:[\040\t]|\((?:[^\\\x80-\xff\n\015()]|\\[^\x80-\xff]|\((?:[^\\\x80-\xff\n
\015()]|\\[^\x80-\xff])*\))*\))*(?:(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\
xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|"(?:[^\\\x80-\xff\n\015"
]|\\[^\x80-\xff])*")(?:(?:[\040\t]|\((?:[^\\\x80-\xff\n\015()]|\\[^\x80-\xf
f]|\((?:[^\\\x80-\xff\n\015()]|\\[^\x80-\xff])*\))*\))*\.(?:[\040\t]|\((?:[
^\\\x80-\xff\n\015()]|\\[^\x80-\xff]|\((?:[^\\\x80-\xff\n\015()]|\\[^\x80-\
xff])*\))*\))*(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;
:".\\\[\]\000-\037\x80-\xff])|"(?:[^\\\x80-\xff\n\015"]|\\[^\x80-\xff])*"))
*(?:[\040\t]|\((?:[^\\\x80-\xff\n\015()]|\\[^\x80-\xff]|\((?:[^\\\x80-\xff\
n\015()]|\\[^\x80-\xff])*\))*\))*@(?:[\040\t]|\((?:[^\\\x80-\xff\n\015()]|\
\[^\x80-\xff]|\((?:[^\\\x80-\xff\n\015()]|\\[^\x80-\xff])*\))*\))*(?:[^(\04
0)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-
\xff])|\[(?:[^\\\x80-\xff\n\015\[\]]|\\[^\x80-\xff])*\])(?:(?:[\040\t]|\((?
:[^\\\x80-\xff\n\015()]|\\[^\x80-\xff]|\((?:[^\\\x80-\xff\n\015()]|\\[^\x80
-\xff])*\))*\))*\.(?:[\040\t]|\((?:[^\\\x80-\xff\n\015()]|\\[^\x80-\xff]|\(
(?:[^\\\x80-\xff\n\015()]|\\[^\x80-\xff])*\))*\))*(?:[^(\040)<>@,;:".\\\[\]
\000-\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|\[(?:[^\\
\x80-\xff\n\015\[\]]|\\[^\x80-\xff])*\]))*|(?:[^(\040)<>@,;:".\\\[\]\000-\0
37\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|"(?:[^\\\x80-\xf
f\n\015"]|\\[^\x80-\xff])*")(?:[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\03
7]|\((?:[^\\\x80-\xff\n\015()]|\\[^\x80-\xff]|\((?:[^\\\x80-\xff\n\015()]|\
\[^\x80-\xff])*\))*\)|"(?:[^\\\x80-\xff\n\015"]|\\[^\x80-\xff])*")*<(?:[\04
0\t]|\((?:[^\\\x80-\xff\n\015()]|\\[^\x80-\xff]|\((?:[^\\\x80-\xff\n\015()]
|\\[^\x80-\xff])*\))*\))*(?:@(?:[\040\t]|\((?:[^\\\x80-\xff\n\015()]|\\[^\x
80-\xff]|\((?:[^\\\x80-\xff\n\015()]|\\[^\x80-\xff])*\))*\))*(?:[^(\040)<>@
,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]
)|\[(?:[^\\\x80-\xff\n\015\[\]]|\\[^\x80-\xff])*\])(?:(?:[\040\t]|\((?:[^\\
\x80-\xff\n\015()]|\\[^\x80-\xff]|\((?:[^\\\x80-\xff\n\015()]|\\[^\x80-\xff
])*\))*\))*\.(?:[\040\t]|\((?:[^\\\x80-\xff\n\015()]|\\[^\x80-\xff]|\((?:[^
\\\x80-\xff\n\015()]|\\[^\x80-\xff])*\))*\))*(?:[^(\040)<>@,;:".\\\[\]\000-
\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|\[(?:[^\\\x80-
\xff\n\015\[\]]|\\[^\x80-\xff])*\]))*(?:(?:[\040\t]|\((?:[^\\\x80-\xff\n\01
5()]|\\[^\x80-\xff]|\((?:[^\\\x80-\xff\n\015()]|\\[^\x80-\xff])*\))*\))*,(?
:[\040\t]|\((?:[^\\\x80-\xff\n\015()]|\\[^\x80-\xff]|\((?:[^\\\x80-\xff\n\0
15()]|\\[^\x80-\xff])*\))*\))*@(?:[\040\t]|\((?:[^\\\x80-\xff\n\015()]|\\[^
\x80-\xff]|\((?:[^\\\x80-\xff\n\015()]|\\[^\x80-\xff])*\))*\))*(?:[^(\040)<
>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xf
f])|\[(?:[^\\\x80-\xff\n\015\[\]]|\\[^\x80-\xff])*\])(?:(?:[\040\t]|\((?:[^
\\\x80-\xff\n\015()]|\\[^\x80-\xff]|\((?:[^\\\x80-\xff\n\015()]|\\[^\x80-\x
ff])*\))*\))*\.(?:[\040\t]|\((?:[^\\\x80-\xff\n\015()]|\\[^\x80-\xff]|\((?:
[^\\\x80-\xff\n\015()]|\\[^\x80-\xff])*\))*\))*(?:[^(\040)<>@,;:".\\\[\]\00
0-\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|\[(?:[^\\\x8
0-\xff\n\015\[\]]|\\[^\x80-\xff])*\]))*)*:(?:[\040\t]|\((?:[^\\\x80-\xff\n\
015()]|\\[^\x80-\xff]|\((?:[^\\\x80-\xff\n\015()]|\\[^\x80-\xff])*\))*\))*)
?(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000
-\037\x80-\xff])|"(?:[^\\\x80-\xff\n\015"]|\\[^\x80-\xff])*")(?:(?:[\040\t]
|\((?:[^\\\x80-\xff\n\015()]|\\[^\x80-\xff]|\((?:[^\\\x80-\xff\n\015()]|\\[
^\x80-\xff])*\))*\))*\.(?:[\040\t]|\((?:[^\\\x80-\xff\n\015()]|\\[^\x80-\xf
f]|\((?:[^\\\x80-\xff\n\015()]|\\[^\x80-\xff])*\))*\))*(?:[^(\040)<>@,;:".\
\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|"(?:
[^\\\x80-\xff\n\015"]|\\[^\x80-\xff])*"))*(?:[\040\t]|\((?:[^\\\x80-\xff\n\
015()]|\\[^\x80-\xff]|\((?:[^\\\x80-\xff\n\015()]|\\[^\x80-\xff])*\))*\))*@
(?:[\040\t]|\((?:[^\\\x80-\xff\n\015()]|\\[^\x80-\xff]|\((?:[^\\\x80-\xff\n
\015()]|\\[^\x80-\xff])*\))*\))*(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff
]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|\[(?:[^\\\x80-\xff\n\015\[\
]]|\\[^\x80-\xff])*\])(?:(?:[\040\t]|\((?:[^\\\x80-\xff\n\015()]|\\[^\x80-\
xff]|\((?:[^\\\x80-\xff\n\015()]|\\[^\x80-\xff])*\))*\))*\.(?:[\040\t]|\((?
:[^\\\x80-\xff\n\015()]|\\[^\x80-\xff]|\((?:[^\\\x80-\xff\n\015()]|\\[^\x80
-\xff])*\))*\))*(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@
,;:".\\\[\]\000-\037\x80-\xff])|\[(?:[^\\\x80-\xff\n\015\[\]]|\\[^\x80-\xff
])*\]))*(?:[\040\t]|\((?:[^\\\x80-\xff\n\015()]|\\[^\x80-\xff]|\((?:[^\\\x8
0-\xff\n\015()]|\\[^\x80-\xff])*\))*\))*>)(?:[\040\t]|\((?:[^\\\x80-\xff\n\
015()]|\\[^\x80-\xff]|\((?:[^\\\x80-\xff\n\015()]|\\[^\x80-\xff])*\))*\))*
SHAR_EOF
  $shar_touch -am 0214113297 'wu-ftpd-b12-browser-patch/ckaddr' &&
  chmod 0755 'wu-ftpd-b12-browser-patch/ckaddr' ||
  $echo 'restore of' 'wu-ftpd-b12-browser-patch/ckaddr' 'failed'
  shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'wu-ftpd-b12-browser-patch/ckaddr'`"
  test 11143 -eq "$shar_count" ||
  $echo 'wu-ftpd-b12-browser-patch/ckaddr:' 'original size' '11143,' 'current size' "$shar_count!"
fi
# ============= wu-ftpd-b12-browser-patch/msg.badpass ==============
if test -f 'wu-ftpd-b12-browser-patch/msg.badpass' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'wu-ftpd-b12-browser-patch/msg.badpass' '(file already exists)'
else
  $echo 'x -' extracting 'wu-ftpd-b12-browser-patch/msg.badpass' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'wu-ftpd-b12-browser-patch/msg.badpass' &&
X
If you are using a web browser and/or proxy server, please report to your
service provider or software vendor that their product is homogenizing
all email addresses, and that this is evil.
X
Proxy servers are notoriously secretive, and web browsers are getting
that way.  For example, some versions of Netscape always say "mozilla"
(until the 3.0 release, where it's configurable), and Micro$oft's
Internet Explorer masquerades as "webuser".  Such bogus email responses
are simply not acceptable on this site.
X
It may be possible for you to instead of using something like that
ftp://ftp.somewhere.dom/, to manually specify ftp://[email-masked]/
and be prompted for your real email address.  Please be a good net citizen
and place it there.  Rest assured that you will not be placed on any
junk-mail mailing lists as a result of this action.
X
If that doesn't work, you can always use something like Mosaic.  Better
yet, go get yourself a *real* ftp program.  It turns out that things
like ncftp are phenomenally more featureful and useful than the 
mini ftp clients found in most web browsers.
X
The truth is that I have a slow ftp connection, so I have to restrict
access somehow.  This is the best way I've come up with, because it keeps
out billions and billions of K00l D00DZ who can't do anything but point
and click.
X
SHAR_EOF
  $shar_touch -am 0214100597 'wu-ftpd-b12-browser-patch/msg.badpass' &&
  chmod 0644 'wu-ftpd-b12-browser-patch/msg.badpass' ||
  $echo 'restore of' 'wu-ftpd-b12-browser-patch/msg.badpass' 'failed'
  shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'wu-ftpd-b12-browser-patch/msg.badpass'`"
  test 1330 -eq "$shar_count" ||
  $echo 'wu-ftpd-b12-browser-patch/msg.badpass:' 'original size' '1330,' 'current size' "$shar_count!"
fi
# ============= wu-ftpd-b12-browser-patch/wu-ftpd-b12.patch ==============
if test -f 'wu-ftpd-b12-browser-patch/wu-ftpd-b12.patch' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'wu-ftpd-b12-browser-patch/wu-ftpd-b12.patch' '(file already exists)'
else
  $echo 'x -' extracting 'wu-ftpd-b12-browser-patch/wu-ftpd-b12.patch' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'wu-ftpd-b12-browser-patch/wu-ftpd-b12.patch' &&
Only in src: Makefile
Only in src: access.o
Only in src: acl.o
Only in src: authenticate.o
Only in src: ckconfig
diff -ru ORIG/ckconfig.c src/ckconfig.c
--- ORIG/ckconfig.c	Fri Feb  7 09:18:09 1997
+++ src/ckconfig.c	Fri Feb  7 10:21:42 1997
@@ -52,6 +52,18 @@
X     printf("ok.\n");
X 
X   /* _PATH_FTPACCESS  */
+  fprintf(stdout, "\nChecking _PATH_PWDCHK :: %s\n", _PATH_PWDCHK);
+  if ( (stat(_PATH_PWDCHK, &sbuf)) < 0 )
+    printf("I can't find it... look in doc/examples for an example.\n");
+  else 
+#if defined(S_ISREG) && defined(S_IXOTH)
+  if (!(S_ISREG(sbuf.st_mode) && (sbuf.st_mode & S_IXOTH)))
+    printf("Not a plainfile executable\n");
+  else
+#endif
+    printf("ok.\n");
+
+  /* _PATH_FTPACCESS  */
X   fprintf(stdout, "\nChecking _PATH_FTPACCESS :: %s\n", _PATH_FTPACCESS);
X   if ( (stat(_PATH_FTPACCESS, &sbuf)) < 0 )
X     printf("I can't find it... look in doc/examples for an example.\n");
Only in src: config
Only in src: conversions.o
Only in src: edit
Only in src: extensions.o
Only in src: ftpcmd.o
Only in src: ftpcount
Only in src: ftpd
diff -ru ORIG/ftpd.c src/ftpd.c
--- ORIG/ftpd.c	Fri Feb  7 09:18:09 1997
+++ src/ftpd.c	Fri Feb  7 10:58:16 1997
@@ -1265,6 +1265,36 @@
X     guest = 0;
X }
X 
+int 
+#ifdef __STDC__
+is_bogus_passwd(char *hispass)
+#else
+is_bogus_passwd(hispass)
+char *hispass
+#endif
+{
+    static char line[1000];
+    FILE *fp;
+    char *checker = NULL;
+    struct aclmember *entry = NULL;
+
+    if (getaclentry("bogus-filter", &entry)) {
+	checker = ARG0;
+    } 
+    if (!(checker && *checker)) {
+	checker = _PATH_PWDCHK;
+    } 
+
+    sprintf(line, "%s %s", checker, hispass);
+
+    if (fp = ftpd_popen(line, "r", 1)) {
+	int st = ftpd_pclose(fp);
+	return st;
+    } else {
+	return 1;
+    } 
+} 
+
X int
X #ifdef __STDC__
X validate_eaddr(char *eaddr)
@@ -1287,8 +1317,10 @@
X             host = 0;
X             break;
X         case '@':
-            if (!host || state > 1 || !strncasecmp("ftp", eaddr + i - host, host))
+            if (!host || state > 1 || !strncasecmp("ftp", eaddr + i - host, host)) {
X                 return 0;
+	    }
+
X             state = 2;
X             host = 0;
X             break;
@@ -1425,7 +1457,9 @@
X         if (getaclentry("passwd-check", &entry) &&
X             ARG0 && strcasecmp(ARG0, "none")) {
X 
-            if (!strcasecmp(ARG0, "rfc822"))
+            if (!strcasecmp(ARG0, "bogus")) 
+		valid = !is_bogus_passwd(passwd);
+            else if (!strcasecmp(ARG0, "rfc822"))
X                 valid = validate_eaddr(passwd);
X             else if (!strcasecmp(ARG0, "trivial"))
X                 valid = (strchr(passwd, '@') == NULL) ? 0 : 1;
@@ -1440,6 +1474,7 @@
X                        authenticated ? authuser : "joe");
X                 lreply(530, "[%s will be added if password ends with @]",
X                        remotehost);
+		if (getaclentry("passwd-failure", &entry) && ARG0) pr_mesg(530, ARG0);
X                 reply(530, "Login incorrect.");
X 		acl_remove();	
X                 if (++login_attempts >= lgi_failure_threshold) {
Only in src: ftpd.c~
Only in src: ftpd.o
Only in src: ftpshut
Only in src: glob.o
Only in src: hostacc.o
Only in src: logwtmp.o
Only in src: makefiles
Only in src: newvers.sh
diff -ru ORIG/pathnames.h src/pathnames.h
--- ORIG/pathnames.h	Fri Feb  7 09:18:09 1997
+++ src/pathnames.h	Fri Feb  7 10:12:35 1997
@@ -36,17 +36,20 @@
X #ifdef USE_ETC
X #define _PATH_FTPUSERS  "/etc/ftpusers"
X #define _PATH_FTPACCESS "/etc/ftpaccess"
+#define _PATH_PWDCHK    "/etc/ftpdckr"
X #define _PATH_CVT       "/etc/ftpconversions"
X #define _PATH_PRIVATE   "/etc/ftpgroups"
X #else
X #ifdef USE_ETC_FTPD
X #define _PATH_FTPUSERS  "/etc/ftpd/ftpusers"
X #define _PATH_FTPACCESS "/etc/ftpd/ftpaccess"
+#define _PATH_PWDCHK    "/etc/ftpd/ftpdckr"
X #define _PATH_CVT       "/etc/ftpd/ftpconversions"
X #define _PATH_PRIVATE   "/etc/ftpd/ftpgroups"
X #else
X #define _PATH_FTPUSERS  "/usr/local/lib/ftpd/ftpusers"
X #define _PATH_FTPACCESS "/usr/local/lib/ftpd/ftpaccess"
+#define _PATH_PWDCHK    "/usr/local/lib/ftpd/ftpdckr"
X #define _PATH_CVT       "/usr/local/lib/ftpd/ftpconversions"
X #define _PATH_PRIVATE   "/usr/local/lib/ftpd/ftpgroups"
X #endif
Only in src: popen.o
Only in src: private.o
Only in src: realpath.o
Only in src: sigfix.o
diff -ru ORIG/vers.c src/vers.c
--- ORIG/vers.c	Fri Feb  7 09:18:09 1997
+++ src/vers.c	Fri Feb  7 11:07:52 1997
@@ -1 +1 @@
-char version[] = "Version wu-2.4.2-academ[BETA-12](1) Fri Feb 7 09:12:41 MST 1997";
+char version[] = "Version wu-2.4.2-academ[BETA-12](19) Proxy and Browser-proofed Fri Feb 7 11:07:52 MST 1997";
Only in src: vers.o
SHAR_EOF
  $shar_touch -am 0214100297 'wu-ftpd-b12-browser-patch/wu-ftpd-b12.patch' &&
  chmod 0644 'wu-ftpd-b12-browser-patch/wu-ftpd-b12.patch' ||
  $echo 'restore of' 'wu-ftpd-b12-browser-patch/wu-ftpd-b12.patch' 'failed'
  shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'wu-ftpd-b12-browser-patch/wu-ftpd-b12.patch'`"
  test 4599 -eq "$shar_count" ||
  $echo 'wu-ftpd-b12-browser-patch/wu-ftpd-b12.patch:' 'original size' '4599,' 'current size' "$shar_count!"
fi
rm -fr _sh06204
exit 0