Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1886433

Summary: oddjob-mkhomedir - homedir has a wrong permissions
Product: Red Hat Enterprise Linux 8 Reporter: Alexander Bokovoy <abokovoy>
Component: oddjobAssignee: Alexander Bokovoy <abokovoy>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.4CC: abokovoy, amore, fdvorak, ipa-qe, ksiddiqu, lilu, lmiksik, rcritten, ssidhaye, sumenon
Target Milestone: rcKeywords: Regression
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: oddjob-0.34.5-4.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1886362 Environment:
Last Closed: 2021-05-18 15:21:04 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:
Bug Depends On: 1886362    
Bug Blocks:    

Comment 7 Sudhir Menon 2020-11-02 09:56:41 UTC
Beaker job has passed using RHEL8.4: https://beaker.engineering.redhat.com/jobs/4698153.
Hence marking the bug as verified.

Installed     : oddjob-0.34.5-4.el8.x86_64

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Test description
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

PURPOSE of /CoreOS/oddjob/Sanity/oddjob-mkhomedir-sanity-test
Description: Test if oddjob-mkhomedir can create correct home directories
Author: Patrik Kis <pkis>
Bug summary: oddjob-mkhomedir fails mkdir: cannot create directory Permission denied
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1098616

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 13:26:31 ] :: [   PASS   ] :: Checking for the presence of oddjob rpm 
:: [ 13:26:31 ] :: [   LOG    ] :: Package versions:
:: [ 13:26:31 ] :: [   LOG    ] ::   oddjob-0.34.5-4.el8.x86_64
:: [ 13:26:31 ] :: [   PASS   ] :: Checking for the presence of oddjob-mkhomedir rpm 
:: [ 13:26:31 ] :: [   LOG    ] :: Package versions:
:: [ 13:26:31 ] :: [   LOG    ] ::   oddjob-mkhomedir-0.34.5-4.el8.x86_64
:: [ 13:26:31 ] :: [   PASS   ] :: Checking for the presence of nscd rpm 
:: [ 13:26:31 ] :: [   LOG    ] :: Package versions:
:: [ 13:26:31 ] :: [   LOG    ] ::   nscd-2.28-132.el8.x86_64
:: [ 13:26:31 ] :: [   PASS   ] :: Creating tmp directory (Expected 0, got 0)
:: [ 13:26:31 ] :: [   PASS   ] :: Command 'pushd /tmp/tmp.TwLZw8u2Cq' (Expected 0, got 0)
:: [ 13:26:31 ] :: [   INFO   ] :: using '/var/tmp/beakerlib-117212066/backup' as backup destination
:: [ 13:26:31 ] :: [   INFO   ] :: using '/var/tmp/beakerlib-117212066/backup' as backup destination
:: [ 13:26:32 ] :: [   PASS   ] :: Command 'useradd -M alice' (Expected 0, got 0)
:: [ 13:26:32 ] :: [   PASS   ] :: Command 'authselect select sssd with-mkhomedir --backup=BACKUP --force' (Expected 0, got 0)
:: [ 13:26:32 ] :: [   PASS   ] :: Command 'grep oddjob /etc/pam.d/*' (Expected 0, got 0)
:: [ 13:26:32 ] :: [   INFO   ] :: using '/var/tmp/beakerlib-117212066/backup' as backup destination
:: [ 13:26:32 ] :: [   PASS   ] :: Command 'sed -i 's/sss//g' /etc/nsswitch.conf' (Expected 0, got 0)
:: [ 13:26:33 ] :: [   LOG    ] :: rlServiceStart: Service oddjobd started successfully
:: [ 13:26:33 ] :: [   LOG    ] :: rlServiceStart: Service nscd started successfully
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Duration: 2s
::   Assertions: 9 good, 0 bad
::   RESULT: PASS (Setup)


