Skip to content

Commit

Permalink
Check if posix_getpwuid/posix_getgrgid calls were successful (#1023)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-ober committed Apr 21, 2023
1 parent 3a90a59 commit 85f35bc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tinyfilemanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2051,6 +2051,12 @@ class="edit-file"><i class="fa fa-pencil-square-o"></i> <?php echo lng('Advanced
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' => '?');
Expand Down Expand Up @@ -2104,6 +2110,12 @@ class="edit-file"><i class="fa fa-pencil-square-o"></i> <?php echo lng('Advanced
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' => '?');
Expand Down

0 comments on commit 85f35bc

Please sign in to comment.