The static last_in value in match_gid() needed to default to -2 so
authorWayne Davison <wayned@samba.org>
Sat, 24 Jan 2004 18:36:36 +0000 (18:36 +0000)
committerWayne Davison <wayned@samba.org>
Sat, 24 Jan 2004 18:36:36 +0000 (18:36 +0000)
that we don't accidentally return a GID of 0 when we don't have the
permissions to set it.

uidlist.c

index 896e16c..38c265b 100644 (file)
--- a/uidlist.c
+++ b/uidlist.c
@@ -158,7 +158,7 @@ static int is_in_group(gid_t gid)
 
 static gid_t match_gid(gid_t gid)
 {
-       static gid_t last_in, last_out;
+       static gid_t last_in = (gid_t) -2, last_out;
        struct idlist *list = gidlist;
 
        if (gid == last_in) return last_out;