lib-sieve: don't reuse save_mode for directory#15
Open
Jappie3 wants to merge 1 commit intodovecot:mainfrom
Open
lib-sieve: don't reuse save_mode for directory#15Jappie3 wants to merge 1 commit intodovecot:mainfrom
Jappie3 wants to merge 1 commit intodovecot:mainfrom
Conversation
if the sieve script being compiled has read-only permissions, using save_mode in sieve_storage_setup_bin_path will cause the created directory to have permission bits 0555 (executable bit added by mkdir_get_executable_mode), resulting in pigeonhole being unable to save the compiled sieve binary
sirainen
reviewed
Jul 17, 2025
| str_begins_with(path, storage->bin_path) && | ||
| sieve_storage_setup_bin_path( | ||
| script->storage, mkdir_get_executable_mode(save_mode)) < 0) | ||
| script->storage, 0700) < 0) |
Contributor
There was a problem hiding this comment.
I wonder if we should instead create a new mkdir_get_wx_mode() that adds +w and +x bits for every +r. @stephanbosch do you remember if there's a reason we want to get the mode from the sieve script rather than hardcoding to 0700?
Contributor
There was a problem hiding this comment.
No. Likely, this code is borrowed from core/lib-storage somewhere.
Author
|
@sirainen thank you for the review, do you think this patch would gain more traction on the dovecot mailing list? If so I can try submitting it there |
13 tasks
Jappie3
added a commit
to Jappie3/nixpkgs
that referenced
this pull request
Aug 10, 2025
This patch fixes a permission issue that occurs when saving compiled sieve scripts sourced from the nix store. Instead of reusing the read-only permission bits from the nix store, it explicitly uses `0700` for the directory in which compiled sieve scripts should be saved. Additional context: - NixOS#388463 (comment) - dovecot/pigeonhole#15
Jappie3
added a commit
to Jappie3/nixpkgs
that referenced
this pull request
Nov 21, 2025
This patch fixes a permission issue that occurs when saving compiled sieve scripts sourced from the nix store. Instead of reusing the read-only permission bits from the nix store, it explicitly uses `0700` for the directory in which compiled sieve scripts should be saved. Additional context: - NixOS#388463 (comment) - dovecot/pigeonhole#15
Jappie3
added a commit
to Jappie3/nixpkgs
that referenced
this pull request
Nov 21, 2025
This patch fixes a permission issue that occurs when saving compiled sieve scripts sourced from the nix store. Instead of reusing the read-only permission bits from the nix store, it explicitly uses `0700` for the directory in which compiled sieve scripts should be saved. Additional context: - NixOS#388463 (comment) - dovecot/pigeonhole#15
Jappie3
added a commit
to Jappie3/nixpkgs
that referenced
this pull request
Dec 20, 2025
This patch fixes a permission issue that occurs when saving compiled sieve scripts sourced from the nix store. Instead of reusing the read-only permission bits from the nix store, it explicitly uses `0700` for the directory in which compiled sieve scripts should be saved. Additional context: - NixOS#388463 (comment) - dovecot/pigeonhole#15
Jappie3
added a commit
to Jappie3/nixpkgs
that referenced
this pull request
Dec 20, 2025
This patch fixes a permission issue that occurs when saving compiled sieve scripts sourced from the nix store. Instead of reusing the read-only permission bits from the nix store, it explicitly uses `0700` for the directory in which compiled sieve scripts should be saved. Additional context: - NixOS#388463 (comment) - dovecot/pigeonhole#15
kfiz
pushed a commit
to kfiz/nixpkgs
that referenced
this pull request
Jan 1, 2026
This patch fixes a permission issue that occurs when saving compiled sieve scripts sourced from the nix store. Instead of reusing the read-only permission bits from the nix store, it explicitly uses `0700` for the directory in which compiled sieve scripts should be saved. Additional context: - NixOS#388463 (comment) - dovecot/pigeonhole#15
kfiz
pushed a commit
to kfiz/nixpkgs
that referenced
this pull request
Jan 4, 2026
This patch fixes a permission issue that occurs when saving compiled sieve scripts sourced from the nix store. Instead of reusing the read-only permission bits from the nix store, it explicitly uses `0700` for the directory in which compiled sieve scripts should be saved. Additional context: - NixOS#388463 (comment) - dovecot/pigeonhole#15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a sieve script is saved as read-only, calling
sieve_storage_setup_bin_pathwithmkdir_get_executable_mode(save_mode)where - if I understand everything correctly -save_modeis derived from the original sieve script's permissions, will result in a read-only (technically0555,mkdir_get_executable_modeadds the executable bit) storage directory. This will cause pigeonhole to fail when saving the compiled script, as the directory has permissions0555:Explicitly using
0700when callingsieve_storage_setup_bin_pathfixes this.Extra context: