Bug 37293 - vi broken by overly restrictive umask
Summary: vi broken by overly restrictive umask
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: vim   
(Show other bugs)
Version: 7.1
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2001-04-24 04:12 UTC by Valdis Kletnieks
Modified: 2007-04-18 16:32 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-01-24 22:56:33 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Valdis Kletnieks 2001-04-24 04:12:57 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.4.2 i686)

vi creates temporary directories in /tmp, and blindly uses the 'umask'
value without
sanity-checking the value, resulting in directories it can't use.

Reproducible: Always
Steps to Reproduce:
1. umask 177
2. vi /some/file   that has multiple paragraphs in it.
3. Use '!}fmt' to format a paragraph.

Actual Results:  "/tmp/v91406/0" Can't open file for writing
Can't create file /tmp/v91406/0
Hit ENTER or type command to continue

Expected Results:  A formatted paragraph....

I found this while using nmh.  The 'repl' command finds that the default
for MH files is 600, so it does a umask(0177) (which is reasonable enough,
as that's what you need to force a mode 600 file) and then launches the
editor (vi by default).

But look at the permissions vi assigns to its temporary directory:

[~/Mail/inbox]1 ls -lgd /tmp/v91406
drw-------    2 valdis   valdis         48 Apr 24 00:03 /tmp/v91406

If you manually 'chmod 700' that directory from another window,  !}fmt 
starts working just fine.   I suspect a missing 'fchmod(fd,0700)'  right
after the  mkdir() call....

Comment 1 Karsten Hopp 2002-06-25 19:57:40 UTC
I've just tested this with vim-6.1-5, the bug is not reproducable anymore.

Note You need to log in before you can comment on or make changes to this bug.