Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File permissions revert to 0770 after file modification #530

Open
Skyspek opened this issue Oct 3, 2024 · 5 comments
Open

File permissions revert to 0770 after file modification #530

Skyspek opened this issue Oct 3, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@Skyspek
Copy link

Skyspek commented Oct 3, 2024

CloudPanel version(s) affected

2.4.2

Description

When I make modifications to a file via the file manager, the file permissions that were initially set to 0644 are automatically changed to 0770 after the modification. This behavior causes permission issues, and I would like the permissions to remain unchanged after editing a file.

How to reproduce

  1. Go to the file manager.
  2. Edit a file that has 0644 permissions.
  3. Save the modifications.
  4. Refresh the page after saving.
  5. Observe that the file permissions change from 0644 to 0770.

You can also test this with a folder:

  1. Change the permissions of a folder.
  2. Observe that all files inside the folder have their permissions changed as well.

Possible Solution

A potential fix would be to modify the way file permissions are handled after edits in the file manager, ensuring that the initial permissions remain intact unless explicitly changed by the user.

Additional Context

No response

@bitwanderer
Copy link

I can confirm this.

Also, new WordPress sites have all file permissions at 0770 instead of 0660.

@cloudpanel-io
Copy link
Owner

I can confirm this.

Also, new WordPress sites have all file permissions at 0770 instead of 0660.

That's not a bug. 660 is correct if you have only one user. Many projects have multiple users working on one site, where group write permissions are needed.

@cloudpanel-io cloudpanel-io added the bug Something isn't working label Oct 14, 2024
@bitwanderer
Copy link

bitwanderer commented Oct 16, 2024

I can confirm this.
Also, new WordPress sites have all file permissions at 0770 instead of 0660.

That's not a bug. 660 is correct if you have only one user. Many projects have multiple users working on one site, where group write permissions are needed.

No, the new files are set at 0770, the same as the folders. The files should be 0660. Just try creating a new WP site, and you'll see.

@ZKVillaraza
Copy link

I have almost similar issue. changing file permission is not working. it saves but always going back to the previous permission

@chiareu
Copy link

chiareu commented Oct 27, 2024

I can confirm this.
Also, new WordPress sites have all file permissions at 0770 instead of 0660.

That's not a bug. 660 is correct if you have only one user. Many projects have multiple users working on one site, where group write permissions are needed.

I'm trying to understand how the user structure and security is thought of under CloudPanel, and this 0770 global permission per [site] is a bit strange. Please explain why a WordPress website should run under multiple users?
Why doesn't everything run under the site user?

The recommended file and folder permissions for WordPress are 755 for directories and 644 for most files. These permissions are necessary for WordPress auto updates to work properly.

I understand that for other types of projects (not WordPress) more users may be needed and then they are added to the group. But this raises the risk that a certain user (let's name him HACKER1) will be added to several groups and then we have a big problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants