Ignore:
Timestamp:
02/27/26 16:40:46 (5 hours ago)
Author:
Kris Deugau
Message:

/branches/stable

Rollup merge through r909 for core dnsadmin - excludes BIND export, changes
to auxiliary scripts (compatc-recs.pl, mergerecs.pl, etc)

Location:
branches/stable
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/stable

  • branches/stable/dns-rpc.cgi

    r1037 r1047  
    33##
    44# $Id$
    5 # Copyright 2012-2016 Kris Deugau <kdeugau@deepnet.cx>
     5# Copyright 2012-2016,2020-2025 Kris Deugau <kdeugau@deepnet.cx>
    66#
    77#    This program is free software: you can redistribute it and/or modify
     
    2222use warnings;
    2323
    24 # don't remove!  required for GNU/FHS-ish install from tarball
    25 use lib '.';    ##uselib##
     24# push "the directory the script is in" into @INC
     25use FindBin;
     26use lib "$FindBin::RealBin/";
     27
    2628use DNSDB;
    2729
     
    5052#sub revName {
    5153        'dnsdb.domainID'        => \&domainID,
    52 #sub revID {
     54        'dnsdb.revID'           => \&revID,
    5355        'dnsdb.addRDNS'         => \&addRDNS,
    5456#sub getZoneCount {
     
    372374}
    373375
    374 #sub revID {}
     376=head3 revID
     377
     378Retrieve the ID for a reverse zone
     379
     380=over 4
     381
     382=item revzone
     383
     384The reverse zone to find the ID for, in CIDR form.
     385
     386=back
     387
     388Returns the integer ID of the domain if found.
     389
     390=cut
     391sub revID {
     392  my %args = @_;
     393
     394  _commoncheck(\%args, 'y');
     395
     396  my $revid = $dnsdb->revID($args{revzone}, $args{location});
     397  die $dnsdb->errstr."\n" if !$revid;
     398  return $revid;
     399}
     400
    375401
    376402
     
    16151641  die "Need location\n" if !defined($args{location});
    16161642
     1643  # quick sanity-check version
     1644  die "CIDR is either poorly formed or not an IP/netblock at all\n" if !DNSDB::_maybeip(\$args{cidr});
     1645  my $cidr = new NetAddr::IP $args{cidr};
     1646  die "CIDR is not a valid IP/netblock\n" if !$cidr;
     1647
    16171648  # much like addOrUpdateRevRec()
    16181649  my $zonelist = $dnsdb->getZonesByCIDR(%args);
    1619   my $cidr = new NetAddr::IP $args{cidr};
    16201650
    16211651  if (scalar(@$zonelist) == 0) {
     
    16651695                     ($cidr->masklen != 32 ? "$cidr" : $cidr->addr) );
    16661696        my $reclist = $dnsdb->getRecList(rpc => 1, defrec => 'n', revrec => 'y', location => $args{location},
    1667           id => $zonelist->[0]->{rdns_id}, filter => $filt, sortby => 'val', sortorder => 'DESC');
     1697          id => $zonelist->[0]->{rdns_id}, filter => $filt, sortby => 'val', sortorder => 'DESC', offset => 'all');
    16681698        foreach my $rec (@$reclist) {
    16691699          my $reccidr = new NetAddr::IP $rec->{val};
Note: See TracChangeset for help on using the changeset viewer.