You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vcl.apache.org by ar...@apache.org on 2011/10/14 22:28:06 UTC

svn commit: r1183490 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm

Author: arkurth
Date: Fri Oct 14 20:28:06 2011
New Revision: 1183490

URL: http://svn.apache.org/viewvc?rev=1183490&view=rev
Log:
VCL-523
Removed /y option from reg.exe EXPORT command since it is not supported on all versions of Windows. Added safety check to set_password to make sure the sshd service is updated if the password is being set for root.

Modified:
    incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm

Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm
URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm?rev=1183490&r1=1183489&r2=1183490&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm (original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm Fri Oct 14 20:28:06 2011
@@ -1947,6 +1947,10 @@ sub set_password {
 	
 	# Get the list of services
 	my @services = $self->get_services_using_login_id($username);
+	if ($username eq 'root' && !@services) {
+		@services = ('sshd');
+	}
+	
 	for my $service (@services) {
 		notify($ERRORS{'DEBUG'}, 0, "$service service is configured to run as $username, updating service credentials");
 		if (!$self->set_service_credentials($service, $username, $password)) {
@@ -2824,7 +2828,7 @@ sub reg_export {
 	$root_key =~ s/\//\\\\/g;
 	
 	# Run reg.exe EXPORT
-	my $command .= "cmd.exe /c \"$system32_path/reg.exe EXPORT $root_key \\\"$registry_file_path.tmp\\\" /y && type \\\"$registry_file_path.tmp\\\" > \\\"$registry_file_path\\\" && del -q \\\"$registry_file_path.tmp\\\"\"";
+	my $command .= "cmd.exe /c \"del /Q \\\"$registry_file_path.tmp\\\" 2>NUL & $system32_path/reg.exe EXPORT $root_key \\\"$registry_file_path.tmp\\\" && type \\\"$registry_file_path.tmp\\\" > \\\"$registry_file_path\\\" && del /Q \\\"$registry_file_path.tmp\\\"\"";
 	my ($exit_status, $output) = run_ssh_command($computer_node_name, $management_node_keys, $command, '', '', 1);
 	if (!defined($output)) {
 		notify($ERRORS{'WARNING'}, 0, "failed to run SSH command to export registry key $root_key to file: $registry_file_path");