diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2003-04-03 16:03:07 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2003-04-03 16:03:07 +0000 |
commit | dc5043225f8a4e92183c34b615fd142dccc7e18e (patch) | |
tree | 494584a2c38854ad5fa4fb299693d11ddbb66c56 /usr.sbin | |
parent | c564c3ad2afbff38b266bb52c308b4f6be7665f7 (diff) |
The check for whether or not a group is empty was busted. Closes PR 3178.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/user/user.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/user/user.c b/usr.sbin/user/user.c index 0084d9d7cff..45cc0d95484 100644 --- a/usr.sbin/user/user.c +++ b/usr.sbin/user/user.c @@ -1,4 +1,4 @@ -/* $OpenBSD: user.c,v 1.40 2002/12/10 20:49:28 millert Exp $ */ +/* $OpenBSD: user.c,v 1.41 2003/04/03 16:03:06 millert Exp $ */ /* $NetBSD: user.c,v 1.45 2001/08/17 08:29:00 joda Exp $ */ /* @@ -513,7 +513,7 @@ append_group(char *user, int ngroups, char **groups) while (isspace(buf[cc - 1])) cc--; buf[(j = cc)] = '\0'; - if (*(colon + 1) != '\0') + if (buf[strlen(buf) - 1] != ':') strlcat(buf, ",", sizeof(buf)); cc = strlcat(buf, user, sizeof(buf)) + 1; if (cc >= sizeof(buf)) { |