mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Set errno to 0 before calling getpwuid/getgrgid, so that error
messages will be displayed only when there is, in fact, an error.
This commit is contained in:
parent
5edb850fbe
commit
a25502627d
1 changed files with 2 additions and 0 deletions
|
|
@ -1196,6 +1196,7 @@ lookup_uname_helper(struct bsdtar *bsdtar, const char **name, id_t id)
|
|||
|
||||
(void)bsdtar; /* UNUSED */
|
||||
|
||||
errno = 0;
|
||||
pwent = getpwuid((uid_t)id);
|
||||
if (pwent == NULL) {
|
||||
*name = NULL;
|
||||
|
|
@ -1222,6 +1223,7 @@ lookup_gname_helper(struct bsdtar *bsdtar, const char **name, id_t id)
|
|||
|
||||
(void)bsdtar; /* UNUSED */
|
||||
|
||||
errno = 0;
|
||||
grent = getgrgid((gid_t)id);
|
||||
if (grent == NULL && errno != 0) {
|
||||
*name = NULL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue