1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-28 03:08:14 +00:00

Fixes UID bit test.

This commit is contained in:
Jeremy 2014-12-08 14:54:06 -07:00
parent fc04a94dce
commit 20592f72c0

View File

@ -129,8 +129,8 @@ def has_privileged_access(executable):
if os.geteuid() == 0:
# we are root, so we should have privileged access.
return True
if os.stat(executable).st_mode & stat.S_ISVTX == stat.S_ISVTX:
# the executable has a sticky bit.
if os.stat(executable).st_mode & stat.S_ISUID:
# the executable has set UID bit.
return True
# test if the executable has the CAP_NET_RAW capability (Linux only)