HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, 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_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //usr/lib/needrestart/vmlinuz-get-version
#!/bin/sh

# ----------------------------------------------------------------------
# This file was taken from the Linux kernel source tree (scripts/extract-vmlinux)
# and has been adopted for the use within needrestart.
#
# extract-vmlinux - Extract uncompressed vmlinux from a kernel image
#
# Inspired from extract-ikconfig
# (c) 2009,2010    Dick Streefland <dick@streefland.net>
#
# (c) 2011         Corentin Chary <corentin.chary@gmail.com>
#
# Adopted for needrestart
# (c) 2016 - 2017  Thomas Liske <liske@ibh.de>
#
# Licensed under the GNU General Public License, version 2 (GPLv2).
# ----------------------------------------------------------------------

get_version()
{
    # search and output version string pattern
    strings "$1" | grep -m 1 '^Linux version ' && exit 0
}

try_decompress()
{
    # The obscure use of the "tr" filter is to work around older versions of
    # "grep" that report the byte offset of the line instead of the pattern.

    # Try to find the header ($1) and decompress from here
    for	pos in `tr "$1\n$2" "\n$2=" < "$img" | grep -abo "^$2"`
    do
	pos=${pos%%:*}
	tail -c+$pos "$img" | $3 > $tmp 2> /dev/null
	get_version $tmp
    done
}

# Check invocation:
me=${0##*/}
img=$1
if	[ $# -lt 1 -o $# -gt 2  -o ! -s "$img" ]
then
    echo "Usage: $me <kernel-image> [debug]" >&2
    exit 2
fi

if [ "$2" = "1" ]; then
    set -x
fi

# Prepare temp files:
tmp=$(mktemp)
trap "rm -f $tmp" 0

# Initial attempt for uncompressed images or objects:
get_version $img

# That didn't work, so retry after decompression.
which gunzip  > /dev/null && try_decompress '\037\213\010' xy    gunzip
which unxz    > /dev/null && try_decompress '\3757zXZ\000' abcde unxz
which bunzip2 > /dev/null && try_decompress 'BZh'          xy    bunzip2
which unlzma  > /dev/null && try_decompress '\135\0\0\0'   xxx   unlzma
which lzop    > /dev/null && try_decompress '\211\114\132' xy    'lzop -d'