[comp.unix.questions] Command line vs. call from a program

wmark@wb3ffv.ampr.org (Mark Winsor) (09/29/90)

I have a need to be able to tell if a program has been invoked from the
command line or called through a specific program. I have a menu system
that requires that I have root permissions for some admin utilities. I'd
like to have a setuid program that execs shell scripts but only want it
to execute if it is called by my menu system. Any good ideas as to how to
accomplish this? I tried setting the process group idea but this closes
/dev/tty which is not acceptable. Any ideas would be appreciated.

Mark S. Winsor
Systems Analyst
ProVAR, Inc.

rickert@mp.cs.niu.edu (Neil Rickert) (09/29/90)

In article <3707@wb3ffv.ampr.org> wmark@wb3ffv.ampr.org (Mark Winsor) writes:
>I have a need to be able to tell if a program has been invoked from the
>command line or called through a specific program. I have a menu system
>that requires that I have root permissions for some admin utilities. I'd
>like to have a setuid program that execs shell scripts but only want it
>to execute if it is called by my menu system. Any good ideas as to how to
>accomplish this? I tried setting the process group idea but this closes
>/dev/tty which is not acceptable. Any ideas would be appreciated.

 The easiest method would be: chmod o-x "your setuid program" 
so that the setuid program can only be called my members of a restricted
group.  Then make the menu system sgid to that group.

 This isn't quite what you asked, but would seem to have the equivalent
effect.
-- 
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
  Neil W. Rickert, Computer Science               <rickert@cs.niu.edu>
  Northern Illinois Univ.
  DeKalb, IL 60115.                                  +1-815-753-6940