Skip to content

Commit

Permalink
Don't delete empty groups from database (#758)
Browse files Browse the repository at this point in the history
UDENG-5873
  • Loading branch information
adombeck authored Jan 28, 2025
2 parents 1b15684 + eac7af1 commit b98b25f
Show file tree
Hide file tree
Showing 24 changed files with 100 additions and 174 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
GroupByID: {}
GroupByName: {}
GroupByUGID: {}
GroupToUsers: {}
UserByID: {}
UserByName: {}
GroupByID:
"1111": '{"Name":"TestIsAuthenticated/Error_on_updating_local_groups_with_unexisting_file_separator_success_with_local_groups","GID":1111,"UGID":"TestIsAuthenticated/Error_on_updating_local_groups_with_unexisting_file_separator_success_with_local_groups"}'
"2222": '{"Name":"group-success_with_local_groups","GID":2222,"UGID":"ugid-success_with_local_groups"}'
GroupByName:
TestIsAuthenticated/Error_on_updating_local_groups_with_unexisting_file_separator_success_with_local_groups: '{"Name":"TestIsAuthenticated/Error_on_updating_local_groups_with_unexisting_file_separator_success_with_local_groups","GID":1111,"UGID":"TestIsAuthenticated/Error_on_updating_local_groups_with_unexisting_file_separator_success_with_local_groups"}'
group-success_with_local_groups: '{"Name":"group-success_with_local_groups","GID":2222,"UGID":"ugid-success_with_local_groups"}'
GroupByUGID:
TestIsAuthenticated/Error_on_updating_local_groups_with_unexisting_file_separator_success_with_local_groups: '{"Name":"TestIsAuthenticated/Error_on_updating_local_groups_with_unexisting_file_separator_success_with_local_groups","GID":1111,"UGID":"TestIsAuthenticated/Error_on_updating_local_groups_with_unexisting_file_separator_success_with_local_groups"}'
ugid-success_with_local_groups: '{"Name":"group-success_with_local_groups","GID":2222,"UGID":"ugid-success_with_local_groups"}'
GroupToUsers:
"1111": '{"GID":1111,"UIDs":[1111]}'
"2222": '{"GID":2222,"UIDs":[1111]}'
UserByID:
"1111": '{"Name":"TestIsAuthenticated/Error_on_updating_local_groups_with_unexisting_file_separator_success_with_local_groups","UID":1111,"GID":1111,"Gecos":"gecos for success_with_local_groups","Dir":"/home/success_with_local_groups","Shell":"/bin/sh/success_with_local_groups","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"ABCDETIME"}'
UserByName:
TestIsAuthenticated/Error_on_updating_local_groups_with_unexisting_file_separator_success_with_local_groups: '{"Name":"TestIsAuthenticated/Error_on_updating_local_groups_with_unexisting_file_separator_success_with_local_groups","UID":1111,"GID":1111,"Gecos":"gecos for success_with_local_groups","Dir":"/home/success_with_local_groups","Shell":"/bin/sh/success_with_local_groups","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"ABCDETIME"}'
UserToBroker: {}
UserToGroups: {}
UserToGroups:
"1111": '{"UID":1111,"GIDs":[1111,2222]}'
UserToLocalGroups:
"1111": '["localgroup1","localgroup3"]'
4 changes: 2 additions & 2 deletions internal/users/cache/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,8 @@ func TestDeleteUser(t *testing.T) {
wantErr bool
wantErrType error
}{
"Delete_existing_user": {dbFile: "one_user_and_group"},
"Delete_existing_user_keeping_other_users_intact": {dbFile: "multiple_users_and_groups"},
"Deleting_last_user_from_a_group_keeps_the_group_record": {dbFile: "one_user_and_group"},
"Deleting_existing_user_keeps_other_group_members_intact": {dbFile: "multiple_users_and_groups"},

"Error_on_missing_user": {wantErrType: cache.NoDataFoundError{}},
"Error_on_invalid_database_entry": {dbFile: "invalid_entry_in_userByID", wantErr: true},
Expand Down
28 changes: 2 additions & 26 deletions internal/users/cache/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,34 +41,10 @@ func deleteUserFromGroup(buckets map[string]bucketWithName, uid, gid uint32) err
}

