Project

General

Profile

Actions

Bug #16979

closed

0177 umask causes Rails cache dirs to be created without +x

Added by Robert Mattson about 8 years ago. Updated over 7 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
Rails
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

All,

We receive the following error when installing foreman into our CentOS 7.2 instance [3].

We are required to run httpd with a umask [1], per STIG V-2259.
This results in a systemd service with the following2, as a result, files in /usr/share/foreman/tmp/ are created with insufficient privileges.

The sub-process accessing these files is not running as foreman;
I suggest;
- The cache-file management algorithm create files with the explicit permissions to be later accessed.
- The sub-process accessing these files run in the correct context (U/G/O).

I understand this issue is somewhat created by the umask and understand this bug may be rejected.

Sincerely,
RM

[1]
cat /usr/lib/systemd/system/httpd.service
<snip />
[Service]
<snip />
UMask=0177

[2]
[06:07:00 root@hostname dir]# ll /usr/share/foreman/tmp/cache/
total 0
drw-------. 2 foreman foreman 40 Oct 11 05:48 69D
drw-------. 2 foreman foreman 40 Oct 11 05:48 794
drwx------. 3 foreman foreman 60 Oct 11 05:30 7D5

[3]
Permission denied @ dir_s_mkdir - /usr/share/foreman/tmp/cache/794/F40 (Errno::EACCES)
/opt/rh/rh-ruby22/root/usr/share/ruby/fileutils.rb:252:in `mkdir'
/opt/rh/rh-ruby22/root/usr/share/ruby/fileutils.rb:252:in `fu_mkdir'
/opt/rh/rh-ruby22/root/usr/share/ruby/fileutils.rb:226:in `block (2 levels) in mkdir_p'
/opt/rh/rh-ruby22/root/usr/share/ruby/fileutils.rb:224:in `reverse_each'
/opt/rh/rh-ruby22/root/usr/share/ruby/fileutils.rb:224:in `block in mkdir_p'
/opt/rh/rh-ruby22/root/usr/share/ruby/fileutils.rb:210:in `each'
/opt/rh/rh-ruby22/root/usr/share/ruby/fileutils.rb:210:in `mkdir_p'
<snip />

Actions #1

Updated by Dominic Cleal about 8 years ago

  • Subject changed from httpd(apache) with umask results in foreman failure to 0177 umask causes Rails cache dirs to be created without +x
  • Category set to Rails

This should be filed as a bug against Rails, it isn't part of Foreman. It would probably require a chmod after the mkdir call to reset permissions, which is particularly tricky with use of FileUtils.makedirs (recursive).

Actions #2

Updated by Anonymous over 7 years ago

Did anything happen regarding this in the rails world?

Actions #3

Updated by Anonymous over 7 years ago

  • Status changed from New to Rejected

No reaction, closing. I'd also label this as a pure upstream (Rails) problem.

Actions

Also available in: Atom PDF