Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ccedadd

Browse files
committed
Finished Mac OS X
1 parent e8c1155 commit ccedadd

1 file changed

Lines changed: 6 additions & 12 deletions

File tree

lib/core/option.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -258,22 +258,16 @@ def __setMetasploit():
258258
if conf.osSmb:
259259
isAdmin = False
260260

261-
# TODO: add support for Mac OS X
262-
#if "darwin" in PLATFORM:
263-
# pass
264-
#
265-
#elif "win" in PLATFORM:
266-
267-
if "win" in PLATFORM:
268-
isAdmin = ctypes.windll.shell32.IsUserAnAdmin()
261+
if "linux" in PLATFORM or "darwin" in PLATFORM:
262+
isAdmin = os.geteuid()
269263

270-
if isinstance(isAdmin, (int, float, long)) and isAdmin == 1:
264+
if isinstance(isAdmin, (int, float, long)) and isAdmin == 0:
271265
isAdmin = True
272266

273-
elif "linux" in PLATFORM:
274-
isAdmin = os.geteuid()
267+
elif "win" in PLATFORM:
268+
isAdmin = ctypes.windll.shell32.IsUserAnAdmin()
275269

276-
if isinstance(isAdmin, (int, float, long)) and isAdmin == 0:
270+
if isinstance(isAdmin, (int, float, long)) and isAdmin == 1:
277271
isAdmin = True
278272

279273
else:

0 commit comments

Comments
 (0)