home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / admin / 4848 < prev    next >
Encoding:
Internet Message Format  |  1992-09-02  |  1.7 KB

  1. Xref: sparky comp.unix.admin:4848 comp.unix.questions:10659 comp.unix.shell:3784
  2. Newsgroups: comp.unix.admin,comp.unix.questions,comp.unix.shell
  3. Path: sparky!uunet!ftpbox!mothost!merlin.dev.cdx.mot.com!merlin.dev.cdx.mot.com!lezz
  4. From: lezz@merlin.dev.cdx.mot.com (Lezz Giles)
  5. Subject: Re: How to prevent a large core-dump
  6. Message-ID: <1992Sep2.175259.15393@merlin.dev.cdx.mot.com>
  7. Sender: news@merlin.dev.cdx.mot.com (USENET News System)
  8. Nntp-Posting-Host: fenric.dev.cdx.mot.com
  9. Reply-To: lezz@merlin.dev.cdx.mot.com (Lezz Giles)
  10. Organization: Motorola Codex, Canton, MA
  11. References: <1992Aug25.173056.13401@utwente.nl>  <1992Sep2.94728.26099@ms.uky.edu>
  12. Distribution: na
  13. Date: Wed, 2 Sep 1992 17:52:59 GMT
  14. Lines: 26
  15.  
  16. In article <1992Sep2.94728.26099@ms.uky.edu>, kherron@ms.uky.edu (Kenneth Herron) writes:
  17. |>msb@sq.sq.com (Mark Brader) writes:
  18. |>
  19. |>>>     echo > core
  20. |>>>     chmod 0 core
  21. |>>> Then the program will not produce a core, since the file "core" already
  22. |>>> exists, but is unwritable (see signal(2)).
  23. |>
  24. |>>Fine for most purposes, probably including the original query, but wait
  25. |>>until the day that it's a setuid-root program whose core dumps you want
  26. |>>to prevent!
  27. |>>    mkdir core
  28.  
  29. I can't believe that nobody else has mentioned another solution yet....
  30.  
  31. ln -s /dev/null core
  32.  
  33. This won't work on all unixes since not everybody has symbolic links,
  34. but it has the advantage that it works for setuid-root programs and it
  35. will be reasonably obvious in the future to a unix-literate person
  36. why the 'core' file was created.
  37.  
  38. BTW, I can't take credit for this solution - it is simply what we have
  39. at our site and was thought up by some genius in the support dept.
  40.  
  41. lezz "The new infinite write-only memory device - /dev/null" Giles
  42.