Signed-off-by: Alejandro Colomar <alx@kernel.org>
int
add_groups(const char *list)
{
- char *g, *p, *dup;
+ char *dup;
FILE *shadow_logfd = log_get_logfd();
gid_t *gids;
size_t n;
if (gids == NULL)
return -1;
- p = dup = strdup(list);
+ dup = strdup(list);
if (dup == NULL)
goto free_gids;
if (!streq(dup, "")) {
+ char *g, *p;
+
+ p = dup;
while (NULL != (g = strsep(&p, ",:"))) {
struct group *grp;
}
if (user_list) {
- char *u, *ul;
-
if (!aflg) {
// requested to replace the existing groups
grp.gr_mem = xmalloc_T(1, char *);
#endif /* SHADOWGRP */
if (!streq(user_list, "")) {
+ char *u, *ul;
+
ul = user_list;
while (NULL != (u = strsep(&ul, ","))) {
if (prefix_getpwnam(u) == NULL) {