mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-21 00:46:27 +02:00
only root try to give another group to file
This commit is contained in:
parent
e06079e6af
commit
7c85753bfa
1 changed files with 1 additions and 1 deletions
|
@ -323,7 +323,7 @@ namespace controllers\internals;
|
|||
throw new \Exception('Cannot give dir ' . $new_dir . ' to user : ' . fileowner(PWD_DATA_PUBLIC));
|
||||
}
|
||||
|
||||
if (!chgrp($new_dir, filegroup(PWD_DATA_PUBLIC)))
|
||||
if (posix_getuid() === 0 && !chgrp($new_dir, filegroup(PWD_DATA_PUBLIC))) //If we are root, try to give the file to a proper group
|
||||
{
|
||||
throw new \Exception('Cannot give dir ' . $new_dir . ' to group : ' . filegroup(PWD_DATA_PUBLIC));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue