Bug 586992

Summary: Incorrect initconfig directory if user has no home directory.
Product: [Retired] 389 Reporter: Endi Sukma Dewata <edewata>
Component: Install/UninstallAssignee: Nathan Kinder <nkinder>
Status: CLOSED UPSTREAM QA Contact: Chandrasekar Kannan <ckannan>
Severity: medium Docs Contact:
Priority: low    
Version: 1.2.6CC: benl, jgalipea, rmeggins
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 389-ds-base-1.2.10.rc1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-07 16:11:03 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
0001-Bug-586992-Incorrect-initconfig-directory-if-user-ha.patch
none
0001-Bug-586992-Incorrect-initconfig-directory-if-user-ha.patch none

Description Endi Sukma Dewata 2010-04-28 16:02:18 UTC
By default a DS instance will run as nobody which has no home directory. Since the user is not root, the initconfig script will be created under $HOME/.dirsrv. Since for nobody the $HOME will be empty, the initconfig will be created in /.dirsrv.

When the $HOME is empty the initconfig directory should be /etc/sysconfig.

Comment 1 Endi Sukma Dewata 2010-04-28 19:25:10 UTC
Created attachment 409946 [details]
0001-Bug-586992-Incorrect-initconfig-directory-if-user-ha.patch

Under certain conditions the USER and HOME environment variables could be empty, which may lead to incorrect initconfig directory. The code has been modified to use the effective UID instead of username for better reliability.

Comment 2 Endi Sukma Dewata 2010-04-29 15:31:29 UTC
This is related to bug #538525.

Comment 3 Rich Megginson 2010-04-29 22:27:00 UTC
Comment on attachment 409946 [details]
0001-Bug-586992-Incorrect-initconfig-directory-if-user-ha.patch

The perl scripts look good.

For the shell scripts - I don't think $EUID is portable.  Is it really a problem that $USER is not defined?  If so, then we need to use a more portable way e.g. use the "id" command or something like that.

Comment 4 Endi Sukma Dewata 2010-04-30 17:14:40 UTC
Created attachment 410550 [details]
0001-Bug-586992-Incorrect-initconfig-directory-if-user-ha.patch

The patch has been modified so that the shell scripts check for empty USER variable instead of using EUID.

Comment 7 Martin Kosek 2012-01-04 13:31:55 UTC
Upstream ticket:
https://fedorahosted.org/389/ticket/88

Comment 8 Rich Megginson 2012-02-07 16:11:03 UTC
Fixed in 389-ds-base-1.2.10.rc1 now in Fedora/EPEL Testing