Ganteng Doang Upload Shell Gak Bisa


Linux server.jmdstrack.com 3.10.0-1160.119.1.el7.tuxcare.els10.x86_64 #1 SMP Fri Oct 11 21:40:41 UTC 2024 x86_64
/ scripts/

//scripts/migrate_local_ini_to_php_ini

#!/usr/local/cpanel/3rdparty/bin/perl

# cpanel - scripts/migrate_local_ini_to_php_ini    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

package scripts::migrate_local_ini_to_php_ini;

use strict;
use warnings;
use Try::Tiny;
use Getopt::Param::Tiny      ();
use Cpanel::ProgLang         ();
use Cpanel::FileUtils::Write ();
use Cpanel::LoadFile         ();

my %ignore_directives = (
    "session.bug_compat_42"     => 1,
    "sybct.allow_persistent"    => 1,
    "sybct.max_links"           => 1,
    "sybct.min_client_severity" => 1,
    "session.bug_compat_warn"   => 1,
    "sybct.min_server_severity" => 1,
    "sybct.max_persistent"      => 1,
    "ifx.default_host"          => 1,
    "ifx.default_user"          => 1,
    "ifx.default_password"      => 1,
    "ifx.allow_persistent"      => 1,
    "ifx.max_persistent"        => 1,
    "ifx.max_links"             => 1,
    "ifx.textasvarchar"         => 1,
    "ifx.byteasvarchar"         => 1,
    "ifx.charasvarchar"         => 1,
    "ifx.blobinfile"            => 1,
    "ifx.nullformat"            => 1,
);

exit( run(@ARGV) ? 0 : 1 ) unless caller;

sub run {
    my @args = @_;

    my $prm = Getopt::Param::Tiny->new( { array_ref => \@args, help_coderef => \&_help, known_only => [ 'run', 'verbose' ], no_args_help => 1, validate => \&_validate } );

    my $php       = eval { Cpanel::ProgLang->new( type => 'php' ) };
    my @installed = $php ? @{ $php->get_installed_packages() } : ();
    if ( !$php || !@installed ) {
        print "Nothing to do, no PHP packages installed.\n";
        return 1;
    }

    my $error_count = 0;
    for my $php_pkg (@installed) {
        print "Processing $php_pkg …\n";
        my $ini = $php->get_ini( 'package' => $php_pkg );

        my $localini = $ini->get_system_ini('local.ini');
        my $phpini   = $ini->get_default_system_ini();
        if ( !$localini ) {
            print "\tNo local.ini.\n";
        }
        else {
            my $bad_tries = 0;
            my %bad_directives;

          TRY_INI:
            try {
                _migrate_extension_directives( $localini, $phpini );    # See EA-6768 for why this hack is necessary

                my $valid_directive_info_hr  = $ini->get_valid_directive_info();
                my $local_directives_meta_hr = $ini->get_basic_php_directives_from_file( path => $localini, all => 1 );
                my $local_directives_hr      = {
                    map { $_ !~ m/^\s*;/ && !exists $bad_directives{$_} && !exists $ignore_directives{$_} ? ( $_ => $local_directives_meta_hr->{$_}{value} ) : () }
                      keys %{$local_directives_meta_hr}
                };

                for my $k ( keys %{$local_directives_hr} ) {            # Hack to avoid: The PHP directive “…” is not formatted correctly: “O…”.
                    next if !$valid_directive_info_hr->{$k} || !$valid_directive_info_hr->{$k}{type} || ( $valid_directive_info_hr->{$k}{type} ne 'boolean' && $valid_directive_info_hr->{$k}{type} ne 'integer' );

                    $local_directives_hr->{$k} = 0 if $local_directives_hr->{$k} =~ m/^off$/i;
                    $local_directives_hr->{$k} = 1 if $local_directives_hr->{$k} =~ m/^on$/i;
                }
                if ( keys %{$local_directives_hr} > 0 ) {
                    $ini->set_directives( path => $phpini, directives => $local_directives_hr );
                }

                unlink $localini;                                       # TODO/YAGNI? move it to $localini.migrated_to_php.ini_on_$rfc8601_datetimestamp
                print "\tMigrated $localini to $phpini.\n";
            }
            catch {
                my $err = $_;

                my $try_again = 0;
                for my $excp (
                    $err,
                    ( exists $err->{_metadata}{exceptions} ? @{ $err->{_metadata}{exceptions} } : () )    # internals gross, patches welcome …
                ) {
                    my $invalid_param = _get_invalid_param($excp);
                    if ($invalid_param) {
                        $bad_tries++;
                        if ( $bad_tries < 6 ) {
                            warn "\tIgnoring invalid directive “$invalid_param”\n";
                            $bad_directives{$invalid_param}++;
                            $try_again++;
                        }
                    }
                }
                goto TRY_INI if $try_again;

                $error_count++;
                warn "\tFailed to migrate $localini to $phpini. This will need done manually.\n";
                if ( $prm->param('verbose') ) {
                    my $err_str = ref($err) ? $err->to_string() : $err;
                    $err_str =~ s/^Error #/\t\tError #/mg;
                    print "\tError: $err_str\n";
                }
            }
        }

        print " … done!\n";
    }

    return if $error_count;
    return 1;
}

###############
#### helpers ##
###############

