Catch DBusException to not throw error on LDAP group lookup #2673 #2674
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2673
@phillxnet, @Hooverdan96: ready for review.
We currently use InfoPipe to fetch the groupname of domain users. While this works for Active Directory users, this can fail for LDAP users if these do not belong to a posixAccount group. See #2673 and the forum thread linked therein for all details.
This pull request simply catches the DBusException thrown in such cases and logs the event (DEBUG level). The result is a groupname of "null".
Also includes:
Functional testing
Join Rockstor to a LDAP server set with 2 user accounts:
gidNumberof 100: this gid exists in Rockstor so the groupname should be picked up.gidNumberof 10000: this gid does NOT exist in Rockstor and does not correspond to a posixAccount group in the LDAP server so Rockstor cannot look up that group's name.Going to the "Users" page, we do not have an error and we now see both users:

Unit testing