!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/7.3.33 

uname -a: Linux acloudg.aryanict.com 4.18.0-513.9.1.lve.el8.x86_64 #1 SMP Mon Dec 4 15:01:22 UTC
2023 x86_64
 

uid=1095(katebhospital) gid=1098(katebhospital) groups=1098(katebhospital) 

Safe-mode: OFF (not secure)

/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/cxx_supportlib/SystemTools/   drwxr-xr-x
Free 290.17 GB of 429.69 GB (67.53%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     ContainerHelpers.h (1.96 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/*
 *  Phusion Passenger - https://www.phusionpassenger.com/
 *  Copyright (c) 2018 Phusion Holding B.V.
 *
 *  "Passenger", "Phusion Passenger" and "Union Station" are registered
 *  trademarks of Phusion Holding B.V.
 *
 *  See LICENSE file for license information.
 */
#ifndef _PASSENGER_SYSTEM_TOOLS_CONTAINER_HELPERS_H_
#define _PASSENGER_SYSTEM_TOOLS_CONTAINER_HELPERS_H_

#include <unistd.h>
#include <boost/predef.h>
#include <FileTools/FileManip.h>
#include <StrIntTools/StrIntUtils.h>

namespace Passenger {

using namespace std;


// adapted from https://github.com/systemd/systemd/blob/042ca/src/basic/virt.c
// separate function to keep as similar to source as possible for easier updates
inline bool
_linuxAutoDetectInContainer() {
    // https://github.com/moby/moby/issues/26102#issuecomment-253621560
    if (fileExists("/.dockerenv")) {
        return true;
    }

    if (fileExists("/proc/vz") && !fileExists("/proc/bc")) {
        return true;
    }

    const char *env = getenv("container");
    if (env != NULL) {
        return (*env != '\0');
    }

    if (fileExists("/run/systemd/container")) {
        string file = unsafeReadFile("/run/systemd/container");
        return (file.length() > 0);
    }

    if (geteuid() == 0) {
        if (fileExists("/proc/1/environ")) {
            string file = unsafeReadFile("/proc/1/environ");
            if (file.size() > 0) {
                vector<string> v;
                split(file,'\0', v);
                for(vector<string>::iterator it = v.begin(); it != v.end(); ++it) {
                    if (startsWith(*it, "container=")) {
                        return true;
                    }
                }
            }
        }

        if (fileExists("/proc/1/sched")) {
            string file = unsafeReadFile("/proc/1/sched");
            if (file.length() > 0) {
                const char t = file[0];
                if (t == '\0') {
                    return false;
                }

                if (!startsWith(file, "(1,")) {
                    return true;
                }
            }
        }
    }
    return false;
}

inline bool
autoDetectInContainer() {
    #if BOOST_OS_LINUX
        return _linuxAutoDetectInContainer();
    #else
        return false;
    #endif
}


} // namespace Passenger

#endif /* _PASSENGER_SYSTEM_TOOLS_CONTAINER_HELPERS_H_ */

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0918 ]--