sort creates readable files in /usr/tmp

Henry Spencer henry at utzoo.uucp
Thu Nov 10 05:59:57 AEST 1988


In article <7739 at megaron.arizona.edu> wendt at arizona.edu (Alan Lee Wendt) writes:
>Apropos of security, Berkeley sort creates readable temp files
>in /usr/tmp, due to non-intuitive behavior in fopen, which
>when it creates new files always does it with 0666 permissions.
>The fix is to do the creat manually in the newfile() routine
>before calling fopen...

A cleaner and possibly somewhat more portable fix is to change umask
for the fopen call, saving and restoring it if necessary.
-- 
The Earth is our mother.        |    Henry Spencer at U of Toronto Zoology
Our nine months are up.         |uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.bugs.4bsd.ucb-fixes mailing list