fixes a bug in xuserset which makes it go into an infinite loop.
the user entries are read from the pwd database and stored in a local
structure.

Signed-off-by: Abhishek Kulkarni <[EMAIL PROTECTED]>

On Tue, 2008-11-25 at 14:02 -0700, Abhishek Kulkarni wrote:
> (oops i hit send too early)
> the attached patch should fix it for you.
> 
> fixes a bug in xuserset which makes it go into an infinite loop.
> the user entries are read from the pwd database and stored in a local
> structure.
> 
> Signed-off-by: Abhishek Kulkarni <[EMAIL PROTECTED]>
> 
> On Mon, 2008-11-24 at 15:49 -0500, Daniel Gruner wrote:
> > The latest version in the repository (734) has a bug in xuserset when used 
> > as:
> > 
> > xuserset add -a -u
> > 
> > where it goes into an infinite loop repeating this:
> > 
> > xp_user_add: n0000: Error 5: root:user exists
> > xp_user_add: n0001: Error 5: root:user exists
> > xp_user_add: n0000: Error 5: root:user exists
> > xp_user_add: n0001: Error 5: root:user exists
> > 
> > This had happened before, and was fixed then...
> > 
> > This is from the Nov 3 thread:
> > 
> > arrgh, it works fine on my home machine too..
> > but i think i have caught the bug. so getpwent() should loop over the
> > passwd database (contents of /etc/passwd) but in xp_user_add, there's
> > again a call to getpwnam() which could possibly reset the passwd database
> > and getpwent() again returns "root" entry in the next iteration.
> > this is not triggered for all libc versions and the one included in
> > RHEL5.2 seems to break it open badly. I run most of my tests on
> > Ubuntu/Fedora which I have started to believe is a bad choice to test this
> > stuff.
> > 
> > 
> > Daniel

Reply via email to