diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1997-10-07 23:39:35 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1997-10-07 23:39:35 +0000 |
commit | ced0af81760ec1acff0ecd80db9672fc474a43d0 (patch) | |
tree | c3632b3b3226c2720d3be8ca3f647a230f44cf80 /usr.bin | |
parent | 012b01d315e7c11d69cd6c584423a8c7e28094cb (diff) |
Don't use cached name value for uid/gid if last lookup was by id (and not name).
Fix also sent to rdist-bugs@usc.edu
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/rdist/common.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/rdist/common.c b/usr.bin/rdist/common.c index b67d6521c2b..ca9996671c4 100644 --- a/usr.bin/rdist/common.c +++ b/usr.bin/rdist/common.c @@ -1,4 +1,4 @@ -/* $OpenBSD: common.c,v 1.4 1997/04/27 13:01:28 downsj Exp $ */ +/* $OpenBSD: common.c,v 1.5 1997/10/07 23:39:34 millert Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -35,7 +35,7 @@ #ifndef lint static char RCSid[] = -"$OpenBSD: common.c,v 1.4 1997/04/27 13:01:28 downsj Exp $"; +"$OpenBSD: common.c,v 1.5 1997/10/07 23:39:34 millert Exp $"; static char sccsid[] = "@(#)common.c"; @@ -542,7 +542,7 @@ extern char *getusername(uid, file, opts) /* * Try to avoid getpwuid() call. */ - if (lastuid == uid && buf[0]) + if (lastuid == uid && buf[0] && buf[0] != ':') return(buf); lastuid = uid; @@ -581,7 +581,7 @@ extern char *getgroupname(gid, file, opts) /* * Try to avoid getgrgid() call. */ - if (lastgid == gid && buf[0]) + if (lastgid == gid && buf[0] && buf[0] != ':') return(buf); lastgid = gid; |