diff options
author | Jeremie Laval <jeremie.laval@gmail.com> | 2012-11-20 22:11:42 +0400 |
---|---|---|
committer | Jeremie Laval <jeremie.laval@gmail.com> | 2012-11-20 22:11:42 +0400 |
commit | 29e95b76d844c76cd3ccffc991e57604339c39ee (patch) | |
tree | bfffe2f8223880bc11ec23c90a7d536df6d6529f /RootLauncher.cs | |
parent | e798cd51f95f2ea0c1982bb55edbed8396f07186 (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.cs | 7 |
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) { |