<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Aug 13, 2020 at 11:49 PM Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 13/08/2020 21:52, Chris Johns wrote:<br>
<br>
> On 13/8/20 11:47 pm, Joel Sherrill wrote:<br>
>> On Thu, Aug 13, 2020 at 7:52 AM Sebastian Huber<br>
>> <<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a> <mailto:<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a>>><br>
>> wrote:<br>
>><br>
>> On 13/08/2020 14:49, Joel Sherrill wrote:<br>
>><br>
>> > Why was crypt() removed? It is in the FreeBSD version at the bottom of<br>
>> > the file.<br>
>> ><br>
>> > <a href="https://github.com/freebsd/freebsd/blob/master/lib/libcrypt/crypt.c" rel="noreferrer" target="_blank">https://github.com/freebsd/freebsd/blob/master/lib/libcrypt/crypt.c</a><br>
>> It is not thread-safe.<br>
>><br>
>> But it is standards compliant.<br>
> Could it be added and just return NULL or even generate an internal error? The<br>
> lack of crypt stopped me from using and it made me consider the issues. It is<br>
> easy to forget these things when adding passwords to the console or telnet<br>
> server and really hard to see an issue.<br>
<br>
If you prefer a run time error to a link time error you can add <br>
something like this:<br>
<br>
char *<br>
crypt(const char *passwd, const char *salt)<br>
{<br>
errno = ENOSYS;<br>
return NULL;<br>
}<br></blockquote><div><br></div><div>We came to general agreement that link-time errors were preferable to </div><div>run-time ones during the SMP discussions. So no, I wouldn't want that.</div><div>It is either a functional implementation with the known reentrancy issues</div><div>or it is missing. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
The ready to use shell function to do a login check is:<br>
<br>
extern bool rtems_shell_login_check(<br>
const char *user,<br>
const char *passphrase<br>
);<br>
<br>
><br>
>> And this would seem to violate the rules of source transparency in the<br>
>> way the code was removed. If you wanted to disable it, it should have<br>
>> been wrapped in ifndef __rtems__.<br>
> I am confused, the code in cpukit/libcrypt is not from FreeBSD?<br>
The file "cpukit/libcrypt/crypt.c" is not from FreeBSD, so there is no <br>
point of having #ifndef __rtems__ stuff in it. Other files in the <br>
libcrypt are from FreeBSD.<br></blockquote><div><br></div><div>OK. That's why they looked familiar and I missed that crypt.c wasn't BSD.</div><div><br></div><div>--joel </div></div></div>