Bug 586992 - Incorrect initconfig directory if user has no home directory.
Summary: Incorrect initconfig directory if user has no home directory.
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: 389
Classification: Retired
Component: Install/Uninstall
Version: 1.2.6
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Nathan Kinder
QA Contact: Chandrasekar Kannan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-04-28 16:02 UTC by Endi Sukma Dewata
Modified: 2015-01-04 23:42 UTC (History)
3 users (show)

Fixed In Version: 389-ds-base-1.2.10.rc1
Clone Of:
Environment:
Last Closed: 2012-02-07 16:11:03 UTC
Embargoed:


Attachments (Terms of Use)
0001-Bug-586992-Incorrect-initconfig-directory-if-user-ha.patch (3.48 KB, patch)
2010-04-28 19:25 UTC, Endi Sukma Dewata
no flags Details | Diff
0001-Bug-586992-Incorrect-initconfig-directory-if-user-ha.patch (3.60 KB, patch)
2010-04-30 17:14 UTC, Endi Sukma Dewata
no flags Details | Diff

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


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