mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge remote-tracking branch 'origin/fix_get_uid_user_create' into stretch-unstable
This commit is contained in:
commit
77b6a881f5
1 changed files with 4 additions and 2 deletions
|
@ -170,7 +170,8 @@ def user_create(operation_logger, username, firstname, lastname, mail, password,
|
||||||
|
|
||||||
uid_guid_found = False
|
uid_guid_found = False
|
||||||
while not uid_guid_found:
|
while not uid_guid_found:
|
||||||
uid = str(random.randint(200, 99999))
|
# LXC uid number is limited to 65536 by default
|
||||||
|
uid = str(random.randint(200, 65000))
|
||||||
uid_guid_found = uid not in all_uid and uid not in all_gid
|
uid_guid_found = uid not in all_uid and uid not in all_gid
|
||||||
|
|
||||||
# Adapt values for LDAP
|
# Adapt values for LDAP
|
||||||
|
@ -201,8 +202,9 @@ def user_create(operation_logger, username, firstname, lastname, mail, password,
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise YunohostError('user_creation_failed', user=username, error=e)
|
raise YunohostError('user_creation_failed', user=username, error=e)
|
||||||
|
|
||||||
# Invalidate passwd to take user creation into account
|
# Invalidate passwd and group to take user and group creation into account
|
||||||
subprocess.call(['nscd', '-i', 'passwd'])
|
subprocess.call(['nscd', '-i', 'passwd'])
|
||||||
|
subprocess.call(['nscd', '-i', 'group'])
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Attempt to create user home folder
|
# Attempt to create user home folder
|
||||||
|
|
Loading…
Add table
Reference in a new issue