[Bug 3903] New: process_extended_get_users_groups_by_id counts groups wrong

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Sat Dec 6 06:35:59 AEDT 2025


https://bugzilla.mindrot.org/show_bug.cgi?id=3903

            Bug ID: 3903
           Summary: process_extended_get_users_groups_by_id counts groups
                    wrong
           Product: Portable OpenSSH
           Version: 10.2p1
          Hardware: All
                OS: All
            Status: NEW
          Severity: trivial
          Priority: P5
         Component: sftp-server
          Assignee: unassigned-bugs at mindrot.org
          Reporter: kevin at your.org

In process_extended_get_users_groups_by_id:

        while (sshbuf_len(gids) != 0) {
                if ((r = sshbuf_get_u32(gids, &n)) != 0)
                        fatal_fr(r, "parse inner gid");
                gr = getgrgid((gid_t)n);
                name = gr == NULL ? "" : gr->gr_name;
                debug3_f("gid %u => \"%s\"", n, name);
                if ((r = sshbuf_put_cstring(groupnames, name)) != 0)
                        fatal_fr(r, "assemble gid reply");
                nusers++;
        }

That should be "ngroups++" not "nusers++", which appears to be a
copy/paste error from the above block that counts users. This means it
counts groups as users, and always reports 0 groups. I don't believe
this has any impact other than the verbose debug line.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list