A password must be supplied

Topics: Errors
Feb 18, 2016 at 2:43 PM
Hi!

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
Image
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"
Coordinator
Feb 18, 2016 at 6:24 PM
Thanks. Fixed in 2.5.15
Feb 26, 2016 at 11:47 AM
Edited Feb 26, 2016 at 11:49 AM
Hi,

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.
Coordinator
Feb 26, 2016 at 2: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 6: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.
Coordinator
Feb 29, 2016 at 6:38 PM
Thanks. I will publish today or tomorrow with this fix as well.