[Toybox] Clean up password.c

amichaelc amichaelc at protonmail.ch
Sun Apr 4 11:53:21 PDT 2021


I have four patches. They all depend on each other, and have to be applied in order, except that you can skip the second if you want.

The first cleans up the style in password.c.

The second switches from sigaction() to signal() in read_password(). This improves simplicity and readability, but theoretically reduces portability. Since I'm not sure which is more important, I included the patch. If you don't like it, you can skip it without conflicting with any other patch.

The third changes update_password() to use a flag instead of checking what command is running. It also changes every command that uses update_password() to use this flag. I kept this change as simple as possible (e.g. not allowing both flags at once, because it wasn't allowed before) so as to reduce breakage. It doesn't break chsh.

The last fixes a bug in chsh.

Sent with [ProtonMail](https://protonmail.com) Secure Email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20210404/ad1d2f33/attachment.html>


More information about the Toybox mailing list