<table><tr><td style="">maximilianocuria added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D12702">View Revision</a></tr></table><br /><div><div><p>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.</p>
<p>Also, why hardcode the 64 instead of closing all the available fds (see <a href="https://github.com/openssh/openssh-portable/blob/master/openbsd-compat/bsd-closefrom.c" class="remarkup-link" target="_blank" rel="noreferrer">https://github.com/openssh/openssh-portable/blob/master/openbsd-compat/bsd-closefrom.c</a> as an example).</p>
<p>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.</p>
<p>Happy hacking,</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R107 KWallet PAM Integration</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D12702">https://phabricator.kde.org/D12702</a></div></div><br /><div><strong>To: </strong>maximilianocuria, Plasma, aacid<br /><strong>Cc: </strong>tsimonq2, asturmlechner, rdieter, davidedmundson, plasma-devel, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart<br /></div>