]> git.ipfire.org Git - thirdparty/glibc.git/commit
Harden putpwent, putgrent, putspent, putspent against injection [BZ #18724]
authorFlorian Weimer <fweimer@redhat.com>
Fri, 2 Oct 2015 09:34:13 +0000 (11:34 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Fri, 2 Oct 2015 09:34:13 +0000 (11:34 +0200)
commit676599b36a92f3c201c5682ee7a5caddd9f370a4
tree6860752c26ccab76ee9db5e60ff465d1edf25feb
parentb0f81637d5bda47be93bac34b68f429a12979321
Harden putpwent, putgrent, putspent, putspent against injection [BZ #18724]

This prevents injection of ':' and '\n' into output functions which
use the NSS files database syntax.  Critical fields (user/group names
and file system paths) are checked strictly.  For backwards
compatibility, the GECOS field is rewritten instead.

The getent program is adjusted to use the put*ent functions in libc,
instead of local copies.  This changes the behavior of getent if user
names start with '-' or '+'.
22 files changed:
ChangeLog
NEWS
grp/Makefile
grp/putgrent.c
grp/tst-putgrent.c [new file with mode: 0644]
gshadow/Makefile
gshadow/putsgent.c
gshadow/tst-putsgent.c [new file with mode: 0644]
include/nss.h
include/pwd.h
nss/Makefile
nss/getent.c
nss/rewrite_field.c [new file with mode: 0644]
nss/tst-field.c [new file with mode: 0644]
nss/valid_field.c [new file with mode: 0644]
nss/valid_list_field.c [new file with mode: 0644]
pwd/Makefile
pwd/putpwent.c
pwd/tst-putpwent.c [new file with mode: 0644]
shadow/Makefile
shadow/putspent.c
shadow/tst-putspent.c [new file with mode: 0644]