PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB` #!/usr/local/cpanel/3rdparty/bin/perl # cpanel - scripts/convert_accesshash_to_token Copyright 2022 cPanel, L.L.C. # All rights reserved. # copyright@cpanel.net http://cpanel.net # This code is subject to the cPanel license. Unauthorized copying is prohibited use strict; use warnings; use File::Basename (); use Getopt::Long (); use Cpanel::Rand::Get (); use Cpanel::ResellerFunctions (); use Cpanel::SafeFile (); use Cpanel::ConfigFiles (); use Cpanel::Security::Authn::APITokens::Write::whostmgr (); use Whostmgr::AccessHash (); use Digest::SHA (); exit _main(@ARGV) unless caller; sub _main { my @args = @_; unless ( $> == 0 && $< == 0 ) { return bail_out('error: This program can only be run by root!'); } Getopt::Long::GetOptionsFromArray( \@args, 'help|?' => \my $print_help, 'verbose' => \my $verbose, 'all-resellers' => \my $all_resellers, ) || return bail_out('Invalid usage. See --help'); return print_help() if $print_help; $ENV{'REMOTE_USER'} = 'root'; my @users = @args; @users = Cpanel::ResellerFunctions::getresellerslist() if $all_resellers; @users = ( $ENV{'REMOTE_USER'} ) if !@users; foreach my $user (@users) { my $details = eval { import_accesshash($user) }; if ($@) { next if $@ =~ m/^No accesshash exists for/; print STDERR "error: $user: $@"; } elsif ($verbose) { print "Imported accesshash for “$user” as “$details->{name}”\n"; } } return 0; } sub _update_accounting_log { my ( $action, $token_name ) = @_; my $acctlog = Cpanel::SafeFile::safeopen( my $accounting_log_fh, '>>', $Cpanel::ConfigFiles::ACCOUNTING_LOG_FILE ); if ( !$acctlog ) { logger->warn("Could not write to /var/cpanel/accounting.log"); } else { chmod 0600, $Cpanel::ConfigFiles::ACCOUNTING_LOG_FILE; # The accounting log format is: #