From c383ababdcb59044f71d08ad5a3478db6bde4136 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Fri, 18 Dec 2009 12:17:06 +0000 Subject: [PATCH] MGR: fix another bug due to changes for Snow Leopard compatibility svn path=/trunk/boinc/; revision=19967 --- checkin_notes | 10 ++++++++++ client/check_security.cpp | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/checkin_notes b/checkin_notes index 6308972d53..64a85d860b 100644 --- a/checkin_notes +++ b/checkin_notes @@ -10281,3 +10281,13 @@ Rom 18 Dec 2009 clientgui/msw/ taskbarex.cpp, .h + +Charlie 5 Dec 2009 + - MGR: fix another bug due to changes for Snow Leopard compatibility: + on OS 10.4.11 (Tiger) and perhaps others, when Automatic Login is + set, getlogin() returns "root" for a time after the system is first + booted, causing the Manager to think the user is not a member of + group boinc_master. So check "USER" environment variable instead. + + client/ + check_security.cpp diff --git a/client/check_security.cpp b/client/check_security.cpp index d3e5297b40..94487d479b 100644 --- a/client/check_security.cpp +++ b/client/check_security.cpp @@ -673,7 +673,9 @@ bool IsUserInGroupBM() { return true; // User's primary group is boinc_master } - userName = getlogin(); + // On some systems with Automatic Login set, getlogin() returns "root" for a + // time after the system is first booted, so we check "USER" environment variable. + userName = getenv("USER"); if (userName) { for (i=0; ; i++) { // Step through all users in group boinc_master groupMember = grp->gr_mem[i];