Problem with files directory rights
Added by Maciej K 4 months ago
Hello,
There is a problem that I haven't found a solution to yet.
When someone adds a file to a report and it is the first report in a given month, a directory with the name of the month is created in the files directory. Everything is OK when the first such file is added via the website, but when this file is created, an email is sent and a report is created based on it. This directory is created with root rights and when someone wants to add an attachment via www, an error appears. How to fix it?
Thx
Replies (2)
RE: Problem with files directory rights - Added by Melva Sarabia 4 months ago
The issue with directories being created with root permissions likely stems from the process that generates these directories running with elevated privileges. To fix this, ensure your directory creation code specifies the correct permissions, such as 0o755 for directories. Additionally, verify that your application and email/report generation processes run under the appropriate user with necessary permissions. Adjust ownership and permissions of the directories as needed and ensure consistent user contexts for all processes to avoid permission conflicts.