home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / admin / 4621 < prev    next >
Encoding:
Text File  |  1992-08-20  |  1.6 KB  |  32 lines

  1. Newsgroups: comp.unix.admin
  2. Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!ux1.cso.uiuc.edu!news.iastate.edu!test.cc.iastate.edu!michaelv
  3. From: michaelv@iastate.edu (Michael L. VanLoon)
  4. Subject: Re: Prevent user from editing /etc/passwd
  5. Message-ID: <michaelv.714339575@test.cc.iastate.edu>
  6. Sender: news@news.iastate.edu (USENET News System)
  7. Organization: Iowa State University, Ames IA
  8. References: <1992Aug17.131329.22491@cpp.ob.open.de>
  9. Date: Thu, 20 Aug 1992 19:39:35 GMT
  10. Lines: 20
  11.  
  12. In <1992Aug17.131329.22491@cpp.ob.open.de> schweik@cpp.ob.open.de (Martin Schweikert) writes:
  13.  
  14. >Because I know he uses vi, I tried to replace /usr/bin/vi by a shell
  15. >script that tests if one of its parameters is *passwd. If so,
  16. >it would write a message to my terminal, send me mail, and make a copy
  17. >of /etc/passwd before it would invoke the original vi. Exactly here is
  18. >the problem: vi (I don't know much about it :-) seems to check under
  19. >what name it was invoked. And in my replacement script I invoked it
  20. >with "vi.orig". So vi finds out it wasn't invoked as vi, vedit, ... and
  21. >it seems that ex gets executed (I know perfectly nothing about ex).
  22.  
  23. Simply move the real vi to a different directory, then put
  24. /usr/hidden.dir/vi in your shell script when it comes time to invoke
  25. the editor.
  26.  
  27. -- 
  28. ------------------------------------------------------------------------------
  29.   Michael L. VanLoon                           Project Vincent Systems Staff
  30.   michaelv@iastate.edu              Iowa State University Computation Center
  31. ------------------------------------------------------------------------------
  32.