disabled
  
   355 c    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
<p>Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body></html>
  	   	0  #   lzd
n-ji@5qnJbѿ  'N    #!/usr/local/cpanel/3rdparty/bin/perl

#                                      Copyright 2024 WebPros International, LLC
#                                                           All rights reserved.
# copyright@cpanel.net                                         http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited.

package scripts::migrate_pdns_conf;

use strict;
use warnings;

use Try::Tiny;

use Pod::Usage               ();
use Getopt::Long             ();
use Cpanel::LoadFile         ();
use Cpanel::Exception        ();
use Cpanel::FileUtils::Write ();
use Cpanel::Rand::Get        ();
use Cpanel::PwCache          ();

my $CONF_FILE = '/etc/pdns/pdns.conf';

exit( __PACKAGE__->script( \@ARGV ) ) unless caller;

sub script {
    my ( $class, $argv ) = @_;

    die Cpanel::Exception::create('RootRequired')->to_string_no_id() unless ( $> == 0 && $< == 0 );
    my $self = bless { 'notify' => 1 }, $class;

    my $help;
    Getopt::Long::GetOptionsFromArray(
        $argv,
        'notify!'    => \$self->{'notify'},
        'dry-run'    => \$self->{'dry-run'},
        'man|help|h' => \$help,
    ) or return Pod::Usage::pod2usage( -exitval => 'NOEXIT', -output => \*STDERR, -verbose => 99, -sections => [qw(NAME DESCRIPTION SYNOPSIS)] );

    # -1 to get the right exit code
    return Pod::Usage::pod2usage( -exitval => 'NOEXIT', -output => \*STDOUT, -verbose => 99, -sections => [qw(NAME DESCRIPTION SYNOPSIS)] ) - 1 if $help;

    return _nofile() unless -e $CONF_FILE;

    my $current_conf = Cpanel::LoadFile::loadfileasarrayref($CONF_FILE);
    my $changes      = $self->migrate_conf($current_conf);
    $changes->{enabled} = $self->enable_settings($current_conf);

    return _nochanges() if !_has_changes($changes);

    _print_changes($changes);
    return 0 if $self->{'dry-run'};

    if ( _overwrite_and_fix_ownership( $CONF_FILE, join( '', @{$current_conf} ) ) ) {
        print "[+] Updated $CONF_FILE successfully\n";
        $self->send_notification($changes)
          if $self->{'notify'};
    }
    else {
        print "[!] Failed to update $CONF_FILE: $!\n";
        return 1;
    }

    return 0;
}

sub migrate_conf {
    my ( $self, $current_conf ) = @_;

    my $changes = {
        'removed' => [],
        'renamed' => [],
        'manual'  => [],
    };

    my @to_remove = qw/
      pipebackend-abi-version
      strict-rfc-axfrs
      send-root-referral
      experimental-lua-policy-script
      allow-recursion
      recursive-cache-ttl
      recursor
      api-readonly
      experimental-api-readonly
      api-logfile
      default-soa-mail
      default-soa-name
      soa-expire-default
      soa-minimum-ttl
      soa-refresh-default
      soa-retry-default
      /;
    my %remove_if_value_starts_with = (
        'local-ipv6' => '::',    #No longer force pdns to bind to ::
    );

    my %renamed = (
        'allow-dns-update-from'       => 'allow-dnsupdate-from',
        'allow-unsigned-supermaster'  => 'allow-unsigned-autoprimary',
        'experimental-json-interface' => 'api',
        'forward-dnsupdates'          => 'forward-dnsupdate',
        'local-ipv6-nonexist-fail'    => 'local-address-nonexist-fail',
        'master'                      => 'primary',
        'slave'                       => 'secondary',
        'slave-cycle-interval'        => 'xfr-cycle-interval',
        'slave-renotify'              => 'secondary-do-renotify',
        'superslave'                  => 'autosecondary',
        ( map { $_ => substr( $_, 0, -1 ) } qw{default-ksk-algorithms default-zsk-algorithms} ),
        ( map { $_ =