Author: hanming
Date: Mon Sep 23 17:09:17 2013
New Revision: 191230

URL: http://llvm.org/viewvc/llvm-project?rev=191230&view=rev
Log:
<rdar://problem/14701270>
When logged in as root, just launch debugserver regularly.

Modified:
    lldb/trunk/source/Host/macosx/Host.mm

Modified: lldb/trunk/source/Host/macosx/Host.mm
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Host.mm?rev=191230&r1=191229&r2=191230&view=diff
==============================================================================
--- lldb/trunk/source/Host/macosx/Host.mm (original)
+++ lldb/trunk/source/Host/macosx/Host.mm Mon Sep 23 17:09:17 2013
@@ -1745,11 +1745,12 @@ ShouldLaunchUsingXPC(const char *exe_pat
         if (strcmp(part, debugserver) == 0)
         {
             // We are dealing with debugserver.
-            uid_t requested_uid = launch_info.GetUserID();
-            if (requested_uid == 0)
+            bool launchingAsRoot = launch_info.GetUserID() == 0;
+            bool currentUserIsRoot = Host::GetEffectiveUserID() == 0;
+            
+            if (launchingAsRoot && !currentUserIsRoot)
             {
-                // Launching XPC works for root. It also works for the 
non-attaching case for current login
-                // but unfortunately, we can't detect it here.
+                // If current user is already root, we don't need XPC's help.
                 result = true;
             }
         }


_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

Reply via email to