-
Notifications
You must be signed in to change notification settings - Fork 41
lib-sieve: don't reuse save_mode for directory #15
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
base: main
Are you sure you want to change the base?
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
| 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Likely, this code is borrowed from core/lib-storage somewhere.
|
@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 |
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 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 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 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 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 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 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 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 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
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: