about summary refs log tree commit diff
path: root/sysdeps/wordsize-64/glob.c
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2017-09-04 17:07:16 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2017-09-08 16:33:39 +0200
commitffca890177bbf0980b66bc3a6d4d25c481957348 (patch)
treed8089db57032126b04c27cee659c90e0eea7e995 /sysdeps/wordsize-64/glob.c
parent5a79f97554af6f2eb0a654f844b3d1f56937064d (diff)
downloadglibc-ffca890177bbf0980b66bc3a6d4d25c481957348.tar.gz
glibc-ffca890177bbf0980b66bc3a6d4d25c481957348.tar.xz
glibc-ffca890177bbf0980b66bc3a6d4d25c481957348.zip
posix: fix glob bugs with long login names
Current glob implementation allows unlimited user name for home
directory construction on GLOB_TILDE case.  To accomplish it glob
either construct a name on stack if size are small enough (based
on current alloca_used) or in heap otherwise.

This patch simplifies storage allocation by using the same scratch
buffer for both get_rlogin_r and getpwnam_r.

This also syncs with gnulib commit 064df0b (glob: fix bugs with long
login names).

Checked on x86_64-linux-gnu and on a build using build-many-glibcs.py
for all major architectures.

	* posix/glob.c (GET_LOGIN_NAME_MAX): Remove.
	(glob): Use the same scratch buffer for both getlogin_r and
	getpwnam_r.  Don’t require preallocation of the login name.  This
	simplifies storage allocation, and corrects the handling of
	long login names.
Diffstat (limited to 'sysdeps/wordsize-64/glob.c')
0 files changed, 0 insertions, 0 deletions