Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 155540 Details for
Bug 240915
[RHEL4] userdel/usermod infinite loop with duplicate names in /etc/group or /etc/gshadow
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
improved patch, which covers same problem in useradd(#151484)
shadow-4.0.3-groupLoop.patch (text/x-diff), 4.14 KB, created by
Peter Vrabec
on 2007-05-28 11:48:53 UTC
(
hide
)
Description:
improved patch, which covers same problem in useradd(#151484)
Filename:
MIME Type:
Creator:
Peter Vrabec
Created:
2007-05-28 11:48:53 UTC
Size:
4.14 KB
patch
obsolete
>--- shadow-4.0.3/lib/sgroupio.h.groupLoop 2001-08-14 23:10:36.000000000 +0200 >+++ shadow-4.0.3/lib/sgroupio.h 2007-05-28 13:18:57.000000000 +0200 >@@ -11,4 +11,5 @@ > extern int sgr_rewind(void); > extern int sgr_unlock(void); > extern int sgr_update(const struct sgrp *); >+extern int sgr_update_entry(const struct sgrp *oldgr, const struct sgrp *newgr); > extern int sgr_sort(void); >--- shadow-4.0.3/lib/sgroupio.c.groupLoop 2001-08-14 23:10:36.000000000 +0200 >+++ shadow-4.0.3/lib/sgroupio.c 2007-05-28 13:18:57.000000000 +0200 >@@ -161,6 +161,13 @@ > } > > int >+sgr_update_entry(const struct sgrp *oldgr, const struct sgrp *newgr) >+{ >+ return commonio_update_entry(&gshadow_db, (const void *) oldgr, >+ (const void *) newgr); >+} >+ >+int > sgr_remove(const char *name) > { > return commonio_remove(&gshadow_db, name); >--- shadow-4.0.3/lib/groupio.h.groupLoop 2001-08-14 23:10:36.000000000 +0200 >+++ shadow-4.0.3/lib/groupio.h 2007-05-28 13:18:57.000000000 +0200 >@@ -10,4 +10,5 @@ > extern int gr_rewind(void); > extern int gr_unlock(void); > extern int gr_update(const struct group *); >+extern int gr_update_entry(const struct group *oldgr, const struct group *newgr); > extern int gr_sort(void); >--- shadow-4.0.3/lib/groupio.c.groupLoop 2001-08-14 23:10:36.000000000 +0200 >+++ shadow-4.0.3/lib/groupio.c 2007-05-28 13:18:57.000000000 +0200 >@@ -136,6 +136,13 @@ > } > > int >+gr_update_entry(const struct group *oldgr, const struct group *newgr) >+{ >+ return commonio_update_entry(&group_db, (const void *) oldgr, >+ (const void *) newgr); >+} >+ >+int > gr_remove(const char *name) > { > return commonio_remove(&group_db, name); >--- shadow-4.0.3/lib/commonio.c.groupLoop 2007-05-28 13:18:57.000000000 +0200 >+++ shadow-4.0.3/lib/commonio.c 2007-05-28 13:18:57.000000000 +0200 >@@ -800,6 +800,37 @@ > return 1; > } > >+int >+commonio_update_entry(struct commonio_db *db, const void *oldgr, >+ const void *newgr) >+{ >+ struct commonio_entry *tmp; >+ >+ if (!db->isopen || db->readonly) { >+ errno = EINVAL; >+ return 0; >+ } >+ >+ tmp = db->head; >+ while (tmp != NULL) { >+ if (oldgr == tmp->eptr) >+ break; >+ tmp = tmp->next; >+ } >+ >+ /* Didn't find this in the database; hop out */ >+ if (tmp == NULL) >+ return 0; >+ >+ tmp->eptr = db->ops->dup(newgr); >+ if (tmp->eptr == NULL) >+ return 1; >+ tmp->changed = 1; >+ >+ db->changed = 1; >+ >+ return 1; >+} > > void > commonio_del_entry(struct commonio_db *db, const struct commonio_entry *p) >--- shadow-4.0.3/src/useradd.c.groupLoop 2007-05-28 13:35:51.000000000 +0200 >+++ shadow-4.0.3/src/useradd.c 2007-05-28 13:37:40.000000000 +0200 >@@ -899,7 +899,7 @@ > */ > > ngrp->gr_mem = add_list (ngrp->gr_mem, user_name); >- if (!gr_update (ngrp)) { >+ if (!gr_update_entry (grp,ngrp)) { > fprintf (stderr, > "%s: error adding new group entry\n", > Prog); >@@ -966,7 +966,7 @@ > */ > > nsgrp->sg_mem = add_list (nsgrp->sg_mem, user_name); >- if (!sgr_update (nsgrp)) { >+ if (!sgr_update_entry (sgrp, nsgrp)) { > fprintf (stderr, > _("%s: error adding new group entry\n"), > Prog); >--- shadow-4.0.3/src/usermod.c.groupLoop 2007-05-28 13:18:57.000000000 +0200 >+++ shadow-4.0.3/src/usermod.c 2007-05-28 13:18:57.000000000 +0200 >@@ -637,7 +637,7 @@ > continue; > > changed = 0; >- if (!gr_update (ngrp)) { >+ if (!gr_update_entry (grp, ngrp)) { > fprintf (stderr, > _("%s: error adding new group entry\n"), > Prog); >@@ -784,7 +784,7 @@ > /* > * Update the group entry to reflect the changes. > */ >- if (!sgr_update (nsgrp)) { >+ if (!sgr_update_entry (sgrp, nsgrp)) { > fprintf (stderr, > _("%s: error adding new group entry\n"), > Prog); >--- shadow-4.0.3/src/userdel.c.groupLoop 2007-05-28 13:18:57.000000000 +0200 >+++ shadow-4.0.3/src/userdel.c 2007-05-28 13:18:57.000000000 +0200 >@@ -179,7 +179,7 @@ > exit (13); /* XXX */ > } > ngrp->gr_mem = del_list (ngrp->gr_mem, user_name); >- if (!gr_update (ngrp)) >+ if (!gr_update_entry (grp, ngrp)) > fprintf (stderr, > _("%s: error updating group entry\n"), > Prog); >@@ -269,7 +269,7 @@ > nsgrp->sg_adm = > del_list (nsgrp->sg_adm, user_name); > >- if (!sgr_update (nsgrp)) >+ if (!sgr_update_entry (sgrp, nsgrp)) > fprintf (stderr, > _("%s: error updating group entry\n"), > Prog);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 240915
:
155199
| 155540 |
303718