From dc5043225f8a4e92183c34b615fd142dccc7e18e Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 3 Apr 2003 16:03:07 +0000 Subject: The check for whether or not a group is empty was busted. Closes PR 3178. --- usr.sbin/user/user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.sbin') 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)) { -- cgit v1.2.3