From 2cdd31a312c5d8921adad5fde2d00f1d112a242a Mon Sep 17 00:00:00 2001 From: lissav Date: Wed, 2 Jan 2013 17:18:02 +0000 Subject: [PATCH] add support for updatenode -l disabled git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14724 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-client/bin/updatenode | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/xCAT-client/bin/updatenode b/xCAT-client/bin/updatenode index c5b9ee128..e0795c1dc 100755 --- a/xCAT-client/bin/updatenode +++ b/xCAT-client/bin/updatenode @@ -49,9 +49,6 @@ else Getopt::Long::Configure("posix_default"); Getopt::Long::Configure("no_gnu_compat"); Getopt::Long::Configure("bundling"); -#GetOptions('h|help' => \$::HELP, -# 'v|version' => \$::VERSION); -# display the usage if -h or --help is specified my $tmp=" ".join(' ', @ARGV); if (!($tmp =~ / (--help|-h|-v|--version)/)) { @@ -81,9 +78,7 @@ if (!($tmp =~ / (--help|-h|-v|--version)/)) { } push (@{$cmdref->{arg}}, @ARGV); - -# if trying to update security, get the password -# to access the target node firstly +# check the syntax if ( !GetOptions( 'A|updateallsw' => \$::ALLSW, @@ -94,6 +89,7 @@ if ( 'V|verbose' => \$::VERBOSE, 'F|sync' => \$::FILESYNC, 'f|snsync' => \$::SNFILESYNC, + 'l|user:s' => \$::USER, 'S|sw' => \$::SWMAINTENANCE, 's|sn' => \$::SETSERVER, 'P|scripts:s' => \$::RERUNPS, @@ -110,6 +106,13 @@ if ($::HELP) &updatenode_usage(); exit 0; } +# disable -l option for now +if ($::USER) +{ + my $msg = "-l option is not currently supported."; + xCAT::MsgUtils->message("E", $msg); + exit 1; +} # display the version statement if -v or --verison is specified if ($::VERSION) @@ -124,11 +127,12 @@ if (($::FILESYNC) && ($::SNFILESYNC)){ # only one exit 1; } - +# determine who is running the command on the client and who we will run as +# on the node my $current_userid = getpwuid($>); $ENV{DSH_FROM_USERID} = $current_userid; my $to_userid; -if ($::USER) +if ($::USER) # entered -l { $to_userid = $::USER; } @@ -138,6 +142,7 @@ else } $ENV{DSH_TO_USERID} = $to_userid; +# if -k then we have to get the password if ($::SECURITY) { my $msg; if (!($ENV{'DSH_REMOTE_PASSWORD'}))