ldap/admin/src/scripts/DSCreate.pm.in | 4 ++--
ldap/admin/src/scripts/DSDialogs.pm | 6 +++---
ldap/admin/src/scripts/Migration.pm.in | 2 +-
ldap/admin/src/scripts/Setup.pm.in | 2 +-
ldap/admin/src/scripts/SetupDialogs.pm.in | 4 ++--
5 files changed, 9 insertions(+), 9 deletions(-)
New commits:
commit f5a0f6ac89f87d7e559b1d5c042cac9a921ea16b
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Mon Sep 8 19:19:38 2014 -0400
Ticket 47893 - should use Sys::Hostname instead Net::Domain
Bug Description: hostfqdn function does not always return the correct fqdn.
Sometimes it incorrectly adds ".com" when it should not.
Fix Description: Use Sys::Hostname/hostname() which does return the correct
fqdn.
https://fedorahosted.org/389/ticket/47893
Reviewed by: rmeggins(Thanks!)
diff --git a/ldap/admin/src/scripts/DSCreate.pm.in
b/ldap/admin/src/scripts/DSCreate.pm.in
index 58408c1..2756b85 100644
--- a/ldap/admin/src/scripts/DSCreate.pm.in
+++ b/ldap/admin/src/scripts/DSCreate.pm.in
@@ -48,7 +48,7 @@ use DSUtil;
use Inf;
use FileConn;
-use Net::Domain qw(hostfqdn);
+use Sys::Hostname;
# tempfiles
use File::Temp qw(tempfile tempdir);
use File::Path;
@@ -820,7 +820,7 @@ sub setDefaults {
}
if (!$inf->{General}->{FullMachineName}) {
- $inf->{General}->{FullMachineName} = hostfqdn;
+ $inf->{General}->{FullMachineName} = hostname();
}
if (!$inf->{General}->{SuiteSpotUserID}) {
diff --git a/ldap/admin/src/scripts/DSDialogs.pm b/ldap/admin/src/scripts/DSDialogs.pm
index 00765e0..3cc8754 100644
--- a/ldap/admin/src/scripts/DSDialogs.pm
+++ b/ldap/admin/src/scripts/DSDialogs.pm
@@ -40,7 +40,7 @@ package DSDialogs;
use strict;
-use Net::Domain qw(hostname hostfqdn);
+use Sys::Hostname;
use DialogManager;
use Setup;
use Dialog;
@@ -86,7 +86,7 @@ my $dsserverid = new Dialog (
if (!defined($serverid)) {
$serverid =
$self->{manager}->{inf}->{General}->{FullMachineName};
if (!defined($serverid)) {
- $serverid = hostfqdn;
+ $serverid = hostname();
}
# strip out the leftmost domain component
$serverid =~ s/\..*$//;
@@ -124,7 +124,7 @@ my $dssuffix = new Dialog (
if (!defined($suffix)) {
$suffix = $self->{manager}->{inf}->{General}->{FullMachineName};
if (!defined($suffix)) {
- $suffix = hostfqdn;
+ $suffix = hostname();
}
$suffix =~ s/^[^\.]*\.//; # just the domain part
# convert fqdn to dc= domain components
diff --git a/ldap/admin/src/scripts/Migration.pm.in
b/ldap/admin/src/scripts/Migration.pm.in
index 42a92c1..0f0968a 100644
--- a/ldap/admin/src/scripts/Migration.pm.in
+++ b/ldap/admin/src/scripts/Migration.pm.in
@@ -55,7 +55,7 @@ use Exporter ();
@EXPORT_OK = qw();
# hostname
-use Net::Domain qw(hostfqdn);
+use Sys::Hostname;
# load perldap
use Mozilla::LDAP::Conn;
diff --git a/ldap/admin/src/scripts/Setup.pm.in b/ldap/admin/src/scripts/Setup.pm.in
index e154367..51f7710 100644
--- a/ldap/admin/src/scripts/Setup.pm.in
+++ b/ldap/admin/src/scripts/Setup.pm.in
@@ -53,7 +53,7 @@ use Exporter ();
@EXPORT_OK = qw($SILENT $EXPRESS $TYPICAL $CUSTOM);
# hostname
-use Net::Domain qw(hostfqdn);
+use Sys::Hostname; # hostname()
# load perldap
use Mozilla::LDAP::Conn;
diff --git a/ldap/admin/src/scripts/SetupDialogs.pm.in
b/ldap/admin/src/scripts/SetupDialogs.pm.in
index ee2838d..de41eda 100644
--- a/ldap/admin/src/scripts/SetupDialogs.pm.in
+++ b/ldap/admin/src/scripts/SetupDialogs.pm.in
@@ -43,7 +43,7 @@ use strict;
use DialogManager;
use Setup;
use Dialog;
-use Net::Domain qw(hostfqdn);
+use Sys::Hostname;
use DSUtil;
my $welcome = new DialogYesNo (
@@ -112,7 +112,7 @@ my $hostdlg = new Dialog (
sub {
my $self = shift;
return $self->{manager}->{inf}->{General}->{FullMachineName} ||
- hostfqdn;
+ hostname();
},
sub {
my $self = shift;