home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / emacs / 2833 < prev    next >
Encoding:
Text File  |  1992-08-12  |  2.2 KB  |  52 lines

  1. Newsgroups: comp.emacs
  2. Path: sparky!uunet!nic.unh.edu!newshost.unh.edu!rg
  3. From: rg@msel.unh.edu (Roger Gonzalez)
  4. Subject: Re: Question: How to use Emacs to access root-owned files
  5. In-Reply-To: bob@MorningStar.Com's message of Wed, 12 Aug 1992 16:01:49 GMT
  6. Message-ID: <RG.92Aug12201702@nymph.msel.unh.edu>
  7. Sender: news@newshost.unh.edu (USENET News System)
  8. Organization: UNH Marine Systems Engineering Lab
  9. References: <BETSYS.92Aug10171110@ra.cs.umb.edu>
  10.     <BOB.92Aug12120143@volitans.MorningStar.Com>
  11. Distribution: comp
  12. Date: Thu, 13 Aug 1992 01:17:02 GMT
  13. Lines: 37
  14.  
  15. >>>>> "Bob" == Bob Sutterfield <bob@MorningStar.Com> writes:
  16. Bob> Nntp-Posting-Host: volitans.morningstar.com
  17.  
  18. Bob> In article <BETSYS.92Aug10171110@ra.cs.umb.edu> betsys@cs.umb.edu (Elizabeth Schwartz) writes:
  19.  
  20. Elizabeth> I need a bit of code that prompts me for the root passwd and then
  21. Elizabeth> lets me read and write as root. (obviously, it mustn't know the
  22. Elizabeth> passwd!)
  23.  
  24. Bob> Get .. [ange-ftp]
  25.  
  26. Bob> I say ^X^F/user@hostname:/path/to/file, and ange-ftp prompts me for
  27. Bob> that user's password on that host.  If "user" is "root", you'll be
  28. Bob> editing a file as root on that host.  If "hostname" is "localhost",
  29. Bob> you'll have an Emacs buffer that's root on the same machine as the
  30. Bob> Emacs is running on.  When you ^X^S (or whatever), ange-ftp does
  31. Bob> whatever's necessary to write the file back appropriately via FTP.
  32.  
  33. KLUDGE! KLUDGE! KLUDGE! KLUDGE! KLUDGE! KLUDGE! KLUDGE! KLUDGE! KLUDGE!
  34. KLUDGE! KLUDGE! KLUDGE! KLUDGE! KLUDGE! KLUDGE! KLUDGE! KLUDGE! KLUDGE!
  35. KLUDGE! KLUDGE! KLUDGE! KLUDGE! KLUDGE! KLUDGE! KLUDGE! KLUDGE! KLUDGE!
  36. KLUDGE! KLUDGE! KLUDGE! KLUDGE! KLUDGE! KLUDGE! KLUDGE! KLUDGE! KLUDGE!
  37.  
  38. Its much less kludgey if you just add a built-in command to Emacs called
  39. "su-command", that prompts for a password, and does a setuid.  Of course, this
  40. requires that you make Emacs suid root, which is probably a Bad Thing.
  41.  
  42. -Roger
  43. --
  44. "The question of whether a computer can think is no more interesting
  45.  than the question of whether a submarine can swim" - Edsger W. Dijkstra 
  46.  
  47. Roger Gonzalez   -  rg@msel.unh.edu
  48. Division of Bit Banging and Reluctant Robotics
  49. UNH Marine Systems Engineering Laboratory, Durham, NH  03824-3525
  50. (603) 862-4600 -4399 (fax)
  51.  
  52.