mirror of
https://github.com/znc/znc.git
synced 2026-07-31 14:03:00 +02:00
Also use /etc/passwd if $HOME is set but empty
Before this, we used ./.znc as datadir in this case. Not good. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1081 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -397,9 +397,12 @@ void CZNC::InitDirs(const CString& sArgvPath, const CString& sDataDir) {
|
||||
// Try to set the user's home dir, default to binpath on failure
|
||||
home = getenv("HOME");
|
||||
|
||||
m_sHomePath.clear();
|
||||
if (home) {
|
||||
m_sHomePath = home;
|
||||
} else {
|
||||
}
|
||||
|
||||
if (m_sHomePath.empty()) {
|
||||
struct passwd* pUserInfo = getpwuid(getuid());
|
||||
|
||||
if (pUserInfo) {
|
||||
|
||||
Reference in New Issue
Block a user