1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

netcmd: models: move object_sid field from User to base Model

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
This commit is contained in:
Rob van der Linde 2024-02-21 14:10:11 +13:00 committed by Andrew Bartlett
parent f54cfbea90
commit 5870035486
2 changed files with 3 additions and 4 deletions

View File

@ -31,7 +31,7 @@ from .constants import MODELS
from .exceptions import (DeleteError, FieldError, NotFound, ProtectError, from .exceptions import (DeleteError, FieldError, NotFound, ProtectError,
UnprotectError) UnprotectError)
from .fields import (DateTimeField, DnField, Field, GUIDField, IntegerField, from .fields import (DateTimeField, DnField, Field, GUIDField, IntegerField,
StringField) SIDField, StringField)
from .query import Query from .query import Query
@ -61,6 +61,7 @@ class Model(metaclass=ModelMeta):
object_class = StringField("objectClass", object_class = StringField("objectClass",
default=lambda obj: obj.get_object_class()) default=lambda obj: obj.get_object_class())
object_guid = GUIDField("objectGUID") object_guid = GUIDField("objectGUID")
object_sid = SIDField("objectSid")
usn_changed = IntegerField("uSNChanged", hidden=True, readonly=True) usn_changed = IntegerField("uSNChanged", hidden=True, readonly=True)
usn_created = IntegerField("uSNCreated", hidden=True, readonly=True) usn_created = IntegerField("uSNCreated", hidden=True, readonly=True)
when_changed = DateTimeField("whenChanged", hidden=True, readonly=True) when_changed = DateTimeField("whenChanged", hidden=True, readonly=True)

View File

@ -24,8 +24,7 @@ from ldb import Dn
from samba.dsdb import DS_GUID_USERS_CONTAINER from samba.dsdb import DS_GUID_USERS_CONTAINER
from .fields import (DnField, EnumField, IntegerField, SIDField, StringField, from .fields import DnField, EnumField, IntegerField, NtTimeField, StringField
NtTimeField)
from .model import Model from .model import Model
from .types import AccountType, UserAccountControl from .types import AccountType, UserAccountControl
@ -35,7 +34,6 @@ class User(Model):
account_type = EnumField("sAMAccountType", AccountType) account_type = EnumField("sAMAccountType", AccountType)
assigned_policy = DnField("msDS-AssignedAuthNPolicy") assigned_policy = DnField("msDS-AssignedAuthNPolicy")
assigned_silo = DnField("msDS-AssignedAuthNPolicySilo") assigned_silo = DnField("msDS-AssignedAuthNPolicySilo")
object_sid = SIDField("objectSid")
bad_password_time = NtTimeField("badPasswordTime", readonly=True) bad_password_time = NtTimeField("badPasswordTime", readonly=True)
bad_pwd_count = IntegerField("badPwdCount", readonly=True) bad_pwd_count = IntegerField("badPwdCount", readonly=True)
code_page = IntegerField("codePage") code_page = IntegerField("codePage")