Does 4.1BSD have a restricted shell? - (nf)
guy at rlgvax.UUCP
guy at rlgvax.UUCP
Sat Jul 2 12:07:53 AEST 1983
The System III manual lists "rsh" as restricting:
the cd command
setting $PATH
commands with names containing /
> and >>
Also, while the .profile is running, those restrictions are not enforced,
but any attempt to interrupt out of the .profile causes an immediate exit
(why not just disable interrupts?).
>From poking over the V7 shell (and discovering that "rsh" and the builtin
"test" command were there - or most of them, anyway), I found that
the only member of the above list not enforced by the V7 "rsh" is the
setting of $PATH; I believe the theory was that the .profile would say
"readonly PATH". Is there a reason why the USG "rsh" hardwires in this
restriction?
Note that USG UNIX provides the same SHELL environment variable as 4.1BSD
does; the USG "ed" uses this to decide if it's a "restricted ed" or not.
"Restricted ed" prohibits any execution of UNIX commands, or any reference
to files with a / in their name. The editor is restricted if the SHELL
environment variable exactly equals "/bin/rsh" or if the editor was invoked
as "red".
Guy Harris
{seismo,mcnc,we13,brl-bmd,allegra}!rlgvax!guy
More information about the Comp.unix.wizards
mailing list