[PATCH] inet: Turn __ivaliduser into a compatibility symbol

Florian Weimer fweimer@redhat.com
Thu Jul 21 11:02:53 GMT 2022


It is not declared in a header file, and as the comment indicates,
it is not expected to be used.

Tested on i686-linux-gnu and x86_64-linux-gnu.

---
 inet/rcmd.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/inet/rcmd.c b/inet/rcmd.c
index 0d6b595572..624561f830 100644
--- a/inet/rcmd.c
+++ b/inet/rcmd.c
@@ -79,6 +79,7 @@
 #include <wchar.h>
 #include <sys/uio.h>
 #include <sigsetops.h>
+#include <shlib-compat.h>
 
 
 int __ivaliduser (FILE *, uint32_t, const char *, const char *);
@@ -621,6 +622,7 @@ iruserok (uint32_t raddr, int superuser, const char *ruser, const char *luser)
   return iruserok_af (&raddr, superuser, ruser, luser, AF_INET);
 }
 
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_36)
 /*
  * XXX
  * Don't make static, used by lpd(8).
@@ -632,7 +634,7 @@ iruserok (uint32_t raddr, int superuser, const char *ruser, const char *luser)
  * or PAM.
  * Returns 0 if ok, -1 if not ok.
  */
-int
+int attribute_compat_text_section
 __ivaliduser (FILE *hostf, uint32_t raddr, const char *luser,
 	      const char *ruser)
 {
@@ -643,7 +645,8 @@ __ivaliduser (FILE *hostf, uint32_t raddr, const char *luser,
 	return __validuser2_sa(hostf, (struct sockaddr *)&ra, sizeof(ra),
 			       luser, ruser, "-");
 }
-
+compat_symbol (libc, __ivaliduser, __ivaliduser, GLIBC_2_0);
+#endif
 
 /* Returns 1 on positive match, 0 on no match, -1 on negative match.  */
 static int



More information about the Libc-alpha mailing list