acl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/4] Fix test_getpw_match for no matching record


From: Pavel Simovec
Subject: [PATCH 1/4] Fix test_getpw_match for no matching record
Date: Wed, 24 Jan 2024 13:06:51 +0100

Change test_getpw_match to return 0 when no matching password record
is found, aligning with man getpwuid_r:
"If no matching password record was found,
these functions return 0 and store NULL in *result."
---
 test/test_passwd.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/test/test_passwd.c b/test/test_passwd.c
index 9428bf8..b88ea45 100644
--- a/test/test_passwd.c
+++ b/test/test_passwd.c
@@ -94,8 +94,6 @@ static int test_getpw_match(struct passwd *pwd, char *buf, 
size_t buflen,
        }
 
        fclose(file);
-       if (!errno && !*result)
-               errno = ENOENT;
        if (errno)
                return -1;
        return 0;
-- 
2.43.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]