From 6b0e98a9260a25ff5d0b29617a85b36de4dc7f38 Mon Sep 17 00:00:00 2001 From: Amit Bakshi Date: Fri, 22 May 2015 00:55:07 +0000 Subject: [PATCH] Fix uid < 0 always false check --- daemon/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/main.cpp b/daemon/main.cpp index 4c7513d..5941b91 100644 --- a/daemon/main.cpp +++ b/daemon/main.cpp @@ -466,7 +466,7 @@ void drop_privileges() { LogSpam << "drop_privileges()"; uid_t uid = dropped_uid(); - if (uid < 0) + if (uid == (uid_t)-1) { throw std::runtime_error("User " + user.get() + " is not known."); }