summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Vernon <matthew@debian.org>2014-01-07 14:29:13 +0000
committerMatthew Vernon <matthew@debian.org>2014-01-07 14:29:13 +0000
commit4d5f368e87b2fcc17dfd4fdca112207c6cc7550e (patch)
treed03708dc3eb8700d85818a9d61fc3bda26a7a023
parent36f04a42fe26dac8202f43d4e67f451e5f3bdc80 (diff)
check return values of setgid and setuid
-rw-r--r--xtrlock.c4
1 files 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);