mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Prevent users from running this as root/admin user
This commit is contained in:
parent
4edaba648e
commit
d585a34a26
|
@ -1,6 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
(PHP_SAPI !== 'cli' || isset($_SERVER['HTTP_USER_AGENT'])) && die('Access denied.');
|
(PHP_SAPI !== 'cli' || isset($_SERVER['HTTP_USER_AGENT'])) && die('Access denied.');
|
||||||
|
|
||||||
|
$pwu_data = posix_getpwuid(posix_geteuid());
|
||||||
|
$username = $pwu_data['name'];
|
||||||
|
|
||||||
|
if (($username=='root') || ($username=='admin')) {
|
||||||
|
die("\nERROR: This script should not be run as root/admin. Exiting.\n\n");
|
||||||
|
}
|
||||||
|
|
||||||
echo "Welcome to the Snipe-IT upgrader.\n\n";
|
echo "Welcome to the Snipe-IT upgrader.\n\n";
|
||||||
echo "Please note that this script will not download the latest Snipe-IT \n";
|
echo "Please note that this script will not download the latest Snipe-IT \n";
|
||||||
echo "files for you, it simply runs the standard composer and artisan \n";
|
echo "files for you, it simply runs the standard composer and artisan \n";
|
||||||
|
|
Loading…
Reference in a new issue