Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3006.x] Fix issue with win_user.add #66245

Merged
merged 6 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelog/53363.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
``user.add`` on Windows now allows you to add user names that contain all
numeric characters
12 changes: 6 additions & 6 deletions salt/modules/win_dacl.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def processPath(self, path, objectType):
return path


def _getUserSid(user):
def _get_user_sid(user):
"""
return a state error dictionary, with 'sid' as a field if it could be returned
if user is None, sid will also be None
Expand Down Expand Up @@ -413,7 +413,7 @@ def get(path, objectType, user=None):
"""
ret = {"Path": path, "ACLs": []}

sidRet = _getUserSid(user)
sidRet = _get_user_sid(user)

if path and objectType:
dc = daclConstants()
Expand Down Expand Up @@ -458,7 +458,7 @@ def add_ace(path, objectType, user, permission, acetype, propagation):
acetype = acetype.strip().upper()
propagation = propagation.strip().upper()

sidRet = _getUserSid(user)
sidRet = _get_user_sid(user)
if not sidRet["result"]:
return sidRet
permissionbit = dc.getPermissionBit(objectTypeBit, permission)
Expand Down Expand Up @@ -555,7 +555,7 @@ def rm_ace(path, objectType, user, permission=None, acetype=None, propagation=No
if check_ace(path, objectType, user, permission, acetype, propagation, True)[
"Exists"
]:
sidRet = _getUserSid(user)
sidRet = _get_user_sid(user)
if not sidRet["result"]:
return sidRet
permissionbit = (
Expand Down Expand Up @@ -804,7 +804,7 @@ def check_inheritance(path, objectType, user=None):

ret = {"result": False, "Inheritance": False, "comment": ""}

sidRet = _getUserSid(user)
sidRet = _get_user_sid(user)

dc = daclConstants()
objectType = dc.getObjectTypeBit(objectType)
Expand Down Expand Up @@ -880,7 +880,7 @@ def check_ace(
dc.getPropagationBit(objectTypeBit, propagation) if propagation else None
)

sidRet = _getUserSid(user)
sidRet = _get_user_sid(user)
if not sidRet["result"]:
return sidRet

Expand Down
Loading
Loading