File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
contrib/win32/win32compat Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -252,9 +252,13 @@ get_passwd(const wchar_t * user_utf16, PSID sid)
252252 goto cleanup ;
253253 }
254254
255- /* If standard local user name, just use name without decoration */
256- if ((_wcsicmp (domain_name , computer_name ) == 0 ) && (_wcsicmp (computer_name , user_name ) != 0 ))
255+ /* if standard local user name or system account, just use name without decoration */
256+ const SID_IDENTIFIER_AUTHORITY nt_authority = SECURITY_NT_AUTHORITY ;
257+ if (((_wcsicmp (domain_name , computer_name ) == 0 ) && (_wcsicmp (computer_name , user_name ) != 0 )) ||
258+ ((memcmp (& nt_authority , GetSidIdentifierAuthority ((PSID )binary_sid ), sizeof (SID_IDENTIFIER_AUTHORITY )) == 0 ) &&
259+ (((SID * )binary_sid )-> SubAuthority [0 ] == SECURITY_LOCAL_SYSTEM_RID ))) {
257260 wcscpy_s (user_resolved , ARRAYSIZE (user_resolved ), user_name );
261+ }
258262
259263 /* put any other format in sam compatible format */
260264 else
You can’t perform that action at this time.
0 commit comments