]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/shared/user-record.c
user-record: Add preferredSession{Type,Launcher}
[thirdparty/systemd.git] / src / shared / user-record.c
index fc39194ac55ecf747e69f6bffddd19e691318456..fe102b004a1cf2fb297b3d7377bd3564a90bf76e 100644 (file)
@@ -189,6 +189,9 @@ static UserRecord* user_record_free(UserRecord *h) {
         free(h->state);
         free(h->service);
 
+        free(h->preferred_session_type);
+        free(h->preferred_session_launcher);
+
         strv_free(h->pkcs11_token_uri);
         for (size_t i = 0; i < h->n_pkcs11_encrypted_key; i++)
                 pkcs11_encrypted_key_done(h->pkcs11_encrypted_key + i);
@@ -1340,6 +1343,8 @@ static int dispatch_per_machine(const char *name, JsonVariant *variant, JsonDisp
                 { "rateLimitBurst",             _JSON_VARIANT_TYPE_INVALID, json_dispatch_uint64,                 offsetof(UserRecord, ratelimit_burst),               0         },
                 { "enforcePasswordPolicy",      JSON_VARIANT_BOOLEAN,       json_dispatch_tristate,               offsetof(UserRecord, enforce_password_policy),       0         },
                 { "autoLogin",                  JSON_VARIANT_BOOLEAN,       json_dispatch_tristate,               offsetof(UserRecord, auto_login),                    0         },
+                { "preferredSessionType",       JSON_VARIANT_STRING,        json_dispatch_string,                 offsetof(UserRecord, preferred_session_type),        JSON_SAFE },
+                { "preferredSessionLauncher",   JSON_VARIANT_STRING,        json_dispatch_string,                 offsetof(UserRecord, preferred_session_launcher),    JSON_SAFE },
                 { "stopDelayUSec",              _JSON_VARIANT_TYPE_INVALID, json_dispatch_uint64,                 offsetof(UserRecord, stop_delay_usec),               0         },
                 { "killProcesses",              JSON_VARIANT_BOOLEAN,       json_dispatch_tristate,               offsetof(UserRecord, kill_processes),                0         },
                 { "passwordChangeMinUSec",      _JSON_VARIANT_TYPE_INVALID, json_dispatch_uint64,                 offsetof(UserRecord, password_change_min_usec),      0         },
@@ -1683,6 +1688,8 @@ int user_record_load(UserRecord *h, JsonVariant *v, UserRecordLoadFlags load_fla
                 { "rateLimitBurst",             _JSON_VARIANT_TYPE_INVALID, json_dispatch_uint64,                 offsetof(UserRecord, ratelimit_burst),               0         },
                 { "enforcePasswordPolicy",      JSON_VARIANT_BOOLEAN,       json_dispatch_tristate,               offsetof(UserRecord, enforce_password_policy),       0         },
                 { "autoLogin",                  JSON_VARIANT_BOOLEAN,       json_dispatch_tristate,               offsetof(UserRecord, auto_login),                    0         },
+                { "preferredSessionType",       JSON_VARIANT_STRING,        json_dispatch_string,                 offsetof(UserRecord, preferred_session_type),        JSON_SAFE },
+                { "preferredSessionLauncher",   JSON_VARIANT_STRING,        json_dispatch_string,                 offsetof(UserRecord, preferred_session_launcher),    JSON_SAFE },
                 { "stopDelayUSec",              _JSON_VARIANT_TYPE_INVALID, json_dispatch_uint64,                 offsetof(UserRecord, stop_delay_usec),               0         },
                 { "killProcesses",              JSON_VARIANT_BOOLEAN,       json_dispatch_tristate,               offsetof(UserRecord, kill_processes),                0         },
                 { "passwordChangeMinUSec",      _JSON_VARIANT_TYPE_INVALID, json_dispatch_uint64,                 offsetof(UserRecord, password_change_min_usec),      0         },