File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 3636int
3737add_groups (const char * list )
3838{
39- char * g , * p , * dup ;
39+ char * dup ;
4040 FILE * shadow_logfd = log_get_logfd ();
4141 gid_t * gids ;
4242 size_t n ;
@@ -49,11 +49,14 @@ add_groups(const char *list)
4949 if (gids == NULL )
5050 return -1 ;
5151
52- p = dup = strdup (list );
52+ dup = strdup (list );
5353 if (dup == NULL )
5454 goto free_gids ;
5555
5656 if (!streq (dup , "" )) {
57+ char * g , * p ;
58+
59+ p = dup ;
5760 while (NULL != (g = strsep (& p , ",:" ))) {
5861 struct group * grp ;
5962
Original file line number Diff line number Diff line change @@ -259,8 +259,6 @@ grp_update(void)
259259 }
260260
261261 if (user_list ) {
262- char * u , * ul ;
263-
264262 if (!aflg ) {
265263 // requested to replace the existing groups
266264 grp .gr_mem = xmalloc_T (1 , char * );
@@ -283,6 +281,8 @@ grp_update(void)
283281#endif /* SHADOWGRP */
284282
285283 if (!streq (user_list , "" )) {
284+ char * u , * ul ;
285+
286286 ul = user_list ;
287287 while (NULL != (u = strsep (& ul , "," ))) {
288288 if (prefix_getpwnam (u ) == NULL ) {
You can’t perform that action at this time.
0 commit comments