Skip to content

[#839] Adjusts permissions of sqitch.conf (and friends) every time#901

Open
fluca1978 wants to merge 1 commit intosqitchers:developfrom
fluca1978:chmod_config_files
Open

[#839] Adjusts permissions of sqitch.conf (and friends) every time#901
fluca1978 wants to merge 1 commit intosqitchers:developfrom
fluca1978:chmod_config_files

Conversation

@fluca1978
Copy link
Collaborator

Every time the configuration is loaded, the file permissions are checked and if they are different from 0600, they are adjusted via an explicit chmod.
The rationale is to ensure, as much as possibile, that configuration including target credentials remains private to the user.

This introduces the dependency with File::stat, in order to perform a more OOP-stat call.
The App::Sqitch::Config::load_file method has changed in order to call a new function, ::chmod_files_if_needed that accepts a list of file-ish stuff to check against permissions.

…ery time

Every time the configuration is loaded, the file permissions are
checked and if they are different from `0600`, they are adjusted via
an explicit `chmod`.
The rationale is to ensure, as much as possibile, that configuration
including target credentials remains private to the user.

This introduces the dependency with `File::stat`, in order to perform
a more OOP-`stat` call.
The `App::Sqitch::Config::load_file` method has changed in order to
call a new function, `::chmod_files_if_needed` that accepts a list of
file-ish stuff to check against permissions.
@theory
Copy link
Collaborator

theory commented Sep 26, 2025

I'm not sure this is desirable or even useful, as Stefanie Janine Stölting points out:

On git clone all file are becoming owned by the current user and the user is also the group. The attributes are derived by the ones from the repository.

When you change the file rights with chmod git shows the file as changed.

Git doesn't enforce something like this, AFAICT. I'm not sure it makes sense for Sqitch to do so, either.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants