Server IP : 13.213.54.232 / Your IP : 216.73.216.192 Web Server : Apache/2.4.52 (Ubuntu) System : Linux ip-172-31-17-110 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 User : www-data ( 33) PHP Version : 7.1.33-67+ubuntu22.04.1+deb.sury.org+1 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /proc/246939/root/snap/lxd/current/bin/ |
Upload File : |
#!/bin/sh run_cmd() { CMD="$1" shift unset LD_LIBRARY_PATH export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" export HOME="${SNAP_REAL_HOME}" export USER="${USERNAME}" [ -z "${XDG_DATA_HOME:-}" ] && export XDG_DATA_HOME="${HOME}/.local/share/" [ -z "${XDG_CONFIG_HOME:-}" ] && export XDG_CONFIG_HOME="${HOME}/.config/" [ -z "${XDG_STATE_HOME:-}" ] && export XDG_STATE_HOME="${HOME}/.local/state/" # shellcheck disable=SC2145 exec unshare --kill-child -U -m -p -r -f -R "/var/lib/snapd/hostfs/" "/bin/sh" -c "mount -t proc proc /proc 2>/dev/null || true; exec \"${CMD}\" \"$@\"" } USERNS=1 [ -e /proc/sys/kernel/unprivileged_userns_clone ] && grep -qxF 0 /proc/sys/kernel/unprivileged_userns_clone && USERNS=0 [ -e /proc/sys/kernel/apparmor_restrict_unprivileged_userns ] && grep -qxF 1 /proc/sys/kernel/apparmor_restrict_unprivileged_userns && USERNS=0 [ -e /proc/sys/kernel/apparmor_restrict_unprivileged_unconfined ] && grep -qxF 1 /proc/sys/kernel/apparmor_restrict_unprivileged_unconfined && USERNS=0 find_and_spawn() { for path in / /usr/ /usr/local/; do if [ -e "/var/lib/snapd/hostfs/${path}bin/${1}" ] || [ -L "/var/lib/snapd/hostfs/${path}bin/${1}" ]; then run_cmd "$@" fi done } EDIT_CMD="${1}" EDIT_PATH="${2}" if [ -z "${EDIT_PATH}" ] || [ "$#" -ge "3" ]; then EDIT_CMD="" for arg in "${@}"; do EDIT_PATH="${arg}" done fi # Try running the editor through the host. if [ -n "${EDIT_CMD}" ] && [ "${USERNS}" = 1 ]; then exec 9< /tmp/ # Replace "/tmp/" prefix by exec'ed FD 9. EDIT_PATH_HOST="/proc/self/fd/9/$(echo "${EDIT_PATH}" | cut -d/ -f3)" find_and_spawn "${EDIT_CMD}" "${EDIT_PATH_HOST}" fi # If the editor's rcfile is not readable, ignore it. EDIT_IGNORE_RC="" EDIT_RESTRICT="" # Default to built-in nano. if [ -z "${EDIT_CMD}" ]; then EDIT_CMD="nano" EDIT_RESTRICT="--restricted" [ -r "${SNAP}/etc/nanorc" ] || EDIT_IGNORE_RC="--ignorercfiles" fi # Setup for VIM. if [ "$EDIT_CMD" != "nano" ]; then # Find the base use by the LXD snap. for vimrc in "${SNAP_USER_COMMON}/.vimrc" "/snap/core20/current/etc/vim/vimrc"; do [ -r "${vimrc}" ] || continue export VIMINIT="source ${vimrc}" done # Ignore vimrc if none was found to be readable. if [ -z "${VIMINIT:-""}" ]; then EDIT_IGNORE_RC="--clean" fi EDIT_CMD="vim.tiny" EDIT_RESTRICT="-Z" fi # Run the editor. exec "${EDIT_CMD}" ${EDIT_RESTRICT} ${EDIT_IGNORE_RC} "${EDIT_PATH}"