This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/11070] Glibc netdb.h does not provide prototype for 'iruserok'


------- Additional Comments From simon at josefsson dot org  2009-12-09 17:28 -------
If you want to take the opportunity to also export the iruserok_af interface,
which seems equally exported by libc.so but not prototyped in any header file,
here is an alternative patch.   The iruserok_af interface appears to be a more
usable interface (because it is not IPv4 specific).

/Simon

2009-12-09  Simon Josefsson  <simon@josefsson.org>

	* resolv/netdb.h [__USE_BSD]: Add prototype for iruserok and
	iruserok_af.

>From e3db0b2ff7bd1d645d6b28a0eda344b0141f0c49 Mon Sep 17 00:00:00 2001
From: Simon Josefsson <simon@josefsson.org>
Date: Wed, 9 Dec 2009 18:26:15 +0100
Subject: [PATCH] Add prototype for iruserok and iruserok_af to netdb.h.

---
 resolv/netdb.h |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/resolv/netdb.h b/resolv/netdb.h
index dc1f7ce..c84f65e 100644
--- a/resolv/netdb.h
+++ b/resolv/netdb.h
@@ -516,6 +516,31 @@ extern int ruserok_af (__const char *__rhost, int __suser,
 		       __const char *__remuser, __const char *__locuser,
 		       sa_family_t __af);
 
+/* Check whether user REMUSER on system indicated by IPv4 address
+   RADDR is allowed to login as LOCUSER.  Non-IPv4 (e.g., IPv6) are
+   not supported.  If SUSER is not zero the user tries to become
+   superuser.  Return 0 if it is possible.
+
+   This function is not part of POSIX and therefore no official
+   cancellation point.  But due to similarity with an POSIX interface
+   or due to the implementation it is a cancellation point and
+   therefore not marked with __THROW.  */
+extern int iruserok (uint32_t __raddr, int __suser,
+		    __const char *__remuser, __const char *__locuser);
+
+/* Check whether user REMUSER on system indicated by socket address
+   RADDR with family AF is allowed to login as LOCUSER.  If SUSER is
+   not zero the user tries to become superuser.  Return 0 if it is
+   possible.
+
+   This function is not part of POSIX and therefore no official
+   cancellation point.  But due to similarity with an POSIX interface
+   or due to the implementation it is a cancellation point and
+   therefore not marked with __THROW.  */
+extern int iruserok_af (const void *__raddr, int __suser,
+			__const char *__remuser, __const char *__locuser,
+			sa_family_t af);
+
 /* Try to allocate reserved port, returning a descriptor for a socket opened
    at this port or -1 if unsuccessful.  The search for an available port
    will start at ALPORT and continues with lower numbers.
-- 
1.6.5.3


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11070

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]