public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] inet: Turn __ivaliduser into a compatibility symbol
@ 2022-07-21 11:02 Florian Weimer
  2022-07-21 12:29 ` Andreas Schwab
  2022-07-21 12:41 ` Carlos O'Donell
  0 siblings, 2 replies; 5+ messages in thread
From: Florian Weimer @ 2022-07-21 11:02 UTC (permalink / raw)
  To: libc-alpha

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] inet: Turn __ivaliduser into a compatibility symbol
  2022-07-21 11:02 [PATCH] inet: Turn __ivaliduser into a compatibility symbol Florian Weimer
@ 2022-07-21 12:29 ` Andreas Schwab
  2022-07-21 13:23   ` Florian Weimer
  2022-07-21 12:41 ` Carlos O'Donell
  1 sibling, 1 reply; 5+ messages in thread
From: Andreas Schwab @ 2022-07-21 12:29 UTC (permalink / raw)
  To: Florian Weimer via Libc-alpha; +Cc: Florian Weimer

On Jul 21 2022, Florian Weimer via Libc-alpha wrote:

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

Well, as the comment says, this is not quite true.  The FreeBSD lpd
command still uses that interface (which is why the FreeBSD libc still
exports it), but it now uses a variant of it so that it no longer works
with glibc.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] inet: Turn __ivaliduser into a compatibility symbol
  2022-07-21 11:02 [PATCH] inet: Turn __ivaliduser into a compatibility symbol Florian Weimer
  2022-07-21 12:29 ` Andreas Schwab
@ 2022-07-21 12:41 ` Carlos O'Donell
  1 sibling, 0 replies; 5+ messages in thread
From: Carlos O'Donell @ 2022-07-21 12:41 UTC (permalink / raw)
  To: Florian Weimer, libc-alpha

On 7/21/22 07:02, Florian Weimer via Libc-alpha wrote:
> 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

Good catch. I don't think we should be exporting this anymore.

Please repost this in August for glibc 2.37. There is no strong reason to deprecate
this in the 2.36 release.

As a matter of procedure I don't want to change or review ABI changes at this point.


>  /* Returns 1 on positive match, 0 on no match, -1 on negative match.  */
>  static int
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] inet: Turn __ivaliduser into a compatibility symbol
  2022-07-21 12:29 ` Andreas Schwab
@ 2022-07-21 13:23   ` Florian Weimer
  2022-07-21 13:30     ` Andreas Schwab
  0 siblings, 1 reply; 5+ messages in thread
From: Florian Weimer @ 2022-07-21 13:23 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Florian Weimer via Libc-alpha

* Andreas Schwab:

> On Jul 21 2022, Florian Weimer via Libc-alpha wrote:
>
>> It is not declared in a header file, and as the comment indicates,
>> it is not expected to be used.
>
> Well, as the comment says, this is not quite true.  The FreeBSD lpd
> command still uses that interface (which is why the FreeBSD libc still
> exports it), but it now uses a variant of it so that it no longer works
> with glibc.

The Debian lpr package calls __ivaliduser_sa these days and has its own
bundled rcmd.c, so I really think we don't need to export this anymore.
(I expect other distributions have switched to CUPS entirely, or use a
similar lpr package version.)

Thanks,
Florian


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] inet: Turn __ivaliduser into a compatibility symbol
  2022-07-21 13:23   ` Florian Weimer
@ 2022-07-21 13:30     ` Andreas Schwab
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Schwab @ 2022-07-21 13:30 UTC (permalink / raw)
  To: Florian Weimer; +Cc: Florian Weimer via Libc-alpha

At least the comment should be updated to describe the current
situation.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-07-21 13:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-21 11:02 [PATCH] inet: Turn __ivaliduser into a compatibility symbol Florian Weimer
2022-07-21 12:29 ` Andreas Schwab
2022-07-21 13:23   ` Florian Weimer
2022-07-21 13:30     ` Andreas Schwab
2022-07-21 12:41 ` Carlos O'Donell

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).