Felix Palmen :freebsd: :c64:<p>Of course, this new credentials checker in <a href="https://mastodon.bsd.cafe/tags/swad" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>swad</span></a> needs a <a href="https://mastodon.bsd.cafe/tags/tool" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>tool</span></a> to edit these <a href="https://mastodon.bsd.cafe/tags/password" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>password</span></a> files, that's currently work in progress.</p><p>I just implemented the class for reading a password, pretty simple thing from a pipe, but an "interesting" job from a <a href="https://mastodon.bsd.cafe/tags/terminal" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>terminal</span></a>. Turns out doing that portably, reliably and secure needs quite some code. 🙈</p><p>There's <a href="https://mastodon.bsd.cafe/tags/getpass" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>getpass</span></a>, but that's deprecated for good reasons (global state and not perfectly clear how it deals with <a href="https://mastodon.bsd.cafe/tags/signals" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>signals</span></a> that could interrupt the input). And there's the sane replacement <a href="https://mastodon.bsd.cafe/tags/readpassphrase" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>readpassphrase</span></a> in *some* systems (e.g. <a href="https://mastodon.bsd.cafe/tags/FreeBSD" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>FreeBSD</span></a>), but that's not portable. 🙃</p><p>So, plain old <a href="https://mastodon.bsd.cafe/tags/tcsetattr" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>tcsetattr</span></a> it is, with some signal handling on top:<br><a href="https://github.com/Zirias/swad/commit/447f48096fc275a5bae113393ffe9a3cbc66cc95" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/Zirias/swad/commit/</span><span class="invisible">447f48096fc275a5bae113393ffe9a3cbc66cc95</span></a></p>