[Pkg-shadow-devel] Issue with concurrent usage of gpasswd

Loris lboillet69 at gmail.com
Tue Jun 12 08:43:16 UTC 2012


Hello,

On Sat, May 19, 2012 at 10:54 AM, Nicolas François
<nicolas.francois at centraliens.net> wrote:
> gpasswd locks /etc/group. It should have been the case also in lenny.
>
> If you send me a script which can be used to reproduce this issue, I can
> give it a try.

I can reproduce it something like one out of 3/4 times with the script below:

# cat addusertest.sh
#!/bin/sh

grep tmptest /etc/group

adduser foo tmptest &
adduser foo2 tmptest &

sleep 3

grep tmptest /etc/group
EOF

First you need to add test users and group:
# adduser foo
# adduser foo2
# addgroup tmptest

Run example:
# ./addusertest.sh
tmptest:x:1002:
Adding user `foo' to group `tmptest' ...
Adding user foo to group tmptest
Adding user `foo2' to group `tmptest' ...
Adding user foo2 to group tmptest
Done.
Done.
tmptest:x:1002:foo2

(to "reinitialize" test setup, run 'delgroup tmptest; addgroup tmptest')

Loris



More information about the Pkg-shadow-devel mailing list