From 4d5f368e87b2fcc17dfd4fdca112207c6cc7550e Mon Sep 17 00:00:00 2001 From: Matthew Vernon Date: Tue, 7 Jan 2014 14:29:13 +0000 Subject: check return values of setgid and setuid --- xtrlock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xtrlock.c b/xtrlock.c index 3d5ce70..7598560 100644 --- a/xtrlock.c +++ b/xtrlock.c @@ -108,10 +108,10 @@ int main(int argc, char **argv){ /* logically, if we need to do the following then the same applies to being installed setgid shadow. we do this first, because of a bug in linux. --jdamery */ - setgid(getgid()); + if (setgid(getgid())) { perror("setgid"); exit(1); } /* we can be installed setuid root to support shadow passwords, and we don't need root privileges any longer. --marekm */ - setuid(getuid()); + if (setuid(getuid())) { perror("setuid"); exit(1); } if (strlen(pw->pw_passwd) < 13) { fputs("password entry has no pwd\n",stderr); exit(1); -- cgit v1.2.3