Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1061150 - Race conditions in account provider when creating users.
Summary: Race conditions in account provider when creating users.
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: openlmi-providers
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tomas Smetana
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-04 12:56 UTC by Robin Hack
Modified: 2016-05-16 12:36 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-16 12:36:33 UTC


Attachments (Terms of Use)

Description Robin Hack 2014-02-04 12:56:51 UTC
Description of problem:
Account-provider via libuser sometimes assign same uid for different users. 
Also git for groups are sometimes reused.

Version-Release number of selected component (if applicable):


How reproducible:
always/sometimes/who know?

Steps to Reproduce:
Run this code:
import lmi.shell as lmishell
import threading

class AccountAttackCreate(threading.Thread):
	def __init__ (self, c):
		threading.Thread.__init__(self)
		self.c = c

	def run (self):
		c = lmishell.connect ("gremlinka.brq.redhat.com", "pegasus", "root")
		cs = c.root.cimv2.PG_ComputerSystem.first_instance()
		lams = c.root.cimv2.LMI_AccountManagementService.first_instance()
		lams.CreateAccount(Name="user%d" % self.c, System=cs)


class AccountAttackModify(threading.Thread):
	def __init__ (self, c):
		threading.Thread.__init__(self)
		self.c = c

	def run (self):
		c = lmishell.connect ("gremlinka.brq.redhat.com", "pegasus", "root")
		acci = c.root.cimv2.LMI_Account.first_instance({"Name": "user%d" % self.c})
		acci.LoginShell = '/bin/bash'
		# propagate changes
		acci.push()

class AccountAttackDelete(threading.Thread):
	def __init__ (self, c):
		threading.Thread.__init__(self)
		self.c = c

	def run (self):
		c = lmishell.connect ("gremlinka.brq.redhat.com", "pegasus", "root")
		acci = c.root.cimv2.LMI_Account.first_instance({"Name": "user%d" % self.c})
		# delete the user
		acci.DeleteUser()


for p in xrange (1, 10):
	t1 = AccountAttackCreate(p)
	t2 = AccountAttackModify(p)
	t3 = AccountAttackDelete(p)
	t1.start()
	t2.start()
	t3.start()

Actual results:
Total mess:
Part of /etc/passwd
user1:x:1001:1001:user1:/home/user1:/bin/bash
user3:x:1002:1002:user3:/home/user3:/bin/bash
user2:x:1003:1003:user2:/home/user2:/bin/bash
user4:x:1003:1003:user4:/home/user4:/bin/bash
user6:x:1004:1004:user6:/home/user6:/bin/bash
user8:x:1004:1005:user8:/home/user8:/bin/bash
user7:x:1005:1006:user7:/home/user7:/bin/bash
user9:x:1005:1006:user9:/home/user9:/bin/bash

/etc/group
user1:x:1001:
user3:x:1002:
user2:x:1003:
user4:x:1003:
user6:x:1004:
user5:x:1005:
user8:x:1005:
user7:x:1006:
user9:x:1006:



Expected results:
Something more beatiful. No mess around.

Comment 1 Robin Hack 2014-02-05 09:41:26 UTC
Patch has been send to upstream:
https://reviewboard-openlmi.rhcloud.com/r/1512/

Comment 2 Jaroslav Reznik 2015-03-03 15:26:59 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 4 Tomas Smetana 2016-05-16 12:36:33 UTC
I don't expect any new release of OpenLMI to land in Fedora at all... Let's close the bug.


Note You need to log in before you can comment on or make changes to this bug.