maximilianocuria added a comment.
I'm not sure, but I think that pam could be called from a process that has the stdin/stdout/stderr redirected to pipes, so disconnecting those for a long lived process would avoid a possible broken pipe. Now, if that's so, why it's not clossing stdin and stdout, I don't know. Also, why hardcode the 64 instead of closing all the available fds (see https://github.com/openssh/openssh-portable/blob/master/openbsd-compat/bsd-closefrom.c as an example). I guess there is room for improvement, but the change here follows the same logic of the original behavior. The original code starts kwalled without an stderr, and so does this version. Happy hacking, REPOSITORY R107 KWallet PAM Integration REVISION DETAIL https://phabricator.kde.org/D12702 To: maximilianocuria, #plasma, aacid Cc: tsimonq2, asturmlechner, rdieter, davidedmundson, plasma-devel, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart