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/setpostgresconfig

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

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

#----------------------------------------------------------------------
# XXX XXX IMPORTANT!! XXX XXX
#
# This modulino is loaded and run as a module in at least one place.
# Do NOT add exit() to this code!
#----------------------------------------------------------------------

package scripts::setpostgresconfig;

use strict;
use warnings;

use Whostmgr::Postgres            ();
use Cpanel::PwCache               ();
use Cpanel::FileUtils::TouchFile  ();
use Cpanel::PostgresAdmin         ();
use Cpanel::PostgresUtils         ();
use Cpanel::PostgresUtils::PgPass ();
use Cpanel::Postgres::Connect     ();    # PPI USE OK -- This binary always needs to so ok perlcc ahead of time
use Cpanel::Config::Users         ();
use Cpanel::Usage                 ();
use Cpanel::SafeFile              ();

exit( run(@ARGV) ) unless caller();

my $dryrun  = 0;
my $force   = 0;
my $verbose = 0;

sub run {
    my (@argv) = @_;

    my $dryrun  = 0;
    my $force   = 0;
    my $verbose = 0;

    my %opts = (
        'dryrun'  => \$dryrun,
        'dry-run' => \$dryrun,
        'force'   => \$force,
        'verbose' => \$verbose,
    );

    # ==== init process options
    Cpanel::Usage::wrap_options( \@argv, \&usage, \%opts );
    $verbose = 1 if $dryrun;

    my $setup = scripts::setpostgresconfig->new( dryrun => $dryrun, force => $force, verbose => $verbose );

    return $setup->check() ? 0 : 1;
}

sub new {
    my ( $class, %opts ) = @_;

    return bless {%opts}, $class;
}

sub check {
    my $self = shift;

    my @actions = qw{check_prerequires};
    push @actions, 'check_first_upgrade' unless $self->{force};
    push @actions, qw{update_config fix_users add_lock};

    foreach my $action (@actions) {
        $self->msg("running action $action") if $self->{dryrun};
        my $status = $self->$action();
        return $status unless $status && $status == 1;
    }

    return 1;
}

sub check_prerequires {
    my $self = shift;

    return $self->by("Cannot find postgres version.") unless Whostmgr::Postgres::get_version();
    return $self->by("Cannot find pgsql_data dir.")   unless Cpanel::PostgresUtils::find_pgsql_data();

    if ( $self->{force} && !-e _pg_hba_file() ) {
        my $pg_hba = _pg_hba_file();
        Cpanel::FileUtils::TouchFile::touchfile($pg_hba);
        my $user = Cpanel::PostgresUtils::PgPass::getpostgresuser();
        my ( $uid, $gid ) = ( Cpanel::PwCache::getpwnam($user) )[ 2, 3 ];

        # If we change the uid/gid on the file we need to update Whostmgr::Postgres::update_config
        chown( $uid, $gid, $pg_hba ) or warn "Failed to chown($uid,$gid,$pg_hba): $!";

        # If we change the mode on the file we need to update Whostmgr::Postgres::update_config
        chmod( 0600, $pg_hba ) or warn "Failed to chmod(0600,$pg_hba): $!";

    }

    return $self->by("Cannot find pg_hba.conf.") unless -e _pg_hba_file();

    return 1;
}

sub check_first_upgrade {
    my $self = shift;

    my $cfg;
    my $lock = Cpanel::SafeFile::safeopen( $cfg, '<', _pg_hba_file() );
    return $self->by("cannot read config file") unless $lock;
    my $ok = grep { /^\s*local\s+samerole\s+all/ } (<$cfg>);
    Cpanel::SafeFile::safeclose( $cfg, $lock );
    if ($ok) {
        $self->msg("Nothing todo, configuration looks fine.");

        # solve problem with users having already upgraded to 11.36.1 without the lock file
        $self->add_lock();
        return -1;
    }
    return $self->by("Warning: pg_hba.conf was secured but entries have been removed ( you can run it with --force ).") if !$self->{force} && -e _version_file();

    return 1;
}

sub add_lock {
    return Cpanel::FileUtils::TouchFile::touchfile( _version_file() );
}

sub _version_file {
    return '/var/cpanel/version/pg_hba_conf_secured';
}

sub _pg_hba_file {
    return join( '/', Cpanel::PostgresUtils::find_pgsql_data(), 'pg_hba.conf' );
}

sub usage {
    my $prog = $0;
    $prog =~ s{^.+/(.+)$}{$1};
    print <<EOF;
$prog [options] [ -f FILE ]

This script will improve postgres security :
    - update pg_hba.conf
    - create role foreach database
    - grant users to roles

Modifiers Flags:

    --force     - force to update config.
    --verbose   - display some friendly verbose messages.
    --dry-run   - do nothing and display some verbose messages.
    --help      - dislay this help message and exit.
EOF
    exit;

}

sub update_config {
    my $self = shift;

    my $dryrun = $self->{dryrun};

    $self->msg( "-", $dryrun ? 'will' : '', "update postgres configuration" );
    $self->msg("\tnothing done [dryrun]") and return if $dryrun;
    my ( $status, $message ) = Whostmgr::Postgres::update_config();
    $self->by("Cannot update postgres config") unless $status;
    $self->msg($message) if $message;
    return Whostmgr::Postgres::reload();
}

sub fix_users {
    my $self = shift;

    my $postgresadmin = Cpanel::PostgresAdmin->new( { 'cpuser' => 'root' } );

    return 0 if !$postgresadmin;

    foreach my $cpuser ( Cpanel::Config::Users::getcpusers() ) {
        local $postgresadmin->{'cpuser'} = $cpuser;

        $postgresadmin->clear_map();
        my @dbs = $postgresadmin->listdbs();
        next unless scalar @dbs;
        $postgresadmin->setupdbrole( \@dbs );

        my %dbusers = $postgresadmin->listusersindb();

        foreach my $db ( keys %dbusers ) {
            foreach my $user ( @{ $dbusers{$db} } ) {
                $self->msg( '-', $dryrun ? 'will' : '', 'repair access to', $db, 'for user', $user );
                next if $dryrun;
                $postgresadmin->addusertodb( $db, $user, 1 );
            }
        }
    }
    return 1;
}

sub msg {
    my ( $self, @msg ) = @_;
    print join( ' ', @msg, "\n" ) if $self->{verbose};
    return;
}

sub by {
    my ( $self, @msg ) = @_;
    $self->msg(@msg);
    return;
}

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