user-record: deal with invalid GECOS fields gracefully
authorLennart Poettering <lennart@poettering.net>
Thu, 6 Aug 2020 15:00:07 +0000 (17:00 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 17 Aug 2020 16:25:51 +0000 (18:25 +0200)
commit4cfa0ac4fdc4e404f8361785c60c9f6061152d2f
treea0be343d161fb6f761747fedf757864bf6d7dddb
parentae5234ef483801bd12c465dfaba6d63bf286eac0
user-record: deal with invalid GECOS fields gracefully

Let's fix up invalid GECOS fields both when we convert from NSS to JSON
and the other way round.

Kinda sucks we have to do that, but NSS does it when writing data to
/etc/passwd, so let's do the same.

Fixes: #16668
(cherry picked from commit 5cd12abaa0c0f3a06c9ff2048941fbe6e8b3577e)
src/shared/user-record-nss.c
src/shared/user-record.c