groupToUsers.UIDs = slices.DeleteFunc(groupToUsers.UIDs, func(id uint32) bool { return id == uid })
if len(groupToUsers.UIDs) > 0 {
// Update the group entry with the new list of UIDs
updateBucket(buckets[groupToUsersBucketName], gid, groupToUsers)
return nil
}

// We now need to delete this group with no remaining user.
// We need the group.Name to delete from groupByName bucket.
group, err := getFromBucket[GroupDB](buckets[groupByIDBucketName], gid)
if err != nil {
return err
}
// Update the group entry with the new list of UIDs
updateBucket(buckets[groupToUsersBucketName], gid, groupToUsers)

gidKey := []byte(strconv.FormatUint(uint64(gid), 10))
// Delete group
// Delete calls fail if the transaction is read only, so we should panic if this function is called in that context.
if err = buckets[groupToUsersBucketName].Delete(gidKey); err != nil {
panic(fmt.Sprintf("programming error: delete is not allowed in a RO transaction: %v", err))
}
if err = buckets[groupByIDBucketName].Delete(gidKey); err != nil {
panic(fmt.Sprintf("programming error: delete is not allowed in a RO transaction: %v", err))
}
if err = buckets[groupByNameBucketName].Delete([]byte(group.Name)); err != nil {
panic(fmt.Sprintf("programming error: delete is not allowed in a RO transaction: %v", err))
}
if err = buckets[groupByUGIDBucketName].Delete([]byte(group.UGID)); err != nil {
panic(fmt.Sprintf("programming error: delete is not allowed in a RO transaction: %v", err))
}
return nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@
gid: 99999
ugid: "87654321"
users:
- user1
- user2
- user3
- userwithoutbroker

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
GroupByID:
"11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}'
"22222": '{"Name":"group2","GID":22222,"UGID":"56781234"}'
"33333": '{"Name":"group3","GID":33333,"UGID":"34567812"}'
"44444": '{"Name":"group4","GID":44444,"UGID":"45678123"}'
"99999": '{"Name":"commongroup","GID":99999,"UGID":"87654321"}'
GroupByName:
commongroup: '{"Name":"commongroup","GID":99999,"UGID":"87654321"}'
group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}'
group2: '{"Name":"group2","GID":22222,"UGID":"56781234"}'
group3: '{"Name":"group3","GID":33333,"UGID":"34567812"}'
group4: '{"Name":"group4","GID":44444,"UGID":"45678123"}'
GroupByUGID:
"12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}'
"34567812": '{"Name":"group3","GID":33333,"UGID":"34567812"}'
"45678123": '{"Name":"group4","GID":44444,"UGID":"45678123"}'
"56781234": '{"Name":"group2","GID":22222,"UGID":"56781234"}'
"87654321": '{"Name":"commongroup","GID":99999,"UGID":"87654321"}'
GroupToUsers:
"11111": '{"GID":11111,"UIDs":[]}'
"22222": '{"GID":22222,"UIDs":[2222]}'
"33333": '{"GID":33333,"UIDs":[3333]}'
"44444": '{"GID":33333,"UIDs":[4444]}'
"99999": '{"GID":99999,"UIDs":[2222,3333]}'
"99999": '{"GID":99999,"UIDs":[2222,3333,4444]}'
UserByID:
"2222": '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"BBBBBTIME"}'
"3333": '{"Name":"user3","UID":3333,"GID":33333,"Gecos":"User3","Dir":"/home/user3","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"ABCDETIME"}'
Expand All @@ -32,5 +36,5 @@ UserToBroker:
UserToGroups:
"2222": '{"UID":2222,"GIDs":[22222,99999]}'
"3333": '{"UID":3333,"GIDs":[33333,99999]}'
"4444": '{"UID":4444,"GIDs":[44444]}'
"4444": '{"UID":4444,"GIDs":[44444,99999]}'
UserToLocalGroups: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
GroupByID:
"11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}'
GroupByName:
group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}'
GroupByUGID:
"12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}'
GroupToUsers:
"11111": '{"GID":11111,"UIDs":[]}'
UserByID: {}
UserByName: {}
UserToBroker: {}
UserToGroups: {}
UserToLocalGroups: {}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ GroupToUsers:
"22222": '{"GID":22222,"UIDs":[2222]}'
"33333": '{"GID":33333,"UIDs":[3333]}'
"44444": '{"GID":33333,"UIDs":[4444]}'
"99999": '{"GID":99999,"UIDs":[2222,3333]}'
"99999": '{"GID":99999,"UIDs":[1111,2222,3333,4444]}'
UserByID:
"1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"AAAAATIME"}'
"2222": '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"BBBBBTIME"}'
Expand All @@ -37,8 +37,8 @@ UserToBroker:
"2222": '"broker-id"'
"3333": '"broker-id"'
UserToGroups:
"1111": '{"UID":1111,"GIDs":[11111]}'
"1111": '{"UID":1111,"GIDs":[11111,99999]}'
"2222": '{"UID":2222,"GIDs":[22222,99999]}'
"3333": '{"UID":3333,"GIDs":[33333,99999]}'
"4444": '{"UID":4444,"GIDs":[44444]}'
"4444": '{"UID":4444,"GIDs":[44444,99999]}'
UserToLocalGroups: {}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ GroupToUsers:
"22222": '{"GID":22222,"UIDs":[2222,1111]}'
"33333": '{"GID":33333,"UIDs":[3333]}'
"44444": '{"GID":33333,"UIDs":[4444]}'
"99999": '{"GID":99999,"UIDs":[2222,3333]}'
"99999": '{"GID":99999,"UIDs":[2222,3333,4444]}'
UserByID:
"1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"ABCDETIME"}'
"2222": '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"BBBBBTIME"}'
Expand All @@ -40,6 +40,6 @@ UserToGroups:
"1111": '{"UID":1111,"GIDs":[11111,22222]}'
"2222": '{"UID":2222,"GIDs":[22222,99999]}'
"3333": '{"UID":3333,"GIDs":[33333,99999]}'
"4444": '{"UID":4444,"GIDs":[44444]}'
"4444": '{"UID":4444,"GIDs":[44444,99999]}'
UserToLocalGroups:
"1111": "null"
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
GroupByID:
"11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}'
"22222": '{"Name":"group2","GID":22222,"UGID":"56781234"}'
GroupByName:
group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}'
group2: '{"Name":"group2","GID":22222,"UGID":"56781234"}'
GroupByUGID:
"12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}'
"56781234": '{"Name":"group2","GID":22222,"UGID":"56781234"}'
GroupToUsers:
"11111": '{"GID":11111,"UIDs":[]}'
"22222": '{"GID":22222,"UIDs":[1111]}'
UserByID:
"1111": '{"Name":"user1","UID":1111,"GID":22222,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"ABCDETIME"}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ GroupToUsers:
"22222": '{"GID":22222,"UIDs":[2222]}'
"33333": '{"GID":33333,"UIDs":[3333]}'
"44444": '{"GID":33333,"UIDs":[4444]}'
"99999": '{"GID":99999,"UIDs":[2222]}'
"99999": '{"GID":99999,"UIDs":[1111,2222,4444]}'
UserByID:
"1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"AAAAATIME"}'
"2222": '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"BBBBBTIME"}'
Expand All @@ -37,9 +37,9 @@ UserToBroker:
"2222": '"broker-id"'
"3333": '"broker-id"'
UserToGroups:
"1111": '{"UID":1111,"GIDs":[11111]}'
"1111": '{"UID":1111,"GIDs":[11111,99999]}'
"2222": '{"UID":2222,"GIDs":[22222,99999]}'
"3333": '{"UID":3333,"GIDs":[33333]}'
"4444": '{"UID":4444,"GIDs":[44444]}'
"4444": '{"UID":4444,"GIDs":[44444,99999]}'
UserToLocalGroups:
"3333": "null"
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ GroupToUsers:
"22222": '{"GID":22222,"UIDs":[2222]}'
"33333": '{"GID":33333,"UIDs":[3333]}'
"44444": '{"GID":33333,"UIDs":[4444]}'
"99999": '{"GID":99999,"UIDs":[2222,3333]}'
"99999": '{"GID":99999,"UIDs":[2222,3333,4444]}'
UserByID:
"1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"ABCDETIME"}'
"2222": '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"BBBBBTIME"}'
Expand All @@ -40,6 +40,6 @@ UserToGroups:
"1111": '{"UID":1111,"GIDs":[11111]}'
"2222": '{"UID":2222,"GIDs":[22222,99999]}'
"3333": '{"UID":3333,"GIDs":[33333,99999]}'
"4444": '{"UID":4444,"GIDs":[44444]}'
"4444": '{"UID":4444,"GIDs":[44444,99999]}'
UserToLocalGroups:
"1111": "null"
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ GroupToUsers:
"22222": '{"GID":22222,"UIDs":[2222]}'
"33333": '{"GID":33333,"UIDs":[3333]}'
"44444": '{"GID":33333,"UIDs":[4444]}'
"99999": '{"GID":99999,"UIDs":[2222,3333]}'
"99999": '{"GID":99999,"UIDs":[1111,2222,3333,4444]}'
UserByID:
"1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"AAAAATIME"}'
"2222": '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"BBBBBTIME"}'
Expand All @@ -33,10 +33,10 @@ UserByName:
user3: '{"Name":"user3","UID":3333,"GID":33333,"Gecos":"User3","Dir":"/home/user3","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"ABCDETIME"}'
userwithoutbroker: '{"Name":"userwithoutbroker","UID":4444,"GID":44444,"Gecos":"userwithoutbroker","Dir":"/home/userwithoutbroker","Shell":"/bin/sh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"ABCDETIME"}'
UserToGroups:
"1111": '{"UID":1111,"GIDs":[11111]}'
"1111": '{"UID":1111,"GIDs":[11111,99999]}'
"2222": '{"UID":2222,"GIDs":[22222,99999]}'
"3333": '{"UID":3333,"GIDs":[33333,99999]}'
"4444": '{"UID":4444,"GIDs":[44444]}'
"4444": '{"UID":4444,"GIDs":[44444,99999]}'
UserToBroker:
"1111": '"broker-id"'
"2222": '"broker-id"'
Expand Down
2 changes: 1 addition & 1 deletion internal/users/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func (m *Manager) UpdateUser(u types.UserInfo) (err error) {

// Update local groups.
if err := localentries.Update(u.Name, localGroups, oldLocalGroups); err != nil {
return errors.Join(err, m.cache.DeleteUser(uid))
return err
}

if err = checkHomeDirOwnership(userDB.Dir, userDB.UID, userDB.GID); err != nil {
Expand Down
5 changes: 1 addition & 4 deletions internal/users/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ func TestUpdateUser(t *testing.T) {
"UID_does_not_change_if_user_already_exists": {userCase: "same-name-different-uid", dbFile: "one_user_and_group", wantSameUID: true},
"GID_does_not_change_if_group_with_same_UGID_exists": {groupsCase: "different-name-same-ugid", dbFile: "one_user_and_group"},
"GID_does_not_change_if_group_with_same_name_and_empty_UGID_exists": {groupsCase: "authd-group", dbFile: "group-with-empty-UGID"},
"Removing_last_user_from_a_group_keeps_the_group_record": {groupsCase: "no-groups", dbFile: "one_user_and_group"},

"Error_if_user_has_no_username": {userCase: "nameless", wantErr: true, noOutput: true},
"Error_if_group_has_no_name": {groupsCase: "nameless-group", wantErr: true, noOutput: true},
Expand All @@ -168,10 +169,6 @@ func TestUpdateUser(t *testing.T) {
"Error_if_user_exists_on_system": {userCase: "user-exists-on-system", wantErr: true, noOutput: true},
"Error_if_group_exists_on_system": {groupsCase: "group-exists-on-system", wantErr: true, noOutput: true},

"Error_when_updating_local_groups_remove_user_from_db": {groupsCase: "mixed-groups-gpasswd-fail", localGroupsFile: "gpasswdfail_in_deleted_group.group", wantErr: true},
"Error_when_updating_local_groups_remove_user_from_db_without_touching_other_users": {dbFile: "multiple_users_and_groups", groupsCase: "mixed-groups-gpasswd-fail", localGroupsFile: "gpasswdfail_in_deleted_group.group", wantErr: true},
"Error_when_updating_local_groups_remove_user_from_db_even_if_already_existed": {userCase: "user2", dbFile: "multiple_users_and_groups", groupsCase: "mixed-groups-gpasswd-fail", localGroupsFile: "gpasswdfail_in_deleted_group.group", wantErr: true},

"Error_on_invalid_entry": {groupsCase: "authd-group", dbFile: "invalid_entry_in_userToGroups", localGroupsFile: "users_in_groups.group", wantErr: true, noOutput: true},
}
for name, tc := range tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
- name: commongroup
gid: 99999
users:
- user1
- user2
- user3
- userwithoutbroker
passwd: ""
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ GroupToUsers:
"22222": '{"GID":22222,"UIDs":[2222]}'
"33333": '{"GID":33333,"UIDs":[3333]}'
"44444": '{"GID":33333,"UIDs":[4444]}'
"99999": '{"GID":99999,"UIDs":[2222,3333]}'
"99999": '{"GID":99999,"UIDs":[1111,2222,3333,4444]}'
UserByID:
"1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"AAAAATIME"}'
"2222": '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"BBBBBTIME"}'
Expand All @@ -37,8 +37,8 @@ UserToBroker:
"2222": '"broker-id"'
"3333": '"broker-id"'
UserToGroups:
"1111": '{"UID":1111,"GIDs":[11111]}'
"1111": '{"UID":1111,"GIDs":[11111,99999]}'
"2222": '{"UID":2222,"GIDs":[22222,99999]}'
"3333": '{"UID":3333,"GIDs":[33333,99999]}'
"4444": '{"UID":4444,"GIDs":[44444]}'
"4444": '{"UID":4444,"GIDs":[44444,99999]}'
UserToLocalGroups: {}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ GroupToUsers:
"22222": '{"GID":22222,"UIDs":[2222]}'
"33333": '{"GID":33333,"UIDs":[3333]}'
"44444": '{"GID":33333,"UIDs":[4444]}'
"99999": '{"GID":99999,"UIDs":[2222,3333]}'
"99999": '{"GID":99999,"UIDs":[1111,2222,3333,4444]}'
UserByID:
"1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"AAAAATIME"}'
"2222": '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"BBBBBTIME"}'
Expand All @@ -37,8 +37,8 @@ UserToBroker:
"2222": '"broker-id"'
"3333": '"broker-id"'
UserToGroups:
"1111": '{"UID":1111,"GIDs":[11111]}'
"1111": '{"UID":1111,"GIDs":[11111,99999]}'
"2222": '{"UID":2222,"GIDs":[22222,99999]}'
"3333": '{"UID":3333,"GIDs":[33333,99999]}'
"4444": '{"UID":4444,"GIDs":[44444]}'
"4444": '{"UID":4444,"GIDs":[44444,99999]}'
UserToLocalGroups: {}
Loading

0 comments on commit b98b25f

Please sign in to comment.