Univention Bugzilla – Bug 39373
ensure uidNumber and gidNumber do not collide when add/mod user or group
Last modified: 2018-10-08 21:48:40 CEST
It would be good to have a test script for this case. +++ This bug was initially created as a clone of Bug #38796 +++ Ticket#2015052921000512 We should ensure that a uidNumber is not used as gidNumber and vice versa as that may lead to problems with samba4 idmap ldb.
AFAIS, it would be good to ensure the following cases: * Automatic UID should not collide with a GID * I am not sure what should happen if a colliding UID is specified explicitely
See also proposal at Bug 26383
Created attachment 7211 [details] WIP Implementation
Added the proposed test to ucs-test. UCS4.0-3: r64583: added the proposed test in 29_user_uidNumber_and_group_gidNumber_collision Package: ucs-test Version: 5.0.173-1.1262.201510191522 UCS4.1-0: r64586: added the proposed test in 29_user_uidNumber_and_group_gidNumber_collision Package ucs-test Version: 6.0.9-16.1263.201510191530
If there exists a user without uidNumber (because the options posix and samba aren't set) the test fails: Traceback (most recent call last): File "29_user_uidNumber_and_group_gidNumber_collision", line 111, in <module> test_results = [consecutive_user_creation()] File "29_user_uidNumber_and_group_gidNumber_collision", line 42, in consecutive_user_creation id_to_collide_with = get_max_id() File "29_user_uidNumber_and_group_gidNumber_collision", line 33, in get_max_id highest_uid = max(int(user['uidNumber']) for user in users) File "29_user_uidNumber_and_group_gidNumber_collision", line 33, in <genexpr> highest_uid = max(int(user['uidNumber']) for user in users) ValueError: invalid literal for int() with base 10: ''
Fixed the test for user objects without a uidNumber attribute. UCS4.0-3: r64747 fixed 29_user_uidNumber_and_group_gidNumber_collision Package: ucs-test Version: 5.0.173-4.1286.201510221455 UCS4.1-0 r64752 fixed 29_user_uidNumber_and_group_gidNumber_collision Package: ucs-test Version: 6.0.10-12.1285.201510221453
Please also test explicit creation with directory/manager/uid_gid/uniqueness=no.
Extended the test as proposed. UCS4.0-3: r64854: extended 29_user_uidNumber_and_group_gidNumber_collision in ucs-test-user to test the directory/manager/uid_gid/uniqueness UCR variable. Code cleanup. Package: ucs-test Version: 5.0.173-5.1292.201510261629 UCS4.1-0: r64855: Merge Package: ucs-test Version: 6.0.10-17.1293.201510261634
Test looks good! VERIFIED