tst-getpw failure

Yann Droneaud ydroneaud@opteya.com
Wed Jun 29 14:31:45 GMT 2022


Hi,

I chased a failure in pwd/tst-getpw earlier this week:   $ ./testrun.sh 
pwd/tst-getpw   PASS: NULL buffer returns -1 and sets errno to EINVAL.   
PASS: Read a password line given a uid.   FAIL: Did not find even one 
invalid uid.
I've found a related bug report there in ubuntu's launchpad:
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1869364

There's no fix for the issue, only a workaround.
But Florian made the following comment

> I believe this is related to the kind of NSS modules which are active
> on the system. I believe it's related how the way errno is (not) set.
> I'm not sure if this is a bug in the NSS framework, in the NSS module,
> or simply a case of incorrect test expectations.
It turned out my system (an Ubuntu 22.04, upgraded multiple times from 
previous releases) had a /etc/nsswitch.conf that contained the following:

   passwd:         files systemd sss   group:          files systemd sss 
   shadow:         files sss   gshadow:        files But sssd wasn't 
running on this system, go figure ... And libnss_sss's 
_nss_sss_getpwuid_r() seems to return|NSS_STATUS_UNAVAIL (-1) and set 
errno to ENOENT (2) when it failed to connect to its sssd daemon. ||Then 
getpw() returns a failure, and doesn't set errno to 0. ||So tst-getpw fails as it expects errno to be set to 0 if there's no 
entry associated to an UID. I'm pondering whether or not opening a bug 
on SSSD ... What a waste of time for a deprecated API. Regards. -- Yann 
Droneaud OPTEYA |

||



More information about the Libc-alpha mailing list