public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] inet/rcmd.c: fix warn unused result
@ 2023-04-18 13:01 Siddhesh Poyarekar
0 siblings, 0 replies; only message in thread
From: Siddhesh Poyarekar @ 2023-04-18 13:01 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1629adf2a6eefe5ddddc2445e2d056ca80edfe8b
commit 1629adf2a6eefe5ddddc2445e2d056ca80edfe8b
Author: Frédéric Bérat <fberat@redhat.com>
Date: Tue Apr 18 09:01:00 2023 -0400
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>
Diff:
---
inet/rcmd.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/inet/rcmd.c b/inet/rcmd.c
index ad8a894907..c1cd9daeb5 100644
--- a/inet/rcmd.c
+++ b/inet/rcmd.c
@@ -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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-04-18 13:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-18 13:01 [glibc] inet/rcmd.c: fix warn unused result Siddhesh Poyarekar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).