summaryrefslogtreecommitdiff
path: root/Kernel/KBufferBuilder.cpp
diff options
context:
space:
mode:
authorEmanuele Torre <torreemanuele6@gmail.com>2021-01-10 04:41:30 +0100
committerAndreas Kling <kling@serenityos.org>2021-01-10 16:40:05 +0100
commit91222a67c817f4752778a5afe9e9400336b2b90a (patch)
tree671fd9de34344e58e58e5d71b72eff99298e71c6 /Kernel/KBufferBuilder.cpp
parent9e5aa6f794ef9ab5828d5874c2e40de9a4fa8349 (diff)
downloadserenity-91222a67c817f4752778a5afe9e9400336b2b90a.zip
LibCore: get_password() now removes the trailing '\n' read by getline()
This avoids unintentionally adding a newline character at the end of user passwords when they are set using passwd(1). I also fixed these two issues: - The return value of getline() was being saved in an `int` variable instead of in a `ssize_t` variable; I replaced the `int` keyword with `auto` to fix this issue. - Prior to this patch, get_password() could potentially return tcsetattr()'s errno instead of getline()'s errno in case of an error. We now make sure it always returns the right errno in case of an error.
Diffstat (limited to 'Kernel/KBufferBuilder.cpp')
0 files changed, 0 insertions, 0 deletions