[yast-commit] r59753 - in /branches/SuSE-SLE-10-SP3-Branch/dns-server: VERSION agents/ag_convert_named_conf package/yast2-dns-server.changes src/DnsZones.pm
Author: locilka Date: Wed Nov 25 10:40:16 2009 New Revision: 59753 URL: http://svn.opensuse.org/viewcvs/yast?rev=59753&view=rev Log: - Enhanced agent for transforming user-defined named.conf to understand zone definition without 'in' (#266717). - DNS zones need a FQDN hostname, using /etc/HOSTNAME as a fallback when hostname --fqdn returns empty string (bnc #403468). - 2.13.24 Modified: branches/SuSE-SLE-10-SP3-Branch/dns-server/VERSION branches/SuSE-SLE-10-SP3-Branch/dns-server/agents/ag_convert_named_conf branches/SuSE-SLE-10-SP3-Branch/dns-server/package/yast2-dns-server.changes branches/SuSE-SLE-10-SP3-Branch/dns-server/src/DnsZones.pm Modified: branches/SuSE-SLE-10-SP3-Branch/dns-server/VERSION URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP3-Branch/dns-server/VERSION?rev=59753&r1=59752&r2=59753&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP3-Branch/dns-server/VERSION (original) +++ branches/SuSE-SLE-10-SP3-Branch/dns-server/VERSION Wed Nov 25 10:40:16 2009 @@ -1 +1 @@ -2.13.23 +2.13.24 Modified: branches/SuSE-SLE-10-SP3-Branch/dns-server/agents/ag_convert_named_conf URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP3-Branch/dns-server/agents/ag_convert_named_conf?rev=59753&r1=59752&r2=59753&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP3-Branch/dns-server/agents/ag_convert_named_conf (original) +++ branches/SuSE-SLE-10-SP3-Branch/dns-server/agents/ag_convert_named_conf Wed Nov 25 10:40:16 2009 @@ -24,7 +24,8 @@ # convert the file content to the IniAgent-understandable format $file_content =~ s/(options|view|logging)[ \t\n]*\{/$1 {/g; - $file_content =~ s/(zone)[ \t\n]*([^ \t\n]+)[ \t\n]*([^ \t\n]+)[ \t\n]*\{/$1 $2 $3 {/g; + # zone "zone.name" in { ("in" is not necessary) + $file_content =~ s/(zone)[ \t\n]*([^ \t\n]+)([ \t\n]+in)?[ \t\n]*\{/$1 $2 in {/gi; if ($file_content ne $file_content_backup) { my $backup_file = $file.'.YaST-backup'; Modified: branches/SuSE-SLE-10-SP3-Branch/dns-server/package/yast2-dns-server.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP3-Branch/dns-server/package/yast2-dns-server.changes?rev=59753&r1=59752&r2=59753&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP3-Branch/dns-server/package/yast2-dns-server.changes (original) +++ branches/SuSE-SLE-10-SP3-Branch/dns-server/package/yast2-dns-server.changes Wed Nov 25 10:40:16 2009 @@ -1,4 +1,13 @@ ------------------------------------------------------------------- +Wed Nov 25 10:34:29 CET 2009 - locilka@suse.cz + +- Enhanced agent for transforming user-defined named.conf to + understand zone definition without 'in' (#266717). +- DNS zones need a FQDN hostname, using /etc/HOSTNAME as a fallback + when hostname --fqdn returns empty string (bnc #403468). +- 2.13.24 + +------------------------------------------------------------------- Tue Jan 16 13:05:47 CET 2007 - locilka@suse.cz - Adding X-SuSE-YaST-AutoInstSchema entry into the application Modified: branches/SuSE-SLE-10-SP3-Branch/dns-server/src/DnsZones.pm URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP3-Branch/dns-server/src/DnsZones.pm?rev=59753&r1=59752&r2=59753&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP3-Branch/dns-server/src/DnsZones.pm (original) +++ branches/SuSE-SLE-10-SP3-Branch/dns-server/src/DnsZones.pm Wed Nov 25 10:40:16 2009 @@ -55,13 +55,25 @@ my $self = shift; my $out = SCR->Execute (".target.bash_output", "/bin/hostname --fqdn"); - if ($out->{"exit"} ne 0) - { - return "@"; + + if (Mode->test()) { + return ""; + } + + # standard return + if ($out->{"exit"} eq "0") { + my $stdout = $out->{"stdout"}; + my ($ret, $rest) = split ("\n", $stdout, 2); + + return $ret; + # fallback + } else { + my $hostname = SCR->Read (".target.string", "/etc/HOSTNAME"); + my ($ret, $rest) = split ("\n", $hostname, 2); + y2warning ("Using fallback hostname: ".$ret); + + return $ret; } - my $stdout = $out->{"stdout"}; - my ($ret, $rest) = split ("\n", $stdout, 2); - return $ret; } BEGIN { $TYPEINFO{AbsoluteZoneFileName} = ["function", "string", "string" ]; } @@ -126,7 +138,11 @@ sub GetDefaultSOA { my $self = shift; - my $fqdn = $self->GetFQDN (); + my $fqdn = $self->GetFQDN(); + if ($fqdn eq "") { + $fqdn = "linux.site"; + } + $fqdn = "$fqdn."; my $adm_mail = "root.$fqdn"; my %soa = ( -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
locilka@svn.opensuse.org