Skip to content

Commit ce0dcf4

Browse files
committed
Straight into my veins 💉
1 parent adcf850 commit ce0dcf4

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

dissect/database/ese/ntds/schema.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
# Attribute schema
4343
("attributeID", 131102, 0x00080002, True), # ATTc131102
4444
("attributeSyntax", 131104, 0x00080002, True), # ATTc131104
45-
("omSyntax", 131303, 0x00080009, True), # ATTj131303
45+
("oMSyntax", 131303, 0x00080009, True), # ATTj131303
4646
("oMObjectClass", 131290, 0x0008000A, True), # ATTk131290
4747
("isSingleValued", 131105, 0x00080008, True), # ATTi131105
4848
("linkId", 131122, 0x00080009, True), # ATTj131122
@@ -74,7 +74,8 @@ class AttributeEntry(NamedTuple):
7474
name: str
7575
column: str
7676
type: str
77-
om_syntax: int
77+
om_syntax: int | None
78+
om_object_class: bytes | None
7879
is_single_valued: bool
7980
link_id: int | None
8081
search_flags: SearchFlags | None
@@ -113,6 +114,7 @@ def __init__(self):
113114
column=column_name,
114115
type=attrtyp_to_oid(syntax),
115116
om_syntax=None,
117+
om_object_class=None,
116118
is_single_valued=True,
117119
link_id=None,
118120
search_flags=None,
@@ -127,6 +129,7 @@ def __init__(self):
127129
name=name,
128130
syntax=attribute_syntax,
129131
om_syntax=None,
132+
om_object_class=None,
130133
is_single_valued=is_single_valued,
131134
link_id=None,
132135
search_flags=None,
@@ -160,7 +163,8 @@ def load(self, db: Database) -> None:
160163
id=child.get("attributeID", raw=True),
161164
name=child.get("lDAPDisplayName"),
162165
syntax=child.get("attributeSyntax", raw=True),
163-
om_syntax=child.get("omSyntax"),
166+
om_syntax=child.get("oMSyntax"),
167+
om_object_class=child.get("oMObjectClass"),
164168
is_single_valued=child.get("isSingleValued"),
165169
link_id=child.get("linkId"),
166170
search_flags=child.get("searchFlags"),
@@ -181,7 +185,8 @@ def _add_attribute(
181185
id: int,
182186
name: str,
183187
syntax: int,
184-
om_syntax: int,
188+
om_syntax: int | None,
189+
om_object_class: bytes | None,
185190
is_single_valued: bool,
186191
link_id: int | None,
187192
search_flags: int | None,
@@ -195,6 +200,7 @@ def _add_attribute(
195200
column=f"ATT{OID_TO_TYPE[type_oid]}{id}",
196201
type=type_oid,
197202
om_syntax=om_syntax,
203+
om_object_class=om_object_class,
198204
is_single_valued=is_single_valued,
199205
link_id=link_id,
200206
search_flags=search_flags,

dissect/database/ese/ntds/util.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,7 @@ def decode_value(db: Database, attribute: str, value: Any) -> Any:
330330
if (schema := db.data.schema.lookup_attribute(name=attribute)) is None:
331331
return value
332332

333-
if not schema.type:
334-
return value
335-
333+
# TODO: handle oMSyntax/oMObjectClass deviations?
336334
_, decode = OID_ENCODE_DECODE_MAP.get(schema.type, (None, None))
337335

338336
if decode is None:

0 commit comments

Comments
 (0)