aboutsummaryrefslogtreecommitdiff
path: root/src/utils.nim
diff options
context:
space:
mode:
authorkitsunyan2018-09-17 01:34:20 +0000
committerkitsunyan2018-09-17 01:34:20 +0000
commite6b77b3fbd3b3c526180dfea1eb8a34de63efb95 (patch)
treeca13546df0e2fa2c8c44bdb08ecfa81d3e583c7c /src/utils.nim
parent68854ac3f09df6e7ad496f446500ad8df9249330 (diff)
Drop privileges only if current user is root
Diffstat (limited to 'src/utils.nim')
-rw-r--r--src/utils.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/utils.nim b/src/utils.nim
index 379dfea..748e1e8 100644
--- a/src/utils.nim
+++ b/src/utils.nim
@@ -246,7 +246,7 @@ let initialUser* = try:
none(string)
let uid = uidString.get.parseInt
- if uid == 0: none(User) else: some(getUser(uid))
+ if uid == 0 or currentUser.uid != 0: none(User) else: some(getUser(uid))
except:
none(User)