summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2017-08-30 07:43:53 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2017-08-30 07:43:53 +0000
commit60ce015f204c856da350c754f0e864442a24eba8 (patch)
treed5220624fcc34c797e1c190abaa5432200a9e5fd
parentc9c84baf1773e9ff5af992e67f32bb1ab7a5d65c (diff)
gid_t is unsigned, so < 0 test is always false, compare against (gid_t)-1
explicitly; ok millert@
-rw-r--r--usr.bin/rdistd/server.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/rdistd/server.c b/usr.bin/rdistd/server.c
index 45e2254489f..e86f764dad8 100644
--- a/usr.bin/rdistd/server.c
+++ b/usr.bin/rdistd/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.42 2016/03/30 20:51:59 millert Exp $ */
+/* $OpenBSD: server.c,v 1.43 2017/08/30 07:43:52 otto Exp $ */
/*
* Copyright (c) 1983 Regents of the University of California.
@@ -244,7 +244,7 @@ fchog(int fd, char *file, char *owner, char *group, int mode)
} else
gid = gr->gr_gid;
- if (userid && gid >= 0 && gid != primegid) {
+ if (userid && gid != (gid_t)-1 && gid != primegid) {
if (gr)
for (i = 0; gr->gr_mem[i] != NULL; i++)
if (strcmp(locuser, gr->gr_mem[i]) == 0)