Bug 86097 - Fopen hardcodes 0666 as mode
Fopen hardcodes 0666 as mode
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
Mike McLean
: Security
Depends On:
  Show dependency treegraph
Reported: 2003-03-13 16:34 EST by William Au
Modified: 2007-04-18 12:52 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-03-14 15:44:04 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description William Au 2003-03-13 16:34:33 EST
Description of problem: 

Fopen hardcodes 0666 as mode.  So during an rpm install, the files created
will have a mode of 666 and thus can be overwritten by anyone on the system
until chmod() is called.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
Actual results:

Expected results:

Additional info:
Comment 1 Jeff Johnson 2003-03-14 15:44:04 EST
No, files are created 0666 iff umask is 000, and that's
a configuration choice and/or problem.

Fopen calls open(2), and the mode passed to the system call
is adjusted by the current umask, typically 022, resulting
in mode 0644 for newly created files.

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