Subject: Re: We Resrict users to /usr/local/rbin - How can 'spell' work?

From: [email-masked] (R. Stewart Ellis)
Date: 1 Jun 95 13:18:24 GMT

[email-masked] (David L Miller) writes:

 >On 25 May 1995, Andrew P. Dinsdale wrote:

 >>
 >> Hi
 >>
 >> We have a restricted, not chroot I *must* add, environment where users
 >> can only execute programs in /usr/local/rbin.  This includes Pine, Lynx
 >> their menus, cp, rm etc etc.  Users execute Pine from a menu - so typing
 >> a number spawns /usr/local/rbin/pine.  Everything works like a charm
 >> except for spell (^T).  We have tried moving /usr/bin/spell into
 >> /usr/local/rbin (as well as all the programs used by spell) but still
 >> no cigar.  When ^T is invoked Pine simply echoes back "Done Checking
 >> Spelling" with no corrections made.  When I run Pine in a command tool I
 >> see "sh: /usr/bin/spell: restricted" - this does not surprise me as we
 >> are not giving users access to /usr/bin!!!!
 >>
 >> Now, what I need is some good advice on how to make Pine look for 'spell'
 >> in the users path NOT by looking for /usr/bin/spell.  Has anyone hacked
 >> the source successfully (we tried that too) ?? Or can any Pine developers
 >> who read this group explain where I would change the code.
 >>

 >Before your menu calls Pine, have it set the SPELL environment variable to
 >/usr/local/rbin/spell.

I have been working with Andrew on this problem.  I posted several weeks
ago, but the only person who answered didn't have a clue as to how the
restricted environment works.

First, rsh will refuse to exec anything with path info in it.  It rather
primitively checks for /'s and exits with an error message.  This is part of
the protection mechanism of rsh that keeps the restricted user from
accessing things you do not want her to.

When I inspected the src code, I found that pine calls spell with system().
Even when 'SPELL=spell; export SPELL' was added to the ruser profile, the
system() call seems to try to add path info, which causes rsh to refuse to
exec it.

If Andrew or I figure this out we will post.  I am hoping I do not have to
reimplement the portion of the code that now uses system().

 >|\ |  |\/|  David L. Miller    [email-masked]  (206) 685-6240
 >|/ |_ |  |  Software Engineer, Pine Development Team   (206) 685-4045 (FAX)
 >University of Washington, Networks & Distributed Computing, JE-20
 >4545 15th Ave NE, Seattle WA 98105, USA

-- 
  R.Stewart(Stew) Ellis, Assoc.Prof., (Off)810-762-9765   ___________________
  Humanities & Social Science,  GMI Eng.& Mgmt. Inst.    /   _____  ______ 
  Flint, MI 48504      [email-masked]               /        / /  /  / /
  Web admin:  chimera,nn,tin,jove,kermit - free's best!/________/ /  /  / /

---

From: [email-masked] (Andrew P. Dinsdale)
Date: 25 May 1995 20:54:01 GMT

Hi

Please help.

Andrew Dinsdale
--

---

From: Jean Pierre LeJacq <[email-masked]>
Date: Fri, 9 Jun 1995 13:51:56 -0400 (EDT)

> the source successfully (we tried that too) ?? Or can any Pine developers

I built pine-3.91 from the source on a Linux box.  One of changes I
made to the source was to use ispell instead of spell.  All that
need to be changed was the file pico/os_unix.h.  Specifically, on
line 137 I changed the macro SPELLER to:

  #define SPELLER "/usr/bin/ispell -u"

You should be set this to whatever directory you like.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Jean Pierre LeJacq                                       Quoin, Inc

Suite 200 North                  local voice:       +1.203.295.0874
124 Mount Auburn Street                voice:       +1.617.576.5885
Cambridge, MA 02138-5700                 fax:       +1.617.576.5876
U.S.A.                              internet: [email-masked]