diff --git a/meson.build b/meson.build index 467297e0f..ae8a7a14b 100644 --- a/meson.build +++ b/meson.build @@ -205,7 +205,6 @@ enable_daemon = not is_windows and not is_android and get_option('daemon') conf.set('ENABLE_DAEMON', enable_daemon) conf.set('HAVE_GETPWNAM_R', compiler.has_function('getpwnam_r')) -conf.set('HAVE_GETPWUID_R', compiler.has_function('getpwuid_r')) conf.set('HAVE_INITGROUPS', compiler.has_function('initgroups')) conf.set('HAVE_FNMATCH', compiler.has_function('fnmatch')) diff --git a/src/fs/StandardDirectory.cxx b/src/fs/StandardDirectory.cxx index ad0ae2118..1ff5de098 100644 --- a/src/fs/StandardDirectory.cxx +++ b/src/fs/StandardDirectory.cxx @@ -34,7 +34,6 @@ #include #else #include -#include #include #endif @@ -80,15 +79,6 @@ public: return result != nullptr; } - bool ReadByUid(uid_t uid) { -#ifdef HAVE_GETPWUID_R - getpwuid_r(uid, &pw, buf.data(), buf.size(), &result); -#else - result = getpwuid(uid); -#endif - return result != nullptr; - } - const passwd *operator->() { assert(result != nullptr); return result; @@ -375,10 +365,8 @@ GetHomeDir() noexcept if (const auto home = getenv("HOME"); IsValidPathString(home) && IsValidDir(home)) return AllocatedPath::FromFS(home); - - if (PasswdEntry pw; pw.ReadByUid(getuid())) - return SafePathFromFS(pw->pw_dir); #endif + return nullptr; }