How to debug "Permissions to Denial" errors on Linux (lstat () = -1 EACCES)

Is there any way to debug why I get

lstat ("/ path / to / file", 0x ...) = -1 EACCES (permission denied)

error accessing file / directory? to indicate whether this is due to problems with selinux or because of user / group rights or NFS or any ACLs that might come into play?

I had the correct permissions set in the directory for the user, and I was able to create a file in this directory after logging in as a user. However, when PHP runs under the Apache scope with the same user and group, it cannot create the file.

I understand that Apache uses suid to change from "root" to the required user, but still, when PHP runs under Apache, the file is not created. In addition, PHP provides the correct and expected real and effective user identifiers (instead of root).

For those interested, the file / path / to / file is on an NFSv4 mount, but I would like to indicate why the permission is denied.

Can I find out !?

+4
source share

Source: https://habr.com/ru/post/1489476/


All Articles