aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README1
-rwxr-xr-xexmachina.py3
2 files changed, 3 insertions, 1 deletions
diff --git a/README b/README
index 690bc17..c96fa0f 100644
--- a/README
+++ b/README
@@ -13,7 +13,6 @@ Just a first commit...
TODO:
* re-implement python-augeas methods using API client-side
* use /var/lib/exmachina/<something> as socket instead of /tmp/exmachina.sock?
-* check to make sure server is running as root
* check/set permissions on socket after server opens it
* tests and demonstrations
diff --git a/exmachina.py b/exmachina.py
index cb909ef..254fc10 100755
--- a/exmachina.py
+++ b/exmachina.py
@@ -122,6 +122,9 @@ class ExMachinaClient():
def run_server(socket_path="/tmp/exmachina.sock"):
# TODO: check for root permissions, warn if not root
+ if not 0 == os.geteuid():
+ log.warn("Expected to be running as root!")
+
if os.path.exists(socket_path):
os.unlink(socket_path)
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)