Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wilfried committed Oct 29, 2023
1 parent af2bf98 commit ffd2dd6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.42
1.0.43
28 changes: 15 additions & 13 deletions ldeep/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,8 @@ def default(o):
if not sid:
continue
res = self.engine.resolve_sid(sid)
for item in res:
name = item['dNSHostName']
print(f"Primary/Secondary Site: {name}")
name = next(res)['dNSHostName']
print(f"Primary/Secondary Site: {name}")
except:
print(f"Primary/Secondary Site: {sid}")
# sccm distribution points
Expand Down Expand Up @@ -546,8 +545,8 @@ def list_sccm(self, kwargs):
verbose = kwargs.get("verbose", False)

# Primary/Secondary Sites
self.engine.set_controls(LDAP_SERVER_SD_FLAGS_OID_SEC_DESC)
if verbose:
self.engine.set_controls(LDAP_SERVER_SD_FLAGS_OID_SEC_DESC)
attributes = ['*', '+', 'ntSecurityDescriptor']
else:
attributes = ["objectClass", "ntSecurityDescriptor"]
Expand All @@ -561,19 +560,22 @@ def list_sccm(self, kwargs):
)

# Distribution points
self.engine.set_controls()
if verbose:
self.engine.set_controls()
attributes = self.engine.all_attributes()
else:
attributes = ["objectClass", "dNSHostName"]

results = self.display(
self.engine.query(
self.engine.DP_SCCM_FILTER(),
attributes,
),
verbose
)
try:
results = self.display(
self.engine.query(
self.engine.DP_SCCM_FILTER(),
attributes,
),
verbose
)
except Exception as e:
error(f"SCCM may not be installed: {e}")

def list_subnets(self, kwargs):
"""
Expand Down Expand Up @@ -814,7 +816,7 @@ def list_delegations(self, kwargs):
if not sid:
continue
res = self.engine.resolve_sid(sid)
name = res[0]['sAMAccountName']
name = next(res)['sAMAccountName']
print(f"{name}:rbcd:{sam}")
except Exception:
print(f"{sid}:rbcd:{sam}")
Expand Down

0 comments on commit ffd2dd6

Please sign in to comment.