Skip to content

Commit

Permalink
Merge pull request #61 from ShutdownRepo/rbcd
Browse files Browse the repository at this point in the history
fortra#1393 [rbcd.py] Handled SID not found in LDAP error
  • Loading branch information
GeisericII authored Jun 2, 2024
2 parents 3fce8ef + 1534e44 commit 06ac3a6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/rbcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,10 @@ def get_allowed_to_act(self):
logging.info('Accounts allowed to act on behalf of other identity:')
for ace in sd['Dacl'].aces:
SID = ace['Ace']['Sid'].formatCanonical()
SamAccountName = self.get_sid_info(ace['Ace']['Sid'].formatCanonical())[1]
logging.info(' %-10s (%s)' % (SamAccountName, SID))
SidInfos = self.get_sid_info(ace['Ace']['Sid'].formatCanonical())
if SidInfos:
SamAccountName = SidInfos[1]
logging.info(' %-10s (%s)' % (SamAccountName, SID))
else:
logging.info('Attribute msDS-AllowedToActOnBehalfOfOtherIdentity is empty')
except IndexError:
Expand Down

0 comments on commit 06ac3a6

Please sign in to comment.