home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / tcl / 2444 < prev    next >
Encoding:
Text File  |  1993-01-22  |  2.6 KB  |  54 lines

  1. Newsgroups: comp.lang.tcl
  2. Path: sparky!uunet!pmafire!mica.inel.gov!ux1!simmdan
  3. From: simmdan@ux1.isu.edu (Daniel Simmons)
  4. Subject: Re: How difficult is a restricted tcl shell ?
  5. Message-ID: <C198w7.6Jv@ux1.isu.edu>
  6. Keywords: shell user supervisor interpreter
  7. Organization: Idaho State University, Pocatello
  8. References: <brucet.727682251@extro.ucc.su.OZ.AU>
  9. Date: Fri, 22 Jan 1993 12:19:19 GMT
  10. Lines: 42
  11.  
  12. In article <brucet.727682251@extro.ucc.su.OZ.AU> brucet@extro.ucc.su.OZ.AU (Bruce Tulloch) writes:
  13. >Is something along the lines of a restricted tcl shell or "user" and
  14. >"supervisor" mode easily implemented ? For example, in supervisor mode,
  15. >all commands, procedures and variables are visible and usable (just
  16. >like tcl is now). In user mode, only a restricted set of commands,
  17. >procedures and variables are available and usable from the shell, and
  18. >certain procedures are protected from view (as described below
  19. >perhaps). "Supervisor" commands and procedures would still be available
  20. >if called from within a procedure and user/super mode could be changed
  21. >via a new built-in command (that accepts a password maybe) so that more
  22. >experienced users or developers could have full access.
  23. >
  24. >Anyone else done/though/dream't about an idea like this ?
  25.  
  26. Well, I'm just at the thought/dream't state at the moment, but...
  27.  
  28. As a part of a Campus Wide Information System for Idaho State University,
  29. I've been implementing a menu system based on Tcl.  Menu definitions are
  30. all in Tcl, and the users actually get a Tcl interpreter to type menu
  31. choices into (they just don't know it).  That is, the user is presented
  32. with a menu of numbered options and a command prompt.  When they type
  33. number "5" for instance, they are actually calling a Tcl procedure named
  34. "5" which carries out the action named on the menu.
  35.  
  36. Anyway, at the moment, they have full access to the interpreter, but it
  37. is my plan to eventually have two interpreters.  One is for the users
  38. and will have most everything disabled (ie. no exec or any other way to
  39. get to a subshell, etc.).  It will also have at least one command added
  40. from C which will be used for choosing menu items.  In this case, when
  41. they type "1", it will actually call a C procedure which will pass the
  42. command "go 1" into a separate interpreter.  The second interpreter 
  43. will have the full set of Tcl commands plus the application specific
  44. commands.
  45.  
  46. Does this kind of describe what you're thinking about?  Anyone else
  47. have thoughts/comments?
  48.  
  49. Danny
  50. -- 
  51. Daniel Simmons          electronic mail : simmdan@isu.edu
  52. Idaho State University       voice mail : (208) 236-3199
  53. Computer Center              snail mail : Box 8037, Pocatello
  54.