Commit 8b5261a9 authored by Mike Hibler's avatar Mike Hibler

Patches for 10.0 and 10.1 release to deal with "pw" bugs.

Fixes issue with user appearing multiple times on a /etc/group line.
parent 137fa49e
This diff is collapsed.
diff -Nu pw.orig/pw_user.c pw/pw_user.c
--- pw.orig/pw_user.c 2014-11-11 13:02:22.000000000 -0700
+++ pw/pw_user.c 2015-01-14 22:56:15.000000000 -0700
@@ -754,6 +754,15 @@
int i;
for (i = 0; cnf->groups[i] != NULL; i++) {
grp = GETGRNAM(cnf->groups[i]);
+ /* already on the list? */
+ if (grp->gr_mem != NULL) {
+ int j;
+ for (j = 0; grp->gr_mem[j] != NULL; j++)
+ if (!strcmp(pwd->pw_name, grp->gr_mem[j]))
+ break;
+ if (grp->gr_mem[j])
+ continue;
+ }
grp = gr_add(grp, pwd->pw_name);
/*
* grp can only be NULL in 2 cases:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment