public inbox for libc-stable@sourceware.org
 help / color / mirror / Atom feed
* [COMMITTED 2.38] A few small backports
@ 2023-09-15 22:01 Andreas K. Hüttel
  2023-09-15 22:01 ` [PATCH 1/3] iconv: restore verbosity with unrecognized encoding names (bug 30694) Andreas K. Hüttel
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andreas K. Hüttel @ 2023-09-15 22:01 UTC (permalink / raw)
  To: libc-stable

Some (near) one-liners from master...



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

* [PATCH 1/3] iconv: restore verbosity with unrecognized encoding names (bug 30694)
  2023-09-15 22:01 [COMMITTED 2.38] A few small backports Andreas K. Hüttel
@ 2023-09-15 22:01 ` Andreas K. Hüttel
  2023-09-15 22:01 ` [PATCH 2/3] string: Fix tester build with fortify enable with gcc < 12 Andreas K. Hüttel
  2023-09-15 22:01 ` [PATCH 3/3] manual/jobs.texi: Add missing @item EPERM for getpgid Andreas K. Hüttel
  2 siblings, 0 replies; 4+ messages in thread
From: Andreas K. Hüttel @ 2023-09-15 22:01 UTC (permalink / raw)
  To: libc-stable; +Cc: Andreas Schwab

From: Andreas Schwab <schwab@suse.de>

Commit 91927b7c76 ("Rewrite iconv option parsing [BZ #19519]") changed the
iconv program to call __gconv_open directly instead of the iconv_open
wrapper, but the former does not set errno.  Update the caller to
interpret the return codes like iconv_open does.

(cherry picked from commit fc72b6d7d818ab2868920af956d1542d03342a4d)
---
 iconv/iconv_prog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/iconv/iconv_prog.c b/iconv/iconv_prog.c
index bee898c63c..cf32cf9b44 100644
--- a/iconv/iconv_prog.c
+++ b/iconv/iconv_prog.c
@@ -187,7 +187,7 @@ main (int argc, char *argv[])
 
       if (res != __GCONV_OK)
 	{
-	  if (errno == EINVAL)
+	  if (res == __GCONV_NOCONV || res == __GCONV_NODB)
 	    {
 	      /* Try to be nice with the user and tell her which of the
 		 two encoding names is wrong.  This is possible because
-- 
2.41.0


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

* [PATCH 2/3] string: Fix tester build with fortify enable with gcc < 12
  2023-09-15 22:01 [COMMITTED 2.38] A few small backports Andreas K. Hüttel
  2023-09-15 22:01 ` [PATCH 1/3] iconv: restore verbosity with unrecognized encoding names (bug 30694) Andreas K. Hüttel
@ 2023-09-15 22:01 ` Andreas K. Hüttel
  2023-09-15 22:01 ` [PATCH 3/3] manual/jobs.texi: Add missing @item EPERM for getpgid Andreas K. Hüttel
  2 siblings, 0 replies; 4+ messages in thread
From: Andreas K. Hüttel @ 2023-09-15 22:01 UTC (permalink / raw)
  To: libc-stable; +Cc: Mahesh Bodapati, Adhemerval Zanella

From: Mahesh Bodapati <bmahi496@linux.ibm.com>

When building with fortify enabled, GCC < 12 issues a warning on the
fortify strncat wrapper might overflow the destination buffer (the
failure is tied to -Werror).

Checked on ppc64 and x86_64.
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

(cherry picked from commit f1c7ed0859a45929136836341741c7cd70f428cb)
---
 string/tester.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/string/tester.c b/string/tester.c
index f7d4bac5a8..824cf315ff 100644
--- a/string/tester.c
+++ b/string/tester.c
@@ -34,6 +34,14 @@
 DIAG_IGNORE_NEEDS_COMMENT (8, "-Wstringop-truncation");
 #endif
 
+/* When building with fortify enabled, GCC < 12 issues a warning on the
+   fortify strncat wrapper might overflow the destination buffer (the
+   failure is tied to -Werror).
+   Triggered by strncat fortify wrapper when it is enabled.  */
+#if __GNUC_PREREQ (11, 0)
+DIAG_IGNORE_NEEDS_COMMENT (11, "-Wstringop-overread");
+#endif
+
 #include <errno.h>
 #include <stdint.h>
 #include <stdio.h>
@@ -52,9 +60,6 @@ DIAG_IGNORE_NEEDS_COMMENT (5.0, "-Wmemset-transposed-args");
 DIAG_IGNORE_NEEDS_COMMENT (9, "-Wrestrict");
 DIAG_IGNORE_NEEDS_COMMENT (7, "-Wstringop-overflow=");
 #endif
-#if __GNUC_PREREQ (11, 0)
-DIAG_IGNORE_NEEDS_COMMENT (11, "-Wstringop-overread");
-#endif
 
 
 #define	STREQ(a, b)	(strcmp((a), (b)) == 0)
-- 
2.41.0


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

* [PATCH 3/3] manual/jobs.texi: Add missing @item EPERM for getpgid
  2023-09-15 22:01 [COMMITTED 2.38] A few small backports Andreas K. Hüttel
  2023-09-15 22:01 ` [PATCH 1/3] iconv: restore verbosity with unrecognized encoding names (bug 30694) Andreas K. Hüttel
  2023-09-15 22:01 ` [PATCH 2/3] string: Fix tester build with fortify enable with gcc < 12 Andreas K. Hüttel
@ 2023-09-15 22:01 ` Andreas K. Hüttel
  2 siblings, 0 replies; 4+ messages in thread
From: Andreas K. Hüttel @ 2023-09-15 22:01 UTC (permalink / raw)
  To: libc-stable; +Cc: Mark Wielaard

From: Mark Wielaard <mark@klomp.org>

The missing @item makes it look like errno will be set to ESRCH
if a cross-session getpgid is not permitted.

Found by ulfvonbelow on irc.

(cherry picked from commit 5a21cefd5abab1b99eda1fbf84204a9bf41662ab)
---
 manual/job.texi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/manual/job.texi b/manual/job.texi
index 42cb9fb26d..8157f13a1c 100644
--- a/manual/job.texi
+++ b/manual/job.texi
@@ -1133,6 +1133,7 @@ following @code{errno} error conditions are defined for this function:
 @table @code
 @item ESRCH
 There is no process with the given process ID @var{pid}.
+@item EPERM
 The calling process and the process specified by @var{pid} are in
 different sessions, and the implementation doesn't allow to access the
 process group ID of the process with ID @var{pid} from the calling
-- 
2.41.0


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

end of thread, other threads:[~2023-09-15 22:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-15 22:01 [COMMITTED 2.38] A few small backports Andreas K. Hüttel
2023-09-15 22:01 ` [PATCH 1/3] iconv: restore verbosity with unrecognized encoding names (bug 30694) Andreas K. Hüttel
2023-09-15 22:01 ` [PATCH 2/3] string: Fix tester build with fortify enable with gcc < 12 Andreas K. Hüttel
2023-09-15 22:01 ` [PATCH 3/3] manual/jobs.texi: Add missing @item EPERM for getpgid Andreas K. Hüttel

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