Bug 16942

Summary: send-pr(1) creates unsafe temp files
Product: Base System Reporter: Colin Phipps <crp22>
Component: gnuAssignee: Sheldon Hearn <sheldonh>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.0-CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Colin Phipps 2000-02-23 20:30:01 UTC
send-pr(1) creates a number of temporary files, in /tmp by default, for 
holding the bug report while it's parsed and edited, and various other 
tasks. These temporary files are opened unsafely with predictable filenames, 
making send-pr vulnerable to a symlink attack.

Fix: Use mktemp(1):
How-To-Repeat: 
See description.
Comment 1 Sheldon Hearn freebsd_committer freebsd_triage 2000-03-04 10:10:57 UTC
State Changed
From-To: open->feedback

The patch on PR 17175 looks a little cleaner.  How does it look to 
you? 
Comment 2 Sheldon Hearn freebsd_committer freebsd_triage 2000-03-15 12:20:06 UTC
State Changed
From-To: feedback->analyzed

The originator has pointed out several advantages which this patch 
has over the one in PR 17175. 


Comment 3 Sheldon Hearn freebsd_committer freebsd_triage 2000-03-15 12:20:06 UTC
Responsible Changed
From-To: freebsd-bugs->sheldonh

I'll take this one, since the file is off the vendor branch already. 

Comment 4 Sheldon Hearn 2000-03-31 15:32:30 UTC
Hi Colin,

Okay, I reckon this one needs to go in. :-)

My only question regarding your patch is that you've changed the prefix
for temporary files from p to pt.  The manual page says:

       /tmp/p$$     copy of PR used in editing session
       /tmp/pf$$    copy of empty PR form, for testing purposes
       /tmp/pbad$$  file for rejected PRs

Is there any reason we can't stick with that convention?

Ciao,
Sheldon.
Comment 5 Sheldon Hearn freebsd_committer freebsd_triage 2000-04-03 10:50:03 UTC
State Changed
From-To: analyzed->open

This PR should have been in the ``open'' state. 
Comment 6 Sheldon Hearn freebsd_committer freebsd_triage 2000-04-03 10:51:30 UTC
State Changed
From-To: open->analyzed

Committed as rev 1.14, left in this state as an MFC reminder. 
Thanks! 
Comment 7 Sheldon Hearn freebsd_committer freebsd_triage 2000-08-08 13:19:26 UTC
State Changed
From-To: analyzed->closed

Merged onto RELENG_4 as rev 1.13.2.2 on 2000-08-08.