Server IP : 103.119.228.120 / Your IP : 18.218.190.118 Web Server : Apache System : Linux v8.techscape8.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64 User : nobody ( 99) PHP Version : 5.6.40 Disable Function : shell_exec,symlink,system,exec,proc_get_status,proc_nice,proc_terminate,define_syslog_variables,syslog,openlog,closelog,escapeshellcmd,passthru,ocinum cols,ini_alter,leak,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dl,dll,myshellexec,proc_open,socket_bind,proc_close,escapeshellarg,parse_ini_filepopen,fpassthru,exec,passthru,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,popen,show_source,proc_nice,proc_terminate,proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,dl,symlink,shell_exec,system,dl,passthru,escapeshellarg,escapeshellcmd,myshellexec,c99_buff_prepare,c99_sess_put,fpassthru,getdisfunc,fx29exec,fx29exec2,is_windows,disp_freespace,fx29sh_getupdate,fx29_buff_prepare,fx29_sess_put,fx29shexit,fx29fsearch,fx29ftpbrutecheck,fx29sh_tools,fx29sh_about,milw0rm,imagez,sh_name,myshellexec,checkproxyhost,dosyayicek,c99_buff_prepare,c99_sess_put,c99getsource,c99sh_getupdate,c99fsearch,c99shexit,view_perms,posix_getpwuid,posix_getgrgid,posix_kill,parse_perms,parsesort,view_perms_color,set_encoder_input,ls_setcheckboxall,ls_reverse_all,rsg_read,rsg_glob,selfURL,dispsecinfo,unix2DosTime,addFile,system,get_users,view_size,DirFiles,DirFilesWide,DirPrintHTMLHeaders,GetFilesTotal,GetTitles,GetTimeTotal,GetMatchesCount,GetFileMatchesCount,GetResultFiles,fs_copy_dir,fs_copy_obj,fs_move_dir,fs_move_obj,fs_rmdir,SearchText,getmicrotime MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /scripts/ |
Upload File : |
#!/usr/bin/perl # cpanel - scripts/cpan_config 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 BEGIN { unshift @INC, '/usr/local/cpanel'; } use strict; use warnings; # DO NOT REMOVE. NEEDED FOR PATH LOOKUP use Cpanel::CleanINC (); use Cpanel::cPCPAN (); use Cpanel::cPCPAN::Config (); if ( $> != 0 ) { die "Unable to set system CPAN::Config. Permission denied.\n"; } my $cpanbasedir = '/home'; my $cpan = { 'basedir' => $cpanbasedir }; my $cpan_config = Cpanel::cPCPAN::fetch_config($cpan); my $path = $INC{'warnings.pm'}; $path =~ s/\/warnings\.pm$//; if ( !-e $path . '/CPAN' ) { mkdir $path . '/CPAN'; } my $cpan_config_file = $path . '/CPAN/Config.pm'; my $now = time; if ( -e $cpan_config_file ) { rename $cpan_config_file, $cpan_config_file . '.' . $now or die "Unable to archive $cpan_config_file: $!"; print "Existing $cpan_config_file archived as ${cpan_config_file}.${now}\n"; } if ( open my $conf_fh, '>', $cpan_config_file ) { my $localtime = localtime($now); print {$conf_fh} <<"EOM"; # This CPAN::Config was automatically generated using /usr/local/cpanel/scripts/cpan_config # at $localtime # # If this Config.pm replaced an existing version, then it would be located at: # ${cpan_config_file}.${now} # This is CPAN.pm's systemwide configuration file. This file provides # defaults for users, and the values can be changed in a per-user # configuration file. EOM print {$conf_fh} qq{\$CPAN::Config = \{\n}; foreach my $key ( sort keys %{$cpan_config} ) { print {$conf_fh} " '$key' => ", neatvalue( $cpan_config->{$key} ), ",\n"; } print {$conf_fh} "};\n1;\n__END__\n"; close $conf_fh; } # stolen from MakeMaker; not taking the original because it is buggy; # bugreport will have to say: keys of hashes remain unquoted and can # produce syntax errors sub neatvalue { my ($value) = @_; return 'undef' unless defined $value; my $ref_type = ref $value; unless ($ref_type) { $value =~ s/\\/\\\\/g; return "q[$value]"; } if ( $ref_type eq 'ARRAY' ) { my ( @m, @neat ); push @m, '['; foreach my $elem (@$value) { push @neat, "q[$elem]"; } push @m, join ', ', @neat; push @m, ']'; return join '', @m; } return "$value" unless $ref_type eq 'HASH'; my ( @m, $key, $val ); while ( ( $key, $val ) = each %$value ) { last unless defined $key; # cautious programming in case (undef,undef) is true push( @m, "q[$key]=>" . neatvalue($val) ); } return '{ ' . join( ', ', @m ) . ' }'; }