]> git.ipfire.org Git - thirdparty/glibc.git/commit
nss_db: Propagate ERANGE error if parse_line fails [BZ #19837]
authorFlorian Weimer <fweimer@redhat.com>
Tue, 29 Mar 2016 09:27:32 +0000 (11:27 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Thu, 18 Aug 2016 13:26:21 +0000 (15:26 +0200)
commit240ceafed7a00af8571d56db67a6b8854e418106
treec83a99cfac8a34c1a38fd5bc233d13ad5381fec9
parent809cde4a640032f2f87319c9358be4fee8d6d7d5
nss_db: Propagate ERANGE error if parse_line fails [BZ #19837]

Reproducer (needs to run as root):

perl -e \
  'print "large:x:999:" . join(",", map {"user$_"} (1 .. 135))."\n"' \
  >> /etc/group
cd /var/db
make
getent -s db group

After the fix, the last command should list the "large" group.

The magic number 135 has been chosen so that the line is shorter than
1024 bytes, but the pointers required to encode the member array will
cross the threshold, triggering the bug.

(cherry picked from commit a6033052d08027f745867e5e346852da1959226c)
ChangeLog
nss/nss_db/db-XXX.c