Discussion:
getxxxbyzzz_r test suite?
Edgar Fuß
2013-12-06 11:37:22 UTC
Permalink
Is there a test suite to exercise the getxxxbyzzz_r() functions?
I have ported nss-pam-ldapd, but for the reentrant versions, I had to work
on FreeBSD compatibility code I don't really understand, so I would like to
test the outcome.
Christos Zoulas
2013-12-06 19:41:02 UTC
Permalink
Post by Edgar Fuß
Is there a test suite to exercise the getxxxbyzzz_r() functions?
I have ported nss-pam-ldapd, but for the reentrant versions, I had to work
on FreeBSD compatibility code I don't really understand, so I would like to
test the outcome.
You can add them in h_hostent.c in tests/lib/libc/net

christos
Edgar Fuß
2013-12-09 15:48:54 UTC
Permalink
EF> Is there a test suite to exercise the getxxxbyzzz_r() functions?
EF> I have ported nss-pam-ldapd, but for the reentrant versions, I had to work
EF> on FreeBSD compatibility code I don't really understand, so I would like to
EF> test the outcome.

CZ> You can add them in h_hostent.c in tests/lib/libc/net
Sorry, I meant getpwnam_r(), getgrnam_r() and friends.
Christos Zoulas
2013-12-09 17:03:27 UTC
Permalink
Post by Edgar Fuß
EF> Is there a test suite to exercise the getxxxbyzzz_r() functions?
EF> I have ported nss-pam-ldapd, but for the reentrant versions, I had to work
EF> on FreeBSD compatibility code I don't really understand, so I would like to
EF> test the outcome.
CZ> You can add them in h_hostent.c in tests/lib/libc/net
Sorry, I meant getpwnam_r(), getgrnam_r() and friends.
No, there are none but again, they should be easy to implement based on the
hostent ones.

christos
Edgar Fuß
2013-12-10 17:01:44 UTC
Permalink
EF> Sorry, I meant getpwnam_r(), getgrnam_r() and friends.
CZ> No, there are none but again, they should be easy to implement based
CZ> on the hostent ones.
I have no idea how to do that. Read: I don't know what to test. I.e.:
what's the critical situation in which a broken getpwnam_r() will go wrong?
It which way can it go wrong?
Christos Zoulas
2013-12-10 18:31:54 UTC
Permalink
Post by Edgar Fuß
EF> Sorry, I meant getpwnam_r(), getgrnam_r() and friends.
CZ> No, there are none but again, they should be easy to implement based
CZ> on the hostent ones.
what's the critical situation in which a broken getpwnam_r() will go wrong?
It which way can it go wrong?
It can core dump, it can leak memory, it can return the wrong results.
I'll see if I have the time to write a small test skeleton people can
use to add more tests.

christos
Edgar Fuß
2013-12-10 18:57:24 UTC
Permalink
Post by Christos Zoulas
It can core dump, it can leak memory, it can return the wrong results.
But what's the critical situation? I.e., if you would want my getpwnam_r()
to core dump, leak memory or return wrong results, how would you call it?
Post by Christos Zoulas
I'll see if I have the time to write a small test skeleton people can
use to add more tests.
That would be great!

Loading...