ROOTPLOIT
Server: LiteSpeed
System: Linux in-mum-web1878.main-hosting.eu 5.14.0-570.21.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 11 07:22:35 EDT 2025 x86_64
User: u435929562 (435929562)
PHP: 7.4.33
Disabled: system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //lib/rpm/cmake.req
#!/usr/bin/python3
# -*- coding:utf-8 -*-
#
# Copyright (C) 2017 Björn Esser <[email protected]>
#
# based on cmake.prov, which is
# Copyright (C) 2015 Daniel Vrátil <[email protected]>
# Copyright (C) 2017 Daniel Vrátil <[email protected]>
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this program; if not, write to the
# Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
#

import sys
import re
import subprocess

class CMakeParser:
    def __init__(self, filelist = None):
        if filelist == None:
            filelist = sys.stdin

        has_module = False
        is_arched = False

        isa_suf = subprocess.check_output(["/usr/bin/rpm", "-E %{?_isa}"]).decode().strip()

        paths = map(lambda x: x.rstrip(), filelist.readlines())
        for path in paths:
            modulePath, cmakeModule, lowercase = self.parseCmakeModuleConfig(path)
            if modulePath and cmakeModule:
                has_module = True
                if re.match(".*/usr/lib(64)?/cmake/.*", modulePath):
                    is_arched = True

        if has_module:
            if is_arched:
                print("cmake-filesystem%s" % isa_suf)
            else:
                print("cmake-filesystem")


    def parseCmakeModuleConfig(self, configFile):
        paths = configFile.rsplit("/", 3)

        modulePath = "%s/cmake/%s" % (paths[0], paths[2])
        cfgFile = paths[3]
        if cfgFile.endswith("Config.cmake"):
           return (modulePath, cfgFile[0:-len("Config.cmake")], False)
        elif cfgFile.endswith("-config.cmake"):
           return (modulePath, cfgFile[0:-len("-config.cmake")], True)
        else:
            return (None, None, False)


if __name__ == "__main__":
    parser = CMakeParser()