From 628e629d60a3fb1d9320fe0d38489450bd2cd8cc Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 9 Apr 2009 19:14:06 -0400 Subject: [PATCH] restrict-access: One more root dropping fix. --HG-- branch : HEAD --- src/lib/restrict-access.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/restrict-access.c b/src/lib/restrict-access.c index 0246c6630a..cbb80ad0cb 100644 --- a/src/lib/restrict-access.c +++ b/src/lib/restrict-access.c @@ -297,7 +297,7 @@ void restrict_access(const struct restrict_access_settings *set, } /* verify that we actually dropped the privileges */ - if (set->uid != 0 || disallow_root) { + if ((set->uid != (uid_t)-1 && set->uid != 0) || disallow_root) { if (setuid(0) == 0) { if (disallow_root && (set->uid == 0 || set->uid == (uid_t)-1)) -- 2.47.3