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

Fix to set user information at the time of task creation #31

Conversation

Vasu1105
Copy link

We should set user information at the time of creating task so if wrong username and password is provided the task should not get create.

StartWhenAvailable flag is false at the time of creation so set that also to false I have tested this flags value using scheduledtask.exe too.

Signed-off-by: vasu1105 vasundhara.jagdale@msystechnologies.com

Signed-off-by: vasu1105 <vasundhara.jagdale@msystechnologies.com>
@@ -491,17 +491,24 @@ def priority=(priority)
# trigger variable is a hash of options that define when the scheduled
# job should run.
#
def new_work_item(task, trigger)
def new_work_item(task, userinfo, trigger)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is this called from? just line 172? https://github.com/chef/win32-taskscheduler/pull/31/files#diff-6e8eaa39e1a37c92c78a5801c8d9a3abL172

Don't we need to update everywhere this is called from as well to pass the same arguments?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@btm thank you. I have fixed the code to give backward compatibility. There is call for new_work_item from https://github.com/chef/win32-taskscheduler/blob/ole/lib/win32/taskscheduler.rb#L172 which now does not require to do any changes since user information is now optional argument. I have related changes in the window_task PR here chef/chef#7288 which needs to be merged after this gets merged.

Signed-off-by: vasu1105 <vasundhara.jagdale@msystechnologies.com>
@Vasu1105 Vasu1105 merged commit dd09459 into chef:ole Jun 6, 2018
@Vasu1105 Vasu1105 deleted the vasundhara/fix_to_set_user_information_at_the_time_of_creation_of_task branch June 6, 2018 06:29
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

Successfully merging this pull request may close these issues.

None yet

2 participants