inet/rcmd.c: fix warn unused result

Fix unused result warnings, detected when _FORTIFY_SOURCE is enabled in
glibc.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
This commit is contained in:
Frédéric Bérat 2023-04-18 09:01:00 -04:00 committed by Siddhesh Poyarekar
parent cb9cae962c
commit 1629adf2a6

View File

@ -561,7 +561,9 @@ ruserok2_sa (struct sockaddr *ra, size_t ralen, int superuser,
reading an NFS mounted file system, can't read files that
are protected read/write owner only. */
uid = __geteuid ();
seteuid (pwd->pw_uid);
if (seteuid (pwd->pw_uid) < 0)
return -1;
hostf = iruserfopen (pbuf, pwd->pw_uid);
if (hostf != NULL)
@ -570,7 +572,8 @@ ruserok2_sa (struct sockaddr *ra, size_t ralen, int superuser,
fclose (hostf);
}
seteuid (uid);
if (seteuid (uid) < 0)
return -1;
return isbad;
}
return -1;