aboutsummaryrefslogtreecommitdiffstats
path: root/package/utils/busybox/patches/520-loginutils-handle-crypt-failures.patch
Commit message (Collapse)AuthorAgeFilesLines
* busybox: handle crypt() errors in loginutilsJo-Philipp Wich2019-01-221-0/+53
The crypt(3) function is allowed to fail with either EINVAL or ENOSYS when the given salt is either invalid or when the requested algorithm is not implemented. In such a case, libbb's pw_encrypt() function will silently convert the crypt() NULL return value into an empty string which is then processed without further errors by utilities such as chpasswd or passwd, causing them to set an empty password when an unsupported cipher is requested. Patch the relevant users of pw_encrypt() to abort in case an empty hash is returned by pw_encrypt() in order to mitigate the problem. Signed-off-by: Jo-Philipp Wich <jo@mein.io>