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

Use nix APIs for umask munging in history module #616

Merged
merged 1 commit into from
Apr 11, 2022
Merged

Use nix APIs for umask munging in history module #616

merged 1 commit into from
Apr 11, 2022

Conversation

lopopolo
Copy link
Contributor

Remove some unsafe code by using nix's APIs for setting umasks on
the history files. This changes these function signatures to take and
return nix::sys::stat::Mode instead of c_int which constrains the
valid representations of the mode parameter to umask and fchmod.

This is a drive-by refactoring I noticed while mucking around with keybindings in #615.

Remove some unsafe code by using `nix`'s APIs for setting `umask`s on
the history files. This changes these function signatures to take and
return `nix::sys::stat::Mode` instead of `c_int` which constrains the
valid representations of the `mode` parameter to `umask` and `fchmod`.
@gwenn gwenn merged commit 8b0877a into kkawakam:master Apr 11, 2022
@lopopolo lopopolo deleted the lopopolo/nix-for-history-umask branch April 11, 2022 17:56
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