|
|
Author: jvdias
Update of /cvs/dist/rpms/bind/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv28522
Modified Files:
bind.spec
Added Files:
namedGetForwarders
Log Message:
script to retrieve forwarders from named with D-BUS
--- NEW FILE namedGetForwarders ---
#!/usr/bin/perl
#
# This script uses the named D-BUS support, which must be enabled in
# the running named with the named '-D' option, to get and print the
# list of forwarding zones in the running server.
#
# It accepts an optional <zone> first argument which is the DNS name
# of the zone whose forwarders (if any) will be retrieved.
#
# If no zone argument is specified, all forwarding zones will be listed.
#
# Usage: GetForwarders [-n -r] [ <zone> ]
# -n : output forward zone statements for named.conf
# -r : output in resolv.conf format
# : no -r or -n: just list the forwarders
#
# Copyright(C) Jason Vas Dias<jvdias@xxxxxxxxxx> Red Hat Inc. 2005
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation at
# http://www.fsf.org/licensing/licenses/gpl.txt
# and included in this software distribution as the "LICENSE" file.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
use Getopt::Std;
%opts=();
getopts("rn",\%opts);
$zone = '';
if ( $#ARGV >= 0 )
{
$zone = "string:'". join("' string:'",@ARGV)."'";
};
@dn=();
open(DNS,
'/usr/bin/dbus-send --system --type=method_call --print-reply
--reply-timeout=20000 '
.'--dest=com.redhat.named /com/redhat/named
com.redhat.named.text.GetForwarders '
.$zone .'|'
) || die("dbus-send failed: $?: $!");
while(<DNS>)
{
$_=~s/[\s\r\n]+$//;
if ( /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/ )
{ # nameserver address
push @{${$dn[-1]}{'s'}}, { 'a' => "$1.$2.$3.$4" };
}elsif
( /\"(\d+)\"$/ )
{ # port
if ( $1 != 53 )
{
${@{${$dn[-1]}{'s'}}[-1]}{'p'} = $1;
};
}elsif
( /string\s+\"([^\"]+)\"$/ )
{
if ( ($1 eq 'first') || ($1 eq 'only') )
{ # policy
if( $1 eq 'only' )
{ # not default
${$dn[-1]}{'o'} = 1;
}
}else
{ # new DN - "zone"
push @dn, {'n'=>$1,'s'=>[]};
};
};
};
close(DNS);
if( exists($opts{'r'}) )
{ # resolv.conf style:
my %svrs=();
print 'search ',
join( ' ',
grep { !( $_ =~ /\.in-addr\.arpa$/) }
map { ${$_}{'n'} }
@dn
),"\n",
'nameserver ',
join( "\nnameserver ",
grep { exists ( $svrs{ $_ } ) ? undef : { $svrs{$_}=$_ } }
map { ${$_}{'a'} }
map { @{${$_}{'s'}} } @dn
),"\n";
}elsif( exists($opts{'n'}) )
{ # named.conf style:
foreach $d (@dn)
{
print 'zone "',${$d}{'n'},'." IN { type forward; forwarders { ',
join("; ",
map { exists( ${$_}{'p'} )
? ${$_}{'a'} . ' port ' . ${$_}{'p'}
: ${$_}{'a'}
} @{${$d}{'s'}}
),
'; }; ',
exists(${$d}{'o'}) ? ' forward only; ' : '',
"};\n";
};
}else
{ # just list:
foreach $d (@dn)
{
print ${$d}{'n'}, "\n\t",
(exists(${$d}{'o'}) ? "forward only\n\t" : ''),
join( "\n\t",
map { exists( ${$_}{'p'} )
? ${$_}{'a'} . ':' . ${$_}{'p'}
: ${$_}{'a'}
} @{${$d}{'s'}}
),"\n";
};
};
Index: bind.spec
===================================================================
RCS file: /cvs/dist/rpms/bind/devel/bind.spec,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -r1.76 -r1.77
--- bind.spec 8 Nov 2005 20:58:46 -0000 1.76
+++ bind.spec 13 Nov 2005 19:40:07 -0000 1.77
@@ -10,7 +10,7 @@
Name: bind
License: BSD-like
Version: 9.3.1
-Release: 21
+Release: 22
Epoch: 24
Url: http://www.isc.org/products/BIND/
Buildroot: %{_tmppath}/%{name}-root
@@ -724,6 +724,11 @@
:;
%changelog
+* Sun Nov 13 2005 Jason Vas Dias <jvdias@xxxxxxxxxx> - 24:9.3.1-22
+- fix bug 172632 - remove .la files
+- ship namedGetForwarders and namedSetForwarders scripts
+- fix detection of -D option in chroot
+
* Tue Nov 8 2005 Tomas Mraz <tmraz@xxxxxxxxxx> - 24:9.3.1-21
- rebuilt with new openssl
--
fedora-cvs-commits mailing list
fedora-cvs-commits@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-cvs-commits
|
|