Skip to content

Conversation

@alejandro-colomar
Copy link
Collaborator

@alejandro-colomar alejandro-colomar commented Dec 6, 2025

This is for consistency with how this is done in
sgetsgent().

Now we need to make sure that the list is NULL before
the first call, which means that the 'grent' structure must
be cleared.  Since it's a static object, it's already true, but
let's be explicit about it.

Since we remember the address of the list in
grent.gr_mem (which is static), we don't need to keep
'members' being static too, so we get rid of one static
thing.

This removes a static variable.



Revisions:

v1b
  • Rebase
$ git rd 
1:  93eb0220f = 1:  11c744777 lib/shadow/group/sgetgrent.c: Move free(3) call outside of helper
v1c
  • Rebase
$ git rd 
1:  11c744777 = 1:  afd79dccd lib/shadow/group/sgetgrent.c: Move free(3) call outside of helper

This was referenced Dec 6, 2025
@alejandro-colomar
Copy link
Collaborator Author

  • @hallyn , I'm going to break ls #1272 into small PRs so that we can reason about the changes better.

This is for consistency with how this is done in sgetsgent().

Now we need to make sure that the list is NULL before the first call,
which means that the 'grent' structure must be cleared.  Since it's
a static object, it's already true, but let's be explicit about it.

Since we remember the address of the list in grent.gr_mem (which is
static), we don't need to keep 'members' being static too, so we get rid
of one static thing.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant