home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / question / 9419 < prev    next >
Encoding:
Internet Message Format  |  1992-07-25  |  1.6 KB

  1. Xref: sparky comp.unix.questions:9419 comp.unix.programmer:3908 comp.unix.wizards:3303
  2. Newsgroups: comp.unix.questions,comp.unix.programmer,comp.unix.wizards
  3. Path: sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!eff!ibmpcug!kate.ibmpcug.co.uk!dylan
  4. From: dylan@ibmpcug.co.uk (Matthew Farwell)
  5. Subject: Re: Making ``.plan'' EXECUTE a Program ???
  6. Organization: The IBM PC User Group, UK.
  7. Date: Sat, 25 Jul 1992 10:14:02 GMT
  8. Message-ID: <1992Jul25.101402.13142@ibmpcug.co.uk>
  9. References: <1992Jul24.131605.8213@news.eng.convex.com> <1992Jul24.182737.22945@aston.ac.uk>
  10. Lines: 33
  11.  
  12. In article <1992Jul24.182737.22945@aston.ac.uk> evansmp@uhura.aston.ac.uk (Mark Evans) writes:
  13. >tchrist@convex.COM (Tom Christiansen) writes:
  14. >: Seem to me that doing this in fingerd:
  15. >: 
  16. >:     if (fork) return;
  17. >:     setuid(-2);
  18. >:     (do file reading
  19. >:     exit(0);
  20. >No this is braindead.
  21. >Why?
  22. >this means that user id -2 must have read access to the file.
  23. >this means that the users dir must be searchable by anyone.
  24.  
  25. It has to anyway.  You mean you don't want other people on your machine
  26. to be able to finger you?
  27.  
  28. >You might just as well run fingerd as uid -2 anyway.
  29.  
  30. Agreed.
  31.  
  32. >The point is that fingerd (running as root) should be able to read
  33. >.plan, it should however check that it is not a link to a file
  34. >the user shouldn't be reading.
  35. >Also fork is an expensive operation, a stat(2) call is much simpler.
  36.  
  37. Theres a race condition if you use stat(2).  Try fstat(2) instead.
  38. Anyway, fingerd has to fork (or at least exec), so its not any more
  39. expensive.
  40.  
  41. Dylan.
  42. -- 
  43. It is no coincidence that in no known language does the phrase 'As
  44. pretty as an Airport' appear -- Douglas Adams
  45.