Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xamarin/macdoc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremie Laval <jeremie.laval@gmail.com>2012-11-20 22:11:42 +0400
committerJeremie Laval <jeremie.laval@gmail.com>2012-11-20 22:11:42 +0400
commit29e95b76d844c76cd3ccffc991e57604339c39ee (patch)
treebfffe2f8223880bc11ec23c90a7d536df6d6529f /RootLauncher.cs
parente798cd51f95f2ea0c1982bb55edbed8396f07186 (diff)
[macdoc] Update to use the new apple-doc-wizard setuid shim (no password required anymore except to fix the binary). We also now show a sort-of progress window that allow to restart macdoc after the merge to pick up the new changes.
Diffstat (limited to 'RootLauncher.cs')
-rw-r--r--RootLauncher.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/RootLauncher.cs b/RootLauncher.cs
index 35e1db4..a4851a5 100644
--- a/RootLauncher.cs
+++ b/RootLauncher.cs
@@ -4,6 +4,7 @@ using System.Linq;
using System.Diagnostics;
using System.Collections.Generic;
using System.Runtime.InteropServices;
+using Mono.Unix;
namespace macdoc
{
@@ -40,6 +41,12 @@ namespace macdoc
public static class RootLauncher
{
const string SecurityFramework = "/System/Library/Frameworks/Security.framework/Versions/Current/Security";
+
+ public static bool IsRootEnabled (string toolPath)
+ {
+ var stat = new UnixFileInfo (toolPath);
+ return stat.IsSetUser && stat.IsSetGroup && stat.OwnerUserId == 0;
+ }
public static void LaunchExternalTool (string toolPath, string[] args)
{