Bug 995097

Summary: oddjob-mkhomedir creates directories with bad permissions by default
Product: [Fedora] Fedora Reporter: Stef Walter <stefw>
Component: oddjobAssignee: Nalin Dahyabhai <nalin>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 19CC: nalin, sgallagh, winckler
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: oddjob-0.33-1.fc21 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-18 11:13:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Stef Walter 2013-08-08 14:24:23 UTC
oddjob-mkhomedir creates directories with bad permissions by default. The created home directories are readable by group and world. 

For example:

$ ls -l /home
total 4
drwx------. 3 stef stef 4096 28. Mär 20:41 stef

$ grep -R oddjob /etc/pam.d/system-auth
session     optional      pam_oddjob_mkhomedir.so

$ ssh -l Bender-admin.qe localhost
Bender-admin.q@localhost's password: 
Creating home directory for Bender-admin.qe.
-sh-4.2$ pwd
/home/bender-admin
-sh-4.2$ ls -l /home
total 8
drwxr-xr-x. 3 bender-admin domain users 4096  8. Aug 16:19 bender-admin
drwx------. 3 stef         stef         4096 28. Mär 20:41 stef


Original issue reported here: http://lists.freedesktop.org/archives/authentication/2013-July/000278.html

Comment 1 Stef Walter 2013-08-08 14:34:47 UTC
<fweimer> Ideally, it should read /etc/login.defs and use the UMASK value found there to determine the permission.

Comment 2 Nalin Dahyabhai 2013-08-08 14:37:40 UTC
(In reply to Stef Walter from comment #1)
> <fweimer> Ideally, it should read /etc/login.defs and use the UMASK value
> found there to determine the permission.

Is there a umask specified as an option in your /etc/oddjobd.conf.d/oddjobd-mkhomedir.conf's invocation of the mkhomedir helper?  If there isn't one, it'll do that.

Comment 3 Stef Walter 2013-08-08 15:02:05 UTC
Indeed there is. It looks like the default is broken.

$ rpm -V oddjob-mkhomedir
$ cat /etc/oddjobd.conf.d/oddjobd-mkhomedir.conf | grep mkhomedir
     provides access to mkhomedir functionality via a service named
     "com.redhat.oddjob_mkhomedir", which exposes a single object
     "com.redhat.oddjob_mkhomedir", which provides two methods.  -->
  <service name="com.redhat.oddjob_mkhomedir">
      <interface name="com.redhat.oddjob_mkhomedir">
          <helper exec="/usr/libexec/oddjob/mkhomedir -u 0002"
        <method name="mkhomedirfor">
          <helper exec="/usr/libexec/oddjob/mkhomedir -u 0002"

Comment 4 Stephen Gallagher 2014-02-20 21:15:30 UTC
Raising the severity on this. A bad umask on user directory creation can cause a serious information leak.

Comment 5 Fedora End Of Life 2015-01-09 22:35:21 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 6 Fedora End Of Life 2015-02-18 11:13:26 UTC
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.