sub _get_invalid_param {
    my ($excp) = @_;

    my $excp_rt = ref($excp) || '';
    if ( $excp_rt eq 'Cpanel::Exception::InvalidParameter' ) {
        return $excp->{_mt_args}[1];    # internals gross, patches welcome …
    }
    return;
}

sub _validate {
    my ($prm) = @_;
    if ( !$prm->param('run') ) {
        warn "You must pass --run to indicate you want the script to make the changes to your system.\n";
        return;
    }
    return 1;
}

sub _help {
    my ($prm) = @_;

    print <<"END_HELP";
Usage: $0 --run

Migrate each installed PHP’s …/etc/php.d/local.ini to …/etc/php.ini.

This is needed because EasyAapache 4 no longer utilizes local.ini file.

Options:
   --help     this screen
   --run      perform the migration
   --verbose  Enable verbose output
END_HELP
    exit( $prm->param('help') ? 0 : 1 );
}

sub _migrate_extension_directives {    # See EA-6768 for why this hack is necessary
    my ( $localini, $phpini ) = @_;

    # 1. grab all extension directives from $localini
    my @localini_cont = @{ Cpanel::LoadFile::loadfileasarrayref($localini) };    # could get undef if the file disappears after the check that then calls this function and here, in that case an unit warning is OK and not worth making what should be a simple slurp any more complicated than our gross file utils are already making it
    return 1 if !@localini_cont;

    $localini_cont[-1] .= "\n" if substr( $localini_cont[-1], -1, 1 ) ne "\n";    # ensure trailing newline on last line

    my @extensions = grep { m/^\s*extension\s*=/ } @localini_cont;

    if (@extensions) {

        # 2. write them to $phpini
        my @phpini_cont = @{ Cpanel::LoadFile::loadfileasarrayref($phpini) };                                           # see comment above about why checking for undef is not really needed here
        Cpanel::FileUtils::Write::overwrite( $phpini, join( "", @extensions, @phpini_cont ), ( stat($phpini) )[2] );    # yes, it takes a string for the content and if we don't pass the current mode it is re-set to a default /facepalm

        # 3. remove them from $localini
        Cpanel::FileUtils::Write::overwrite( $localini, join( "", grep( !m/\s*extension\s*=/, @localini_cont ) ), ( stat($localini) )[2] );    # yes, it takes a string for the content and if we don't pass the current mode it is re-set to a default /facepalm
    }

    return 1;
}

1;
			
			


Thanks For 0xGh05T - DSRF14 - Mr.Dan07 - Leri01 - FxshX7 - AlkaExploiter - xLoveSyndrome'z - Acep Gans'z

JMDS TRACK – Just Another Diagnostics Lab Site

Home

JMDS TRACK Cameroon

Boost the productivity of your mobile ressources


Make An Appointment


Fleet management

  1. Reduce the operting cost and the unavailability of your vehicles
  2. reduce the fuel consumption of your fleet
  3. Improve the driving dehavior and safety of your drivers
  4. optimize the utilization rate of your equipment 
  5. protect your vehicle against theft
  6. Improve the quality of your customer service


Find out more

Assets management

  1. Track the roaming of your equipment
  2. Optimise the management of your assets on site and during transport
  3. Secure the transport of your goods
  4. Make your team responsible for preventing the loss of tools, equipment
  5. Take a real-time inventory of your equipment on site
  6. Easily find your mobile objects or equipment



Find out more



Find out more

Antitheft solutions

  1. Secure your vehicles and machinery and increase your chances of recovering them in the event of theft
  2. Protect your assets and reduce the costs associated with their loss
  3. Combine immobiliser and driver identification and limit the risk of theft
  4. Identify fuel theft and reduce costs
  5. Protect your goods and take no more risks
  6. Be alerted to abnormal events

Our Location

 Douala BP cité 

     and

Yaoundé Total Essos


Make An Appointment


Get Directions

682230363/ 677481892

What makes us different from others

  • young and dynamic team
  • call center 24/24 7/7
  • roaming throughout Africa
  • team of developers who can develop customer-specific solutions
  • diversity of services
  • reactive and prompt after-sales service when soliciting a customer or a malfunction
  • Free Maintenance and installation in the cities of Douala and Yaounde

https://youtu.be/xI1cz_Jh2x8

15+
years of experience in GPS system development, production and deployment.

15 Collaborators

More than 15 employees dedicated to the research and development of new applications and to customer care

5 000 Vehicles and mobile assets

5 000 vehicles and mobile assets under management, in Africa

Our Partners










Latest Case Studies

Our current projects 

5/5
Bon SAV , SATISFAIT DU TRAITEMENT DES REQUETES

M DIPITA CHRISTIAN
Logistic Safety Manager Road Safety Manager
5/5
La réactivité de JMDS est excellente
Nous restons satisfait dans l’ensemble des prestations relatives a la couverture de notre parc automobile

Hervé Frédéric NDENGUE
Chef Service Adjoint de la Sécurité Générale (CNPS)
5/5
L’APPLICATION EMIXIS est convivial A L’utilisation
BEIG-3 SARL
DIRECTOR GENERAL
5/5
Nevertheless I am delighted with the service
MR. BISSE BENJAMIN
CUSTOMER

Subsribe To Our Newsletter

Stay in touch with us to get latest news and special offers.



Address JMDS TRACK

Douala bp cité



and

YAOUNDE Total Essos

Call Us

+237682230363



Email Us


info@jmdstrack.cm