From 95500a737afac7b31c42e77bab8dc527dcaac8e3 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 5 Mar 2010 13:49:22 +0000 Subject: [PATCH] -Correct domain selection from site and calling listclusterusers without arguments git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5388 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- .../lib/xcat/plugins/activedirectory.pm | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/activedirectory.pm b/xCAT-server/lib/xcat/plugins/activedirectory.pm index 0995ec1b1..314762e01 100644 --- a/xCAT-server/lib/xcat/plugins/activedirectory.pm +++ b/xCAT-server/lib/xcat/plugins/activedirectory.pm @@ -9,6 +9,7 @@ use lib "$::XCATROOT/lib/perl"; use Getopt::Long; use xCAT::ADUtils; use Net::DNS; +use strict; sub handled_commands { return { @@ -67,16 +68,18 @@ sub process_request { } if ($command =~ /list.*user/) { #user management command, listing my $passwdfmt; - @ARGV=@{$request->{arg}}; - Getopt::Long::Configure("bundling"); - Getopt::Long::Configure("no_pass_through"); - if (!GetOptions( - 'p' => \$passwdfmt - )) { - die "TODO: usage message"; + if ($request->{arg}) { + @ARGV=@{$request->{arg}}; + Getopt::Long::Configure("bundling"); + Getopt::Long::Configure("no_pass_through"); + if (!GetOptions( + 'p' => \$passwdfmt + )) { + die "TODO: usage message"; + } } unless ($domain and $realm) { - sendmsg([1,"Unable to determine domain from arguments or site tabel"]); + sendmsg([1,"Unable to determine domain from arguments or site table"]); return undef; } my $err = xCAT::ADUtils::krb_login(username=>$adpent->{username},password=>$adpent->{password},realm=>$realm); @@ -123,13 +126,12 @@ sub process_request { die "TODO: usage message"; } my $username = shift @ARGV; - my $domain; if ($username =~ /@/) { ($username,$domain) = split /@/,$username; $domain = lc($domain); } unless ($domain) { - sendmsg([1,"Unable to determine domain from arguments or site tabel"]); + sendmsg([1,"Unable to determine domain from arguments or site table"]); return undef; }