Tobias Stoeckmann 875d2d49c1 chfn: Prevent buffer overflow.
This is a stability fix, not a security fix, because the affected -o
option can only be used by root and it takes a modified passwd file.

If a gecos field for a user has BUFSIZ characters without commas and an
equals sign (i.e. a huge slop/extra field) and chfn is called with -o,
then a buffer overflow occurs.

It is not possible to trigger this with shadow tools. Therefore, the
passwd file must be modified manually.

I have fixed this unlikely case the easiest and cleanest way possible.
Since chfn bails out if more than 80 characters excluding commas are
supposed to be written into gecos field, we can stop processing early on
if -o argument is too long.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2020-07-12 19:09:14 +02:00
..
2020-06-07 12:11:58 -05:00
2019-10-22 14:56:31 +02:00
2020-07-12 19:09:14 +02:00
2019-12-01 11:00:57 -06:00
2019-12-01 11:00:57 -06:00
2019-10-22 14:56:31 +02:00
2020-03-09 18:01:32 +00:00
2020-06-07 12:11:58 -05:00
2020-06-07 12:11:58 -05:00
2020-06-07 12:11:58 -05:00
2020-01-12 08:20:50 -06:00
2020-06-07 12:11:58 -05:00
2020-06-07 12:11:58 -05:00
2019-10-12 20:03:32 -05:00
2020-01-12 08:20:50 -06:00
2019-10-12 20:03:32 -05:00
2020-05-11 09:26:43 -04:00