::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Home directory creation for remote user
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 13:26:37 ] :: [   PASS   ] :: File /home/alice should not exist 
:: [ 13:26:37 ] :: [   PASS   ] :: Command 'su -c pwd - alice &>login.log' (Expected 0, got 0)
:: [ 13:26:37 ] :: [   PASS   ] :: File 'login.log' should contain '^/home/alice$' 
:: [ 13:26:37 ] :: [   PASS   ] :: File 'login.log' should not contain 'No such file or directory' 
:: [ 13:26:37 ] :: [   PASS   ] :: Directory /home/alice should exist 
:: [ 13:26:37 ] :: [   PASS   ] :: User and group owner check (Assert: 'root:root' should equal 'root:root')
:: [ 13:26:37 ] :: [   PASS   ] :: Access rights check (Assert: '755' should equal '755')
:: [ 13:26:37 ] :: [   PASS   ] :: File type check (Assert: 'directory' should equal 'directory')
:: [ 13:26:37 ] :: [   PASS   ] :: Selinux security context check: /home (Assert: 'system_u:object_r:home_root_t:s0' should equal 'system_u:object_r:home_root_t:s0')
:: [ 13:26:37 ] :: [   PASS   ] :: User and group owner check (Assert: 'alice:alice' should equal 'alice:alice')
:: [ 13:26:37 ] :: [   PASS   ] :: Access rights check (Assert: '700' should equal '700')
:: [ 13:26:37 ] :: [   PASS   ] :: File type check (Assert: 'directory' should equal 'directory')
:: [ 13:26:37 ] :: [   PASS   ] :: Selinux security context check: /home/alice (Assert: 'unconfined_u:object_r:user_home_dir_t:s0' should equal 'unconfined_u:object_r:user_home_dir_t:s0')
:: [ 13:26:37 ] :: [   PASS   ] :: Command 'rm -rf /home/alice/' (Expected 0, got 0)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Duration: 0s
::   Assertions: 14 good, 0 bad
::   RESULT: PASS (Home directory creation for remote user)


::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Home directory creation for remote user in a non standard location
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 13:26:42 ] :: [   PASS   ] :: Command 'usermod --home /home/oddjobtest/aaa/bbb alice' (Expected 0, got 0)
:: [ 13:26:43 ] :: [   PASS   ] :: File /home/oddjobtest/aaa/bbb should not exist 
:: [ 13:26:43 ] :: [   PASS   ] :: Command 'su -c pwd - alice &>login.log' (Expected 0, got 0)
:: [ 13:26:43 ] :: [   PASS   ] :: File 'login.log' should contain '^/home/oddjobtest/aaa/bbb$' 
:: [ 13:26:43 ] :: [   PASS   ] :: File 'login.log' should not contain 'No such file or directory' 
:: [ 13:26:43 ] :: [   PASS   ] :: Directory /home/oddjobtest/aaa/bbb should exist 
:: [ 13:26:43 ] :: [   PASS   ] :: User and group owner check (Assert: 'root:root' should equal 'root:root')
:: [ 13:26:43 ] :: [   PASS   ] :: Access rights check (Assert: '755' should equal '755')
:: [ 13:26:43 ] :: [   PASS   ] :: File type check (Assert: 'directory' should equal 'directory')
:: [ 13:26:43 ] :: [   PASS   ] :: Selinux security context check: /home (Assert: 'system_u:object_r:home_root_t:s0' should equal 'system_u:object_r:home_root_t:s0')
:: [ 13:26:43 ] :: [   PASS   ] :: User and group owner check (Assert: 'root:root' should equal 'root:root')
:: [ 13:26:43 ] :: [   PASS   ] :: Access rights check (Assert: '711' should equal '711')
:: [ 13:26:43 ] :: [   PASS   ] :: File type check (Assert: 'directory' should equal 'directory')
:: [ 13:26:43 ] :: [   PASS   ] :: Selinux security context check: /home/oddjobtest (Assert: 'unconfined_u:object_r:user_home_dir_t:s0' should equal 'unconfined_u:object_r:user_home_dir_t:s0')
:: [ 13:26:43 ] :: [   PASS   ] :: User and group owner check (Assert: 'root:root' should equal 'root:root')
:: [ 13:26:43 ] :: [   PASS   ] :: Access rights check (Assert: '711' should equal '711')
:: [ 13:26:43 ] :: [   PASS   ] :: File type check (Assert: 'directory' should equal 'directory')
:: [ 13:26:43 ] :: [   PASS   ] :: Selinux security context check: /home/oddjobtest/aaa (Assert: 'unconfined_u:object_r:user_home_t:s0' should equal 'unconfined_u:object_r:user_home_t:s0')
:: [ 13:26:43 ] :: [   PASS   ] :: User and group owner check (Assert: 'alice:alice' should equal 'alice:alice')
:: [ 13:26:43 ] :: [   PASS   ] :: Access rights check (Assert: '700' should equal '700')
:: [ 13:26:43 ] :: [   PASS   ] :: File type check (Assert: 'directory' should equal 'directory')
:: [ 13:26:43 ] :: [   PASS   ] :: Selinux security context check: /home/oddjobtest/aaa/bbb (Assert: 'unconfined_u:object_r:user_home_t:s0' should equal 'unconfined_u:object_r:user_home_t:s0')
:: [ 13:26:44 ] :: [   PASS   ] :: Command 'usermod --home /home/alice alice' (Expected 0, got 0)
:: [ 13:26:44 ] :: [   PASS   ] :: Command 'rm -rf /home/oddjobtest' (Expected 0, got 0)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Duration: 3s
::   Assertions: 24 good, 0 bad
::   RESULT: PASS (Home directory creation for remote user in a non standard location)


::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Home directory creation for local user
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 13:26:48 ] :: [   PASS   ] :: Command 'service nscd stop' (Expected 0, got 0)
:: [ 13:26:48 ] :: [   PASS   ] :: File /home/alice should not exist 
:: [ 13:26:49 ] :: [   PASS   ] :: Command 'su -c pwd - alice &>login.log' (Expected 0, got 0)
:: [ 13:26:49 ] :: [   PASS   ] :: File 'login.log' should contain '^/home/alice$' 
:: [ 13:26:49 ] :: [   PASS   ] :: File 'login.log' should not contain 'No such file or directory' 
:: [ 13:26:49 ] :: [   PASS   ] :: Directory /home/alice should exist 
:: [ 13:26:49 ] :: [   PASS   ] :: User and group owner check (Assert: 'root:root' should equal 'root:root')
:: [ 13:26:49 ] :: [   PASS   ] :: Access rights check (Assert: '755' should equal '755')
:: [ 13:26:49 ] :: [   PASS   ] :: File type check (Assert: 'directory' should equal 'directory')
:: [ 13:26:49 ] :: [   PASS   ] :: Selinux security context check: /home (Assert: 'system_u:object_r:home_root_t:s0' should equal 'system_u:object_r:home_root_t:s0')
:: [ 13:26:49 ] :: [   PASS   ] :: User and group owner check (Assert: 'alice:alice' should equal 'alice:alice')
:: [ 13:26:49 ] :: [   PASS   ] :: Access rights check (Assert: '700' should equal '700')
:: [ 13:26:49 ] :: [   PASS   ] :: File type check (Assert: 'directory' should equal 'directory')
:: [ 13:26:49 ] :: [   PASS   ] :: Selinux security context check: /home/alice (Assert: 'unconfined_u:object_r:user_home_dir_t:s0' should equal 'unconfined_u:object_r:user_home_dir_t:s0')
:: [ 13:26:49 ] :: [   PASS   ] :: Command 'rm -rf /home/alice/' (Expected 0, got 0)
:: [ 13:26:49 ] :: [   PASS   ] :: Command 'service nscd start' (Expected 0, got 0)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

Comment 9 errata-xmlrpc 2021-05-18 15:21:04 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (oddjob bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:1759