Skip to content

[HttpFoundation] Add settable permissions and adopt stricter defaults #42271

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

Closed
wants to merge 1 commit into from

Conversation

diogogithub
Copy link

@diogogithub diogogithub commented Jul 26, 2021

Q A
Branch? 6.0
Bug fix? no
New feature? yes
Deprecations? no
License MIT
Doc PR symfony/symfony-docs#...

While porting GNU social's TemporaryFile from v2 to v3, we've noticed that Symfony's File component didn't let us set permissions for new directories nor files. In addition, the default permission for directories is 0777.

If this was intended design, we would like to learn why; If not, I'll appreciate guidance on how to properly update the documentation and commit this patch.

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 5.4 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@carsonbot carsonbot changed the title [WIP][HttpFoundation] File: Add settable permissions and adopt stricter de… [HttpFoundation] [WIP] File: Add settable permissions and adopt stricter de… Jul 26, 2021
@OskarStark OskarStark changed the title [HttpFoundation] [WIP] File: Add settable permissions and adopt stricter de… [HttpFoundation] Add settable permissions and adopt stricter de… Jul 28, 2021
@chalasr chalasr changed the title [HttpFoundation] Add settable permissions and adopt stricter de… [HttpFoundation] Add settable permissions and adopt stricter defaults Jul 30, 2021
@chalasr chalasr added this to the 5.4 milestone Aug 6, 2021
@fabpot fabpot modified the milestones: 5.4, 6.1 Nov 4, 2021
@diogogithub diogogithub force-pushed the 5.4 branch 3 times, most recently from 5f71b9c to 6f0946c Compare January 20, 2022 12:59
@diogogithub
Copy link
Author

Rebased and fixed the issue found by psalm.

@carsonbot
Copy link

Hey!

I think @atailouloute has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

@chalasr chalasr removed request for dunglas and lyrixx January 24, 2022 10:40
@fabpot fabpot modified the milestones: 6.1, 6.2 May 20, 2022
@nicolas-grekas nicolas-grekas modified the milestones: 6.2, 6.3 Nov 5, 2022
@nicolas-grekas nicolas-grekas modified the milestones: 6.3, 6.4 May 23, 2023
@nicolas-grekas nicolas-grekas modified the milestones: 6.4, 7.1 Nov 15, 2023
@xabbuh xabbuh added the Feature label May 15, 2024
@xabbuh xabbuh modified the milestones: 7.1, 7.2 May 15, 2024
@fabpot fabpot modified the milestones: 7.2, 7.3 Nov 20, 2024
@nicolas-grekas
Copy link
Member

There are several aspects to consider here:

  • changing the default behavior. This is a risky move: users on shared hosts might be impacted. Maybe this is niche, but the Symfony community is large enough for someone to be impacted. Better not IMHO.
  • adding arguments to existing methods is a BC break so we'd need a BC layer to add those args. We can provide guidance on this.
  • but before that: do we want to make this the responsibility of the method? What about keeping everything as is and letting you (the caller) add a few more chmod before/after? That'd be the safer, history wise to me.

@nicolas-grekas
Copy link
Member

Let me close since this is quite old. Feel free to challenge of course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants