Author: jsuchome Date: Thu Oct 16 13:07:04 2008 New Revision: 52286 URL: http://svn.opensuse.org/viewcvs/yast?rev=52286&view=rev Log: - check the return value of dig command (bnc#435878) - use domainname to get the domain name (workaround for bnc#393951) - 2.17.18 Modified: trunk/users/VERSION trunk/users/package/yast2-users.changes trunk/users/src/UsersSimple.pm Modified: trunk/users/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/users/VERSION?rev=52286&r1=52285&r2=52286&view=diff ============================================================================== --- trunk/users/VERSION (original) +++ trunk/users/VERSION Thu Oct 16 13:07:04 2008 @@ -1 +1 @@ -2.17.17 +2.17.18 Modified: trunk/users/package/yast2-users.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/users/package/yast2-users.changes?rev=52286&r1=52285&r2=52286&view=diff ============================================================================== --- trunk/users/package/yast2-users.changes (original) +++ trunk/users/package/yast2-users.changes Thu Oct 16 13:07:04 2008 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Thu Oct 16 11:32:53 CEST 2008 - jsuchome@suse.cz + +- check the return value of dig command (bnc#435878) +- use domainname to get the domain name (workaround for bnc#393951) +- 2.17.18 + +------------------------------------------------------------------- Mon Oct 13 16:06:59 CEST 2008 - jsuchome@suse.cz - added CLI option 'batchmode': do not ask for data (bnc#431685) Modified: trunk/users/src/UsersSimple.pm URL: http://svn.opensuse.org/viewcvs/yast/trunk/users/src/UsersSimple.pm?rev=52286&r1=52285&r2=52286&view=diff ============================================================================== --- trunk/users/src/UsersSimple.pm (original) +++ trunk/users/src/UsersSimple.pm Thu Oct 16 13:07:04 2008 @@ -1218,19 +1218,31 @@ } my $domain = Hostname->CurrentDomain (); + y2milestone ("current domain : '$domain'"); + if (!$domain && Stage->cont ()) + { + my $out = SCR->Execute (".target.bash_output", "domainname"); + if ($out->{"exit"} eq 0) { + $domain = $out->{"stdout"}; + chomp $domain; + y2milestone ("current domain from domainname: '$domain'"); + } + } # First, check if LDAP server is available - my $out = SCR->Execute (".target.bash_output", "dig _ldap._tcp.$domain SRV +short"); + my $out = SCR->Execute (".target.bash_output", "dig '_ldap._tcp.$domain' SRV +short"); y2debug ("dig output: ", Dumper ($out)); my $ldap_server = ""; - foreach my $line (split (/\n/,$out->{"stdout"} || "")) { - y2debug ("line: $line"); - if ($line !~ m/^;/) { - $ldap_server = (split (/[ \t]/, $line))[3] || "."; - chop $ldap_server; - y2debug ("proposed LDAP server '$ldap_server'"); + if ($out->{"exit"} eq 0) { + foreach my $line (split (/\n/,$out->{"stdout"} || "")) { + y2debug ("line: $line"); + if ($line !~ m/^;/) { + $ldap_server = (split (/[ \t]/, $line))[3] || "."; + chop $ldap_server; + y2debug ("proposed LDAP server '$ldap_server'"); + } + last if $ldap_server ne ""; } - last if $ldap_server ne ""; } if ($ldap_server ne "") { @@ -1239,17 +1251,19 @@ } # check if AD server is available - $out = SCR->Execute (".target.bash_output", "dig _ldap._tcp.dc._msdcs.$domain SRV +short"); + $out = SCR->Execute (".target.bash_output", "dig '_ldap._tcp.dc._msdcs.$domain' SRV +short"); y2debug ("dig output: ", Dumper ($out)); my $ad_server = ""; - foreach my $line (split (/\n/,$out->{"stdout"} || "")) { - y2debug ("line: $line"); - if ($line !~ m/^;/) { - $ad_server = (split (/[ \t]/, $line))[3] || "."; - chop $ad_server; - y2debug ("proposed AD server '$ad_server'"); + if ($out->{"exit"} eq 0) { + foreach my $line (split (/\n/,$out->{"stdout"} || "")) { + y2debug ("line: $line"); + if ($line !~ m/^;/) { + $ad_server = (split (/[ \t]/, $line))[3] || "."; + chop $ad_server; + y2debug ("proposed AD server '$ad_server'"); + } + last if $ad_server ne ""; } - last if $ad_server ne ""; } if ($ad_server ne "") { @@ -1260,7 +1274,7 @@ return 1; } # check for eDirectory now - else { + elsif ($ldap_server) { $out = SCR->Execute (".target.bash_output", "ldapsearch -x -h $ldap_server -s base -b '' vendorName | grep -i '^vendorName: Novell'"); y2debug ("ldapsearch output: ", Dumper ($out)); if ($out->{"exit"} eq 0) { @@ -1270,17 +1284,18 @@ } # Now, check if kerberos is available - $out = SCR->Execute (".target.bash_output", "dig _kerberos._udp.$domain SRV +short"); + $out = SCR->Execute (".target.bash_output", "dig '_kerberos._udp.$domain' SRV +short"); y2debug ("dig output: ", Dumper ($out)); my $kdc = ""; - foreach my $line (split (/\n/,$out->{"stdout"} || "")) { - - y2debug ("line: $line"); - if ($line !~ m/^;/) { - $kdc = (split (/[ \t]/, $line))[3] || "."; - chop $kdc; + if ($out->{"exit"} eq 0) { + foreach my $line (split (/\n/,$out->{"stdout"} || "")) { + y2debug ("line: $line"); + if ($line !~ m/^;/) { + $kdc = (split (/[ \t]/, $line))[3] || "."; + chop $kdc; + } + last if $kdc ne ""; } - last if $kdc ne ""; } if ($kdc ne "" && $ldap_server ne "") { -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org