Start service from LocalSystem account.

Questions about Wine on Linux
Locked
count0
Newbie
Newbie
Posts: 1
Joined: Fri Dec 09, 2022 2:55 am

Start service from LocalSystem account.

Post by count0 »

Hello world!
I migrate some app, what use service, and this service checks:
1. It's run as a service (or write error to log and exit).
2. It's run from SYSTEM account (even NetworkService or LocalService in Windows results in error and exit).
Wine always use logged username to run even system services. I tryed many
"runassystem" windows applications, but have some errors, like

Code: Select all

fixme:advapi:LsaEnumerateAccounts (000000000000CAFE,000000000011D370,000000000011D2F8,256,000000000011D368) stub
fixme:service:QueryServiceConfig2W Level 3 not implemented
02b4:fixme:service:QueryServiceConfig2W Level 8 not implemented
02b4:fixme:service:QueryServiceConfig2W Level 8 not implemented
fixme:sync:NtConnectPort (0x14015f1c0,L"\\BaseNamedObjects\\ProcessHackerDTGSOHCDONXFINV",0x11ce40,0x11ce68,0x11ce50,0x11ced8,0x11ced0,0x11cec8),stub!
02b4:fixme:eventlog:ControlTraceW (cafe4242, (null), 00000000033B3B80, 3) stub
02a0:fixme:sync:NtConnectPort (0x14015f1c0,L"\\BaseNamedObjects\\ProcessHackerDTGSOHCDONXFINV",0x11ce40,0x11ce68,0x11ce50,0x11ced8,0x11ced0,0x11cec8),stub!
02a0:fixme:sync:NtConnectPort (0x14015f1c0,L"\\BaseNamedObjects\\ProcessHackerDTGSOHCDONXFINV",0x11ce40,0x11ce68,0x11ce50,0x11ced8,0x11ced0,0x11cec8),stub!
or

Code: Select all

0800:fixme:security:ImpersonateLoggedOnUser (0000000000000060)
0800:fixme:advapi:CreateProcessWithTokenW 0000000000000060 0x00000000 L"C:\\windows\\system32\\cmd.exe" L"\"C:\\windows\\system32\\cmd.exe\"" 0x00008000 0000000000000000 L"Z:\\media\\data\\1.my" 000000000011ED20 000000000011ED00 - semi-stub
or Hung/Crash
or run anyway as current user.
or what Secondary Logon (seclogon) service not found.
I try modify Environment variables like this:

Code: Select all

export COMPUTERNAME=TEST; export USER="NT AUTHORITY\SYSTEM" ;export  USERNAME="NT AUTHORITY\SYSTEM" ; export LOGNAME="NT AUTHORITY\SYSTEM" ; export USERPROFILE=C:\Windows\system32\config\systemprofile ; wine regedit
It's modified in running programs, but in ProcessHacker for example, I see in User column real username and PC-name. And service see it too! ))
I try use username="PC-NAME!" as in windows Environment variables of LocalSystem services.
No helps.
How can I change this behavior without patching WINE or closed-source program?
If you know where Wine get current logged user (in sources), say me too.
Locked