Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.4.2
-
None
Description
Windows.pm::user_exists is only checking the exit status of the net user command, not the output. If a user exists, the command should return an exit status of 0. If the user does not exist, it should return exit status 2.
jfthomps showed me a case where vcld.log was reporting exit status 0 (user exists) when the user did not exist:
2017-06-23 12:50:11|8075|16|16|reinstall|Windows.pm:user_exists|1870|user admin exists on vm1-4, exit status: 0, output: |8075|16|16|reinstall|Windows.pm:user_exists|1870| The user name could not be found. |8075|16|16|reinstall|Windows.pm:user_exists|1870| More help is available by typing NET HELPMSG 2221.
I'm not sure why the exit status is incorrect. Regardless, the output should be checked to prevent this.