This project has moved and is read-only. For the latest updates, please go here.

A password must be supplied

Topics: Errors
Feb 18, 2016 at 3:43 PM

I found a small issue. There is need to provide a password when task logon type is S4U and task runner is differ from current user
Now edit dialog checks and adds password only when type is InterraciveTokenOrPasswor or Password.
The issue is located here: TaskEditDialog.okBtn_Click
step to reproduce:
  • run edit dialog (edit|new task)
  • change user account for task running
  • set "Run whether user is logged on or not" and "Do not store password"
Feb 18, 2016 at 7:24 PM
Thanks. Fixed in 2.5.15
Feb 26, 2016 at 12:47 PM
Edited Feb 26, 2016 at 12:49 PM

New build works fine when you add a new task but does not work with an old task when you try to edit it.
For this case UserId always is not empty and check at Task.cs does not work:
        public bool RequiresPassword() => LogonType == TaskLogonType.InteractiveTokenOrPassword ||
            LogonType == TaskLogonType.Password || (LogonType == TaskLogonType.S4U && UserId != null);
I meant in that case password dialog appears in anyway independently of if current user is runner of task or not.
Feb 26, 2016 at 3:50 PM
Thank you for doing better testing than me. I have corrected and it will be in the next release.
Feb 29, 2016 at 7:58 AM
I have tested again and found a new issue) Sometime unnecessary dialog appears for current user. I don't know how but right now I have two tasks with current user as runner but its name has different cases.
I guess string.Compare(UserId, System.Security.Principal.WindowsIdentity.GetCurrent().Name) should compare with ignore case (StringComparison.OrdinalIgnoreCase).

Thank you.
Feb 29, 2016 at 7:38 PM
Thanks. I will publish today or tomorrow with this fix as well.