glibc/nis
Maciej W. Rozycki 780684eb04 nisplus: Correct pwent parsing issue and resulting build error [BZ #23266]
Copy and null-terminate NIS+ password file UID and GID entries whose
length is non-zero and are not terminated, in addition to empty ones,
fixing a bug and a compilation issue causing an error with GCC 8:

nss_nisplus/nisplus-parser.c: In function '_nss_nisplus_parse_pwent':
nss_nisplus/nisplus-parser.c:90:7: error: 'strncpy' destination unchanged after copying no bytes [-Werror=stringop-truncation]
       strncpy (first_unused, numstr, len);
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nss_nisplus/nisplus-parser.c:106:7: error: 'strncpy' destination unchanged after copying no bytes [-Werror=stringop-truncation]
       strncpy (first_unused, numstr, len);
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

introduced with commit ac05397075:

commit ac05397075
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Sun Apr 30 07:01:26 2006 +0000

	* nis/nss_nisplus/nisplus-parser.c: Minor optimizations and
	cleanups.  Avoid copying data if it can be used in the old place.

(no mailing list reference available).  Obviously regardless of the
recently added compiler diagnostics causing a build error this code has
been long non-functional, so I guess NIS+ servers have been supplying
strings that are non-empty and have already been null-terminated.
Which in turn made it unnecessary to make a null-terminated copy,
masking this bug.

	[BZ #23266]
	* nis/nss_nisplus/nisplus-parser.c (_nss_nisplus_parse_pwent):
	Copy and null-terminate entries that are not terminated, in
	addition to empty ones.
2018-06-27 21:12:16 +01:00
..
nss_nis _nss_nis_initgroups_dyn: Use struct scratch_buffer [BZ #18023] 2018-06-25 19:14:09 +02:00
nss_nisplus nisplus: Correct pwent parsing issue and resulting build error [BZ #23266] 2018-06-27 21:12:16 +01:00
rpcsvc libnsl: Turn remaining symbols into compat symbols [BZ #22701] 2018-01-29 17:42:30 +01:00
Depend
libnsl.h
Makefile libnsl: Turn remaining symbols into compat symbols [BZ #22701] 2018-01-29 17:42:30 +01:00
nis_add.c
nis_addmember.c
nis_call.c
nis_callback.c
nis_checkpoint.c
nis_clone_dir.c
nis_clone_obj.c
nis_clone_res.c
nis_creategroup.c
nis_defaults.c libnsl: Turn remaining symbols into compat symbols [BZ #22701] 2018-01-29 17:42:30 +01:00
nis_destroygroup.c
nis_domain_of_r.c
nis_domain_of.c
nis_error.c
nis_error.h
nis_file.c
nis_findserv.c
nis_free.c
nis_getservlist.c
nis_hash.c
nis_intern.h
nis_ismember.c
nis_local_names.c
nis_lookup.c
nis_mkdir.c
nis_modify.c
nis_ping.c
nis_print_group_entry.c
nis_print.c
nis_remove.c
nis_removemember.c
nis_rmdir.c
nis_server.c
nis_subr.c
nis_table.c
nis_util.c
nis_verifygroup.c
nis_xdr.c
nis_xdr.h
nisplus-parser.h
nss
nss-default.c
nss-nis.c
nss-nis.h
nss-nisplus.c
nss-nisplus.h
Versions
yp_xdr.c libnsl: Turn remaining symbols into compat symbols [BZ #22701] 2018-01-29 17:42:30 +01:00
ypclnt.c libnsl: Turn remaining symbols into compat symbols [BZ #22701] 2018-01-29 17:42:30 +01:00
ypupdate_xdr.c