Short summary of the problem

Norm Seethoff norm at fluke.UUCP
Sat Oct 26 00:43:11 AEST 1985


Index:	etc/rshd.c 4.2BSD [+FIX]

Description:
	rshd does not establish the same umask as login.  Files created
	via commands executed by rshd on behalf of a remote client have
	world write permission.

Repeat-By:
	execute:
		rsh remotesystem umask
	and find that the result is consistently returned as 0.
	or:
		rsh remotesystem touch /tmp/foo
	and find that the mode of /tmp/foo is -rw-rw-rw-

Fix:
	Add a umask call to rshd in the vicinity of line 270 as
	in the following code fragment:

		environ = envinit;
		strncat(homedir, pwd->pw_dir, sizeof(homedir)-6);
		strncat(shell, pwd->pw_shell, sizeof(shell)-7);
		strncat(username, pwd->pw_name, sizeof(username)-6);
		umask(022);     /* set same default umask as in login */


Norm Seethoff
John Fluke Mfg. Co., Inc.
{decvax!microso | uw-beaver | allegra | lbl-csam}!fluke!norm



More information about the Comp.bugs.4bsd.ucb-fixes mailing list