🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.4bsd
Article #1229

Re: sort creates readable files in /usr/tmp

#1229
From: Henry Spencer
Date: Wed, 09 Nov 1988 19:59
12 lines
970 bytes
In article <7739@megaron.arizona.edu> wendt@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@zoo.toronto.edu
Technical Details
Message-ID: <1988Nov9.195957.5778@utzoo.uucp>
Path: arc1-ca.pugleaf.net!utzoo!henry
References: <7739@megaron.arizona.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.bugs.4bsd,news.sysadmin
Path: arc1-ca.pugleaf.net!utzoo!henry
From: henry@utzoo.uucp (Henry Spencer)
Subject: Re: sort creates readable files in /usr/tmp
Message-ID: <1988Nov9.195957.5778@utzoo.uucp>
Organization: U of Toronto Zoology
References: <7739@megaron.arizona.edu>
Date: Wed, 9 Nov 88 19:59:57 GMT