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

LOGON32_LOGON_BATCH used instead of LOGON32_LOGON_SERVICE when Creating User Logon Session #132

Open
laozc opened this issue Mar 29, 2024 · 0 comments

Comments

@laozc
Copy link
Contributor

laozc commented Mar 29, 2024

The code referred below tries to create a user logon session with LOGON32_LOGON_BATCH type.

token = osutils.create_user_logon_session(
service_user, service_password, service_domain,
logon_type=osutils.LOGON32_LOGON_BATCH)

However, the installer script granted the SeBatchLogonRight right for the created user.
Only SeServiceLogonRight is granted by default.
https://github.com/cloudbase/cloudbase-init-installer/blob/a19436cf78d6add1b25a4a21d6141320b31a5f93/CloudbaseInitSetup/Carbon/Service/Install-Service.ps1#L194
Grant-Privilege -Identity $identity -Privilege SeServiceLogonRight

It doesn't seem to result in any logon error with LOGON32_LOGON_BATCH type.
Not sure if it was on purpose to use LOGON32_LOGON_BATCH other than LOGON32_LOGON_SERVICE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant