1
0
mirror of https://github.com/openbsd/src.git synced 2024-12-21 23:18:00 -08:00
openbsd-src/usr.sbin/pwd_mkdb
millert a63a57f896 pwd_mkdb: limit db entries to _PW_BUF_LEN to match libc
Otherwise, it is possible to create a passwd(5) entry that is too
large for getpwent(3), which ignores database entries larger than
_PW_BUF_LEN.  This adds a check in db_store() so that we do not
store an entry larger than getpwent(3) can read.  Callers of
pwd_mkdb(8), typically via pw_mkdb(3), already check for failure.

In most cases, the checks in chpass(1) will prevent a user from
creating an entry that is too large by changing their gecos field.
However, it is only when storing the db record that we know the
true size.

OK deraadt@
2024-07-28 19:13:26 +00:00
..
Makefile
pwd_mkdb.8 man pages: add missing commas between subordinate and main clauses 2022-03-31 17:27:13 +00:00
pwd_mkdb.c pwd_mkdb: limit db entries to _PW_BUF_LEN to match libc 2024-07-28 19:13:26 +00:00