Skip to content

Commit af56d94

Browse files
committed
Remove unused function and simplify logic
1 parent fb52fc6 commit af56d94

1 file changed

Lines changed: 0 additions & 14 deletions

File tree

nxc/modules/presence.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,6 @@ def options(self, context, module_options):
1919
"""There are no module options."""
2020

2121
def on_admin_login(self, context, connection):
22-
def safe_str(obj):
23-
try:
24-
if isinstance(obj, bytes):
25-
return obj.decode("utf-8", errors="replace")
26-
if hasattr(obj, "to_string"):
27-
return obj.to_string()
28-
return str(obj)
29-
except Exception:
30-
return "[unrepresentable object]"
31-
3222
try:
3323
context.log.debug(f"Target NetBIOS Name: {connection.hostname}")
3424

@@ -87,10 +77,6 @@ def safe_str(obj):
8777

8878
try:
8979
group_handle = samr.hSamrOpenGroup(dce, domain_handle, samr.GROUP_LIST_MEMBERS, group_rid)["GroupHandle"]
90-
except Exception as group_e:
91-
context.log.debug(f"Failed to process {group_name} group: {group_e!s}")
92-
return False
93-
try:
9480
resp = samr.hSamrGetMembersInGroup(dce, group_handle)
9581
for member in resp["Members"]["Members"]:
9682
rid = int.from_bytes(member.getData(), byteorder="little")

0 commit comments

Comments
 (0)