[LTP] [PATCH 3/7] Add user/group ID lookup helper functions
Martin Doucha
mdoucha@suse.cz
Mon Sep 6 14:40:11 CEST 2021
On 06. 09. 21 14:21, Cyril Hrubis wrote:
> Hi!
>> + if (!ret) {
>> + if (errno) {
>> + tst_brk_(file, lineno, TBROK | TERRNO,
>> + "getpwent() failed");
>> + } else {
>> + tst_brk_(file, lineno, TBROK,
>> + "getpwent() failed: end of file");
>> + }
>
> I'm not sure if "no more users in the /etc/passwd" should be reported as
> an error.
The alternative would be that pretty much every test that calls
SAFE_GETPWENT() in setup() will need to check for NULL and explicitly
call tst_brk(). I don't see any use for allowing SAFE_GETPWENT() to
return NULL outside cleanup().
--
Martin Doucha mdoucha@suse.cz
QA Engineer for Software Maintenance
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic
More information about the ltp
mailing list