mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
parent
b3c50c2640
commit
fbeb8f4139
@ -467,7 +467,7 @@ def _fixlocaluser(username):
|
||||
user_info = win32security.LookupAccountSid(
|
||||
None, pywintypes.SID(nt.GetObject('', 'WinNT://./' + username).objectSID))
|
||||
username = (('{0}\\{1}').format(user_info[1], user_info[0]))
|
||||
except Exception:
|
||||
except:
|
||||
username = ('{0}\\{1}').format(__salt__['grains.get']('host').upper(), username)
|
||||
|
||||
return username
|
||||
@ -487,5 +487,5 @@ def _getnetbiosusernamefromsid(adspath):
|
||||
user_info = win32security.LookupAccountSid(
|
||||
None, pywintypes.SID(nt.GetObject('', adspath).objectSID))
|
||||
return ('{0}\\{1}').format(user_info[1], user_info[0])
|
||||
except Exception:
|
||||
except:
|
||||
return adspath.replace('WinNT://', '').replace('/', '\\')
|
||||
|
@ -981,7 +981,7 @@ def _getnetbiosusernamefromsid(adspath):
|
||||
user_info = win32security.LookupAccountSid(
|
||||
None, pywintypes.SID(nt.GetObject('', adspath).objectSID))
|
||||
return ('{0}\\{1}').format(user_info[1], user_info[0])
|
||||
except Exception:
|
||||
except:
|
||||
return adspath.replace('WinNT://', '').replace('/', '\\')
|
||||
|
||||
|
||||
@ -999,7 +999,7 @@ def _fixlocaluser(username):
|
||||
user_info = win32security.LookupAccountSid(
|
||||
None, pywintypes.SID(nt.GetObject('', 'WinNT://./' + username).objectSID))
|
||||
username = (('{0}\\{1}').format(user_info[1], user_info[0]))
|
||||
except Exception:
|
||||
except:
|
||||
username = ('{0}\\{1}').format(__salt__['grains.get']('host'), username)
|
||||
|
||||
return username
|
||||
|
Loading…
Reference in New Issue
Block a user