summaryrefslogtreecommitdiff
path: root/src/shared/group-record.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-08-06 17:35:34 +0200
committerLennart Poettering <lennart@poettering.net>2020-08-07 08:39:18 +0200
commit0bb4308014d587354d4dbd1cc3a122f0751974b2 (patch)
treea29c30ffbb90920b720fcbc1168fedf868284336 /src/shared/group-record.c
parentfdc6c4f49c808baafb9bb0e01b617b4f3471f46b (diff)
downloadsystemd-0bb4308014d587354d4dbd1cc3a122f0751974b2.tar.gz
userdb: add "description" field to group records
User records have the realname/gecos fields, groups never had that, but it would really be useful to have it, hence let's add it with similar semantics. We enforce the same syntax as for GECOS, since it's better to start with strict rules and losen them later instead of the opposite.
Diffstat (limited to 'src/shared/group-record.c')
-rw-r--r--src/shared/group-record.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/shared/group-record.c b/src/shared/group-record.c
index 3c9520693d..d999ff95f8 100644
--- a/src/shared/group-record.c
+++ b/src/shared/group-record.c
@@ -28,6 +28,7 @@ static GroupRecord *group_record_free(GroupRecord *g) {
free(g->group_name);
free(g->realm);
free(g->group_name_and_realm_auto);
+ free(g->description);
strv_free(g->members);
free(g->service);
@@ -192,6 +193,7 @@ int group_record_load(
static const JsonDispatch group_dispatch_table[] = {
{ "groupName", JSON_VARIANT_STRING, json_dispatch_user_group_name, offsetof(GroupRecord, group_name), JSON_RELAX},
{ "realm", JSON_VARIANT_STRING, json_dispatch_realm, offsetof(GroupRecord, realm), 0 },
+ { "description", JSON_VARIANT_STRING, json_dispatch_gecos, offsetof(GroupRecord, description), 0 },
{ "disposition", JSON_VARIANT_STRING, json_dispatch_user_disposition, offsetof(GroupRecord, disposition), 0 },
{ "service", JSON_VARIANT_STRING, json_dispatch_string, offsetof(GroupRecord, service), JSON_SAFE },
{ "lastChangeUSec", JSON_VARIANT_UNSIGNED, json_dispatch_uint64, offsetof(GroupRecord, last_change_usec), 0 },