1
0
mirror of https://github.com/prasathmani/tinyfilemanager.git synced 2025-05-03 05:47:51 +02:00

Check if posix_getpwuid/posix_getgrgid calls were successful ()

This commit is contained in:
Micha Ober 2023-04-21 06:33:20 +02:00 committed by GitHub
parent 3a90a5916a
commit 85f35bc28f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2051,6 +2051,12 @@ $tableTheme = (FM_THEME == "dark") ? "text-white bg-dark table-dark" : "bg-white
if (function_exists('posix_getpwuid') && function_exists('posix_getgrgid')) {
$owner = posix_getpwuid(fileowner($path . '/' . $f));
$group = posix_getgrgid(filegroup($path . '/' . $f));
if ($owner === false) {
$owner = array('name' => '?');
}
if ($group === false) {
$group = array('name' => '?');
}
} else {
$owner = array('name' => '?');
$group = array('name' => '?');
@ -2104,6 +2110,12 @@ $tableTheme = (FM_THEME == "dark") ? "text-white bg-dark table-dark" : "bg-white
if (function_exists('posix_getpwuid') && function_exists('posix_getgrgid')) {
$owner = posix_getpwuid(fileowner($path . '/' . $f));
$group = posix_getgrgid(filegroup($path . '/' . $f));
if ($owner === false) {
$owner = array('name' => '?');
}
if ($group === false) {
$group = array('name' => '?');
}
} else {
$owner = array('name' => '?');
$group = array('name' => '?');