Summary: | =sys-libs/glibc-2.27-r6: long lines in /etc/group skipped when using getent (getgrent) with "group: files" in /etc/nsswitch.conf | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Nico Rittner <nrittner> |
Component: | Current packages | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | slyfox |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
URL: | https://sourceware.org/PR18991 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 674126 | ||
Bug Blocks: |
Description
Nico Rittner
2018-11-13 14:52:11 UTC
I failed to reproduce it in a chroot [1]. If you can reproduce it can you craft /etc/passwd and /etc/group files that exhibit the failure and attach it here along with /etc/nsswitch.conf? [1]: my attempt: # groupadd testgroup # getent group testgroup testgroup:x:30001: # for i in $(seq 1 100); do useradd testuser${i} -G testgroup; done # getent group testgroup # getent group testgroup testgroup:x:30001:testuser1,testuser2,testuser3,testuser4,testuser5,testuser6,testuser7,testuser8,testuser9,testuser10,testuser11,testuser12,testuser13,testuser14,testuser15,testuser16,testuser17,testuser18,testuser19,testuser20,testuser21,testuser22,testuser23,testuser24,testuser25,testuser26,testuser27,testuser28,testuser29,testuser30,testuser31,testuser32,testuser33,testuser34,testuser35,testuser36,testuser37,testuser38,testuser39,testuser40,testuser41,testuser42,testuser43,testuser44,testuser45,testuser46,testuser47,testuser48,testuser49,testuser50,testuser51,testuser52,testuser53,testuser54,testuser55,testuser56,testuser57,testuser58,testuser59,testuser60,testuser61,testuser62,testuser63,testuser64,testuser65,testuser66,testuser67,testuser68,testuser69,testuser70,testuser71,testuser72,testuser73,testuser74,testuser75,testuser76,testuser77,testuser78,testuser79,testuser80,testuser81,testuser82,testuser83,testuser84,testuser85,testuser86,testuser87,testuser88,testuser89,testuser90,testuser91,testuser92,testuser93,testuser94,testuser95,testuser96,testuser97,testuser98,testuser99,testuser100 # getent group testgroup | wc -c 1110 using your example i get the same results. but as i wrote in my example ("steps to reproduce"), the issue occurs when omitting the second argument (the <key>) and only using the db-name "group" as the only argument to "getent". then the specific line is simply skipped in output. similar behaviour using the mentioned perl-oneliner. sry for replying late. extending your example: # getent group | grep ^testgroup: | wc -l; 0 with "group: files" in /etc/nssswitch.conf 1 with "group: compat" in /etc/nssswitch.conf Let's check if this is fixed in 2.28 Not a regression in 2.28 anyway. Did you file an upstream bug? If yes please link to it here. (In reply to Nico Rittner from comment #2) > using your example i get the same results. but as i wrote in my example > ("steps to reproduce"), the issue occurs when omitting the second argument > (the <key>) and only using the db-name "group" as the only argument to > "getent". then the specific line is simply skipped in output. similar > behaviour using the mentioned perl-oneliner. sry for replying late. > > extending your example: > # getent group | grep ^testgroup: | wc -l; > 0 with "group: files" in /etc/nssswitch.conf > 1 with "group: compat" in /etc/nssswitch.conf Thank you! Managed to reproduce it on glibc-2.27 but not on glibc-2.29. Let's see if I can bisect it down to the fix. Bisected it down to: 916124ed841745b7a1e0fbc43f9909340b47d373 is the first bad commit commit 916124ed841745b7a1e0fbc43f9909340b47d373 Author: Florian Weimer <fweimer@redhat.com> Date: Fri Jul 6 14:23:15 2018 +0200 nss_files: Fix re-reading of long lines [BZ #18991] Use the new __libc_readline_unlocked function to pick up reading at the same line in case the buffer needs to be enlarged. :100644 100644 51e6bdcefc5efeb34efb3f221513622cd4a92475 7a052c344a10cf3c9c89bf8ad1c8e5a535cab192 M ChangeLog :040000 040000 f03d96780ae1f73923e51333dcad792ac3bfb686 a737d442aacbd3fbbb76159aa8b9535f5a0e7aa2 M nss Looks like a legitimate fix: https://sourceware.org/PR18991 Fixed in glibc-2.28. glibc-2.28 is stable everywhere. |