From b41dca52762c5188638236ae81b9f4597bb29ac9 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 9 Nov 2022 11:14:12 -0500 Subject: pwcache: Fill the user/group caches lazily Iterating all the users/groups can be expensive, especially with NSS. Android has so many that it doesn't even return them all from get{pw,gr}ent() for performance reasons, leading to incorrect behaviour of -user/-group/etc. --- tests/posix/nogroup_ulimit.sh | 7 ++++++- tests/posix/nouser_ulimit.sh | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'tests/posix') diff --git a/tests/posix/nogroup_ulimit.sh b/tests/posix/nogroup_ulimit.sh index e7231d9..8f758c4 100644 --- a/tests/posix/nogroup_ulimit.sh +++ b/tests/posix/nogroup_ulimit.sh @@ -1,3 +1,8 @@ closefrom 4 ulimit -n 16 -bfs_diff deep -nogroup + +# -mindepth 18, but POSIX +path="*/*/*/*/*/*" +path="$path/$path/$path" +bfs_diff deep -path "deep/$path" -nogroup + diff --git a/tests/posix/nouser_ulimit.sh b/tests/posix/nouser_ulimit.sh index 1d0dd65..2777589 100644 --- a/tests/posix/nouser_ulimit.sh +++ b/tests/posix/nouser_ulimit.sh @@ -1,3 +1,7 @@ closefrom 4 ulimit -n 16 -bfs_diff deep -nouser + +# -mindepth 18, but POSIX +path="*/*/*/*/*/*" +path="$path/$path/$path" +bfs_diff deep -path "deep/$path" -nouser -- cgit v1.2.3