According to man login.conf pipebuf have SIZE type, but it is interpreted as NUMBER by cap_mkdb and ulimits -a. So login.conf with: :memorylocked=64K:\ :pipebuf=128M:\ will silently fail to make correct db. login.conf with: :memorylocked=64K:\ :pipebuf=134217728:\ make correct db. Please: 1. Set correct type for pipebuf to SIZE in parsers. 2. Fix cap_mkdb to return warnings in case type parse error instead silently set zero.
ulimit -a show incorrect value: pipebuf (-y) 65536 while it is in kilobytes (:pipebuf=67108864: in login.conf)
/usr/src/lib/libutil/login_class.c { "kqueues", login_getcapsize, RLIMIT_KQUEUES }, { "umtxp", login_getcapnum, RLIMIT_UMTXP }, { "pipebuf", login_getcapnum, RLIMIT_PIPEBUF }, kqueues probably should be login_getcapnum since it is FD, and openfiles is NUMBER type.
https://reviews.freebsd.org/D57333 getrlimit(2) describes RLIMIT_PIPEBUF as a size, but it looks like it's actually implemented as a count.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=b5dce0ae4f78251f56ffcb6c6a58b9e6c20380e0 commit b5dce0ae4f78251f56ffcb6c6a58b9e6c20380e0 Author: Dag-Erling Smørgrav <des@FreeBSD.org> AuthorDate: 2026-05-29 22:06:44 +0000 Commit: Dag-Erling Smørgrav <des@FreeBSD.org> CommitDate: 2026-05-29 22:06:44 +0000 login_class: Fix kqueues, pipebuf resource types * kqueues is a count but is listed as a size * pipebuf is a size but is listed as a count PR: 295623 MFC after: 1 week Fixes: a4c04958f526 ("libutil: support RLIMIT_PIPEBUF") Fixes: 85a0ddfd0b26 ("Add a resource limit for the total...") Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D57333 lib/libutil/login_class.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
usr.bin/limits/limits.c also need to be fixed. Probably some comments need to be added to usr.bin/limits/limits.c and lib/libutil/login_class.c to keep it sync.
A commit in branch stable/15 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=2a0e9a9b5934ced31c90ff5c3231e1599b3b1e75 commit 2a0e9a9b5934ced31c90ff5c3231e1599b3b1e75 Author: Dag-Erling Smørgrav <des@FreeBSD.org> AuthorDate: 2026-05-29 22:06:44 +0000 Commit: Dag-Erling Smørgrav <des@FreeBSD.org> CommitDate: 2026-06-04 14:40:17 +0000 login_class: Fix kqueues, pipebuf resource types * kqueues is a count but is listed as a size * pipebuf is a size but is listed as a count PR: 295623 MFC after: 1 week Fixes: a4c04958f526 ("libutil: support RLIMIT_PIPEBUF") Fixes: 85a0ddfd0b26 ("Add a resource limit for the total...") Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D57333 (cherry picked from commit b5dce0ae4f78251f56ffcb6c6a58b9e6c20380e0) lib/libutil/login_class.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=34fc5ccbc5534290dd874ea4bb50fac428621193 commit 34fc5ccbc5534290dd874ea4bb50fac428621193 Author: Dag-Erling Smørgrav <des@FreeBSD.org> AuthorDate: 2026-05-29 22:06:44 +0000 Commit: Dag-Erling Smørgrav <des@FreeBSD.org> CommitDate: 2026-06-04 14:40:29 +0000 login_class: Fix kqueues, pipebuf resource types * kqueues is a count but is listed as a size * pipebuf is a size but is listed as a count PR: 295623 MFC after: 1 week Fixes: a4c04958f526 ("libutil: support RLIMIT_PIPEBUF") Fixes: 85a0ddfd0b26 ("Add a resource limit for the total...") Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D57333 (cherry picked from commit b5dce0ae4f78251f56ffcb6c6a58b9e6c20380e0) lib/libutil/login_class.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Thanks! Do not miss https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295623#c5 usr.bin/limits/limits.c - requires same changes to be in sync.
Reopen since limits(1) also miscategorizes pipebuf as a count
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=ad524568f9fb77e270a22744d81b9cea0a2ab0eb commit ad524568f9fb77e270a22744d81b9cea0a2ab0eb Author: Dag-Erling Smørgrav <des@FreeBSD.org> AuthorDate: 2026-06-04 22:41:41 +0000 Commit: Dag-Erling Smørgrav <des@FreeBSD.org> CommitDate: 2026-06-04 22:41:41 +0000 limits: Fix pipebuf resource type * pipebuf is a size but is listed as a count PR: 295623 MFC after: 1 week Fixes: f54f41403d14 ("usr.bin/limits: support RLIMIT_PIPEBUF") Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D57456 usr.bin/limits/limits.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
A commit in branch stable/15 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=f4744e76333deba32bd381549169f2e8b92b163d commit f4744e76333deba32bd381549169f2e8b92b163d Author: Dag-Erling Smørgrav <des@FreeBSD.org> AuthorDate: 2026-06-04 22:41:41 +0000 Commit: Dag-Erling Smørgrav <des@FreeBSD.org> CommitDate: 2026-06-08 23:00:42 +0000 limits: Fix pipebuf resource type * pipebuf is a size but is listed as a count PR: 295623 MFC after: 1 week Fixes: f54f41403d14 ("usr.bin/limits: support RLIMIT_PIPEBUF") Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D57456 (cherry picked from commit ad524568f9fb77e270a22744d81b9cea0a2ab0eb) usr.bin/limits/limits.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=d6800be31a1e1e51f8fa34dfb0654402f323d109 commit d6800be31a1e1e51f8fa34dfb0654402f323d109 Author: Dag-Erling Smørgrav <des@FreeBSD.org> AuthorDate: 2026-06-04 22:41:41 +0000 Commit: Dag-Erling Smørgrav <des@FreeBSD.org> CommitDate: 2026-06-08 23:00:53 +0000 limits: Fix pipebuf resource type * pipebuf is a size but is listed as a count PR: 295623 MFC after: 1 week Fixes: f54f41403d14 ("usr.bin/limits: support RLIMIT_PIPEBUF") Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D57456 (cherry picked from commit ad524568f9fb77e270a22744d81b9cea0a2ab0eb) usr.bin/limits/limits.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)