🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.4bsd
Article #200

ftpd doesn't believe passwd(5)

#200
From: Mark Bartelt
Date: Mon, 12 Nov 1990 20:03
43 lines
1598 bytes
This is one of those "I find it hard to believe nobody has reported this
before" bugs, but nonetheless ...  In vanilla 4.3bsd on a VAX:

ftpd(8) sez ...

   _F_t_p_d authenticates users according to three rules.
    [ ... ]
   3)   The user must have a standard shell returned by getusershell(3).

passwd(5) sez ...

   [ ... ] if the Shell field is null, then /_b_i_n/_s_h is used.

But ftpd nonetheless refuses to authorize a user whose shell field in
/etc/passwd is null; it won't let a Bourne shell user in unless /bin/sh
is explicitly specified in /etc/passwd.  One of several ways to fix the
problem in ftpd.c/checkuser():

Replace
	while ((cp = getusershell()) != NULL)
		if (strcmp(cp, pw->pw_shell) == 0)
			break;
	endpwent();
	endusershell();
	if (cp == NULL)
		return (0);

with
	if ( !*(pw->pw_shell) )
		endpwent();
	else {
		while ((cp = getusershell()) != NULL)
			if (strcmp(cp, pw->pw_shell) == 0)
				break;
		endpwent();
		endusershell();
		if (cp == NULL)
			return (0);
	}

Mark Bartelt                          INTERNET: mark@sickkids.toronto.edu
Hospital for Sick Children, Toronto             mark@sickkids.utoronto.ca
416/598-6442                          UUCP: {utzoo,decvax}!sickkids!mark
Technical Details
Message-ID: <423@sickkids.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!sickkids!mark

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!sickkids!mark
From: mark@sickkids.UUCP (Mark Bartelt)
Newsgroups: comp.bugs.4bsd
Subject: ftpd doesn't believe passwd(5)
Message-ID: <423@sickkids.UUCP>
Date: 12 Nov 90 20:03:41 GMT
Reply-To: mark@sickkids.UUCP (Mark Bartelt)
Organization: Hospital for Sick Children, Toronto
Lines: 43