glibc/sunrpc
Adhemerval Zanella Netto 997d844a97 sunrpc: Suppress GCC -Os warning on user2netname
GCC with -Os warns that sprint might overflow:

  netname.c: In function ‘user2netname’:
  netname.c:51:28: error: ‘%s’ directive writing up to 255 bytes into a
  region of size between 239 and 249 [-Werror=format-overflow=]
     51 |   sprintf (netname, "%s.%d@%s", OPSYS, uid, dfltdom);
        |                            ^~               ~~~~~~~
  netname.c:51:3: note: ‘sprintf’ output between 8 and 273 bytes into a
  destination of size 256
     51 |   sprintf (netname, "%s.%d@%s", OPSYS, uid, dfltdom);
        |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cc1: all warnings being treated as errors

However the code does test prior the sprintf call that dfltdom plus
the required extra space for OPSYS, uid, and extra character will not
overflow and return 0 instead.

Checked on x86_64-linux-gnu and i686-linux-gnu.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>

(cherry picked from commit 6128e82ebe)
2022-12-28 17:37:42 -03:00
..
rpc Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
auth_des.c Change most internal uses of __gettimeofday to __clock_gettime. 2019-10-30 17:04:10 -03:00
auth_none.c Include shlib-compat.h in many sunrpc/nis source files. 2017-06-04 11:31:28 -04:00
auth_unix.c Change most internal uses of __gettimeofday to __clock_gettime. 2019-10-30 17:04:10 -03:00
authdes_prot.c Include shlib-compat.h in many sunrpc/nis source files. 2017-06-04 11:31:28 -04:00
authuxprot.c Include shlib-compat.h in many sunrpc/nis source files. 2017-06-04 11:31:28 -04:00
clnt_gen.c CVE-2022-23219: Buffer overflow in sunrpc clnt_create for "unix" (bug 22542) 2022-01-17 10:22:00 +01:00
clnt_perr.c sunrpc: Turn clnt_sperrno into a libc_hidden_nolink_sunrpc symbol 2020-07-07 20:19:57 +02:00
clnt_raw.c sunrpc: Remove always-defined _RPC_THREAD_SAFE_ macro 2018-06-26 15:27:03 +02:00
clnt_simp.c sunrpc: Remove always-defined _RPC_THREAD_SAFE_ macro 2018-06-26 15:27:03 +02:00
clnt_tcp.c Consistently use uintN_t not u_intN_t everywhere. 2017-08-07 19:55:34 +00:00
clnt_udp.c Disable -Wmaybe-uninitialized for total_deadline in sunrpc/clnt_udp.c. 2019-10-02 21:12:17 +00:00
clnt_unix.c Consistently use uintN_t not u_intN_t everywhere. 2017-08-07 19:55:34 +00:00
create_xid.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
des_crypt.c Disallow use of DES encryption functions in new programs. 2018-06-29 16:53:18 +02:00
des_impl.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
des_soft.c Disallow use of DES encryption functions in new programs. 2018-06-29 16:53:18 +02:00
get_myaddr.c Include shlib-compat.h in many sunrpc/nis source files. 2017-06-04 11:31:28 -04:00
getrpcport.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
key_call.c Force building with -fno-common 2021-07-09 20:09:14 +02:00
key_prot.c Include shlib-compat.h in many sunrpc/nis source files. 2017-06-04 11:31:28 -04:00
Makefile CVE-2022-23218: Buffer overflow in sunrpc svcunix_create (bug 28768) 2022-01-17 10:47:58 +01:00
netname.c sunrpc: Suppress GCC -Os warning on user2netname 2022-12-28 17:37:42 -03:00
openchild.c Remove use of INTDEF/INTUSE in libio 2012-05-24 23:06:20 +02:00
pm_getmaps.c Consolidate non cancellable close call 2017-08-18 18:38:55 -03:00
pm_getport.c sunrpc: Remove internal_function attribute 2017-08-31 15:59:02 +02:00
pmap_clnt.c Include shlib-compat.h in many sunrpc/nis source files. 2017-06-04 11:31:28 -04:00
pmap_prot2.c Include shlib-compat.h in many sunrpc/nis source files. 2017-06-04 11:31:28 -04:00
pmap_prot.c Include shlib-compat.h in many sunrpc/nis source files. 2017-06-04 11:31:28 -04:00
pmap_rmt.c sunrpc: Remove internal_function attribute 2017-08-31 15:59:02 +02:00
publickey.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
rpc_cmsg.c Include shlib-compat.h in many sunrpc/nis source files. 2017-06-04 11:31:28 -04:00
rpc_common.c Force building with -fno-common 2021-07-09 20:09:14 +02:00
rpc_dtable.c Include shlib-compat.h in many sunrpc/nis source files. 2017-06-04 11:31:28 -04:00
rpc_gethostbyname.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
rpc_prot.c Include shlib-compat.h in many sunrpc/nis source files. 2017-06-04 11:31:28 -04:00
rpc_thread.c libc: Extend __libc_freeres framework (Bug 23329). 2018-06-29 22:39:06 -04:00
rtime.c Include shlib-compat.h in many sunrpc/nis source files. 2017-06-04 11:31:28 -04:00
svc_auth.c Include shlib-compat.h in many sunrpc/nis source files. 2017-06-04 11:31:28 -04:00
svc_authux.c Obsolete RPC implementation in libc. 2011-04-16 21:59:36 -04:00
svc_raw.c sunrpc: Remove always-defined _RPC_THREAD_SAFE_ macro 2018-06-26 15:27:03 +02:00
svc_run.c Include shlib-compat.h in many sunrpc/nis source files. 2017-06-04 11:31:28 -04:00
svc_simple.c sunrpc: Remove always-defined _RPC_THREAD_SAFE_ macro 2018-06-26 15:27:03 +02:00
svc_tcp.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
svc_udp.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
svc_unix.c CVE-2022-23218: Buffer overflow in sunrpc svcunix_create (bug 28768) 2022-01-17 10:47:58 +01:00
svc.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
svcauth_des.c Force building with -fno-common 2021-07-09 20:09:14 +02:00
test-rpcent.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
thrsvc.c
tst-bug22542.c sunrpc: Test case for clnt_create "unix" buffer overflow (bug 22542) 2022-01-17 10:22:07 +01:00
tst-bug28768.c CVE-2022-23218: Buffer overflow in sunrpc svcunix_create (bug 28768) 2022-01-17 10:47:58 +01:00
tst-getmyaddr.c
tst-svc_register.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-udp-error.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-udp-garbage.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-udp-nonblocking.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-udp-timeout.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-xdrmem2.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-xdrmem.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
Versions Exclude rpcent functions and NSS backends for rpc, key when excluding sunrpc. 2015-02-06 10:43:19 -08:00
xcrypt.c sunrpc: Remove internal_function attribute 2017-08-31 15:59:02 +02:00
xdr_array.c Include shlib-compat.h in many sunrpc/nis source files. 2017-06-04 11:31:28 -04:00
xdr_float.c Include shlib-compat.h in many sunrpc/nis source files. 2017-06-04 11:31:28 -04:00
xdr_intXX_t.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
xdr_mem.c Include shlib-compat.h in many sunrpc/nis source files. 2017-06-04 11:31:28 -04:00
xdr_rec.c sunrpc: Remove internal_function attribute 2017-08-31 15:59:02 +02:00
xdr_ref.c Include shlib-compat.h in many sunrpc/nis source files. 2017-06-04 11:31:28 -04:00
xdr_sizeof.c Include shlib-compat.h in many sunrpc/nis source files. 2017-06-04 11:31:28 -04:00
xdr_stdio.c Consistently use uintN_t not u_intN_t everywhere. 2017-08-07 19:55:34 +00:00
xdr.c sunrpc: Fix typo in xdr_string comment 2021-02-08 13:55:03 +01:00