homed: fix parameter names on D-Bus methods

These arguments contain UserRecord structures serialized to JSON,
however only the "secret" part of it, not a whole user record. We do
this since the secret part is conceptually part of the user record and
in some contexts we need a user record in full with both secret and
non-secret part, and in others just the secret and in other just the
non-secret part, but we want to keep this in memory in the same logic.

Hence, let's rename the arguments where we expect a user record
consisting only of the secret part to "secret".
This commit is contained in:
Lennart Poettering 2020-05-12 09:02:47 +02:00
parent 671fee1873
commit 55842c7326
3 changed files with 40 additions and 40 deletions

View file

@ -65,30 +65,30 @@ node /org/freedesktop/home1 {
out o bus_path); out o bus_path);
ListHomes(out a(susussso) home_areas); ListHomes(out a(susussso) home_areas);
ActivateHome(in s user_name, ActivateHome(in s user_name,
in s user_record); in s secret);
DeactivateHome(in s user_name); DeactivateHome(in s user_name);
RegisterHome(in s home_record); RegisterHome(in s user_record);
UnregisterHome(in s user_name); UnregisterHome(in s user_name);
CreateHome(in s home_record); CreateHome(in s user_record);
RealizeHome(in s user_name, RealizeHome(in s user_name,
in s user_record); in s secret);
RemoveHome(in s user_name); RemoveHome(in s user_name);
FixateHome(in s user_name, FixateHome(in s user_name,
in s user_record); in s secret);
AuthenticateHome(in s user_name, AuthenticateHome(in s user_name,
in s user_record); in s secret);
UpdateHome(in s user_record); UpdateHome(in s user_record);
ResizeHome(in s user_name, ResizeHome(in s user_name,
in t size, in t size,
in s user_record); in s secret);
ChangePasswordHome(in s user_name, ChangePasswordHome(in s user_name,
in s new_user_record, in s new_secret,
in s old_user_record); in s old_secret);
LockHome(in s user_name); LockHome(in s user_name);
UnlockHome(in s user_name, UnlockHome(in s user_name,
in s user_record); in s secret);
AcquireHome(in s user_name, AcquireHome(in s user_name,
in s user_record, in s secret,
in b please_suspend, in b please_suspend,
out h send_fd); out h send_fd);
RefHome(in s user_name, RefHome(in s user_name,
@ -229,21 +229,21 @@ node /org/freedesktop/home1 {
node /org/freedesktop/home1/home { node /org/freedesktop/home1/home {
interface org.freedesktop.home1.Home { interface org.freedesktop.home1.Home {
methods: methods:
Activate(in s user_record); Activate(in s secret);
Deactivate(); Deactivate();
Unregister(); Unregister();
Realize(in s user_record); Realize(in s secret);
Remove(); Remove();
Fixate(in s user_record); Fixate(in s secret);
Authenticate(in s user_record); Authenticate(in s secret);
Update(in s user_record); Update(in s user_record);
Resize(in t size, Resize(in t size,
in s user_record); in s secret);
ChangePassword(in s new_user_record, ChangePassword(in s new_secret,
in s old_user_record); in s old_secret);
Lock(); Lock();
Unlock(in s user_record); Unlock(in s secret);
Acquire(in s user_record, Acquire(in s secret,
in b please_suspend, in b please_suspend,
out h send_fd); out h send_fd);
Ref(in b please_suspend, Ref(in b please_suspend,

View file

@ -798,7 +798,7 @@ const sd_bus_vtable home_vtable[] = {
SD_BUS_METHOD_WITH_NAMES("Activate", SD_BUS_METHOD_WITH_NAMES("Activate",
"s", "s",
SD_BUS_PARAM(user_record), SD_BUS_PARAM(secret),
NULL,, NULL,,
bus_home_method_activate, bus_home_method_activate,
SD_BUS_VTABLE_SENSITIVE), SD_BUS_VTABLE_SENSITIVE),
@ -806,7 +806,7 @@ const sd_bus_vtable home_vtable[] = {
SD_BUS_METHOD("Unregister", NULL, NULL, bus_home_method_unregister, SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("Unregister", NULL, NULL, bus_home_method_unregister, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("Realize", SD_BUS_METHOD_WITH_NAMES("Realize",
"s", "s",
SD_BUS_PARAM(user_record), SD_BUS_PARAM(secret),
NULL,, NULL,,
bus_home_method_realize, bus_home_method_realize,
SD_BUS_VTABLE_UNPRIVILEGED|SD_BUS_VTABLE_SENSITIVE), SD_BUS_VTABLE_UNPRIVILEGED|SD_BUS_VTABLE_SENSITIVE),
@ -814,13 +814,13 @@ const sd_bus_vtable home_vtable[] = {
SD_BUS_METHOD("Remove", NULL, NULL, bus_home_method_remove, SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("Remove", NULL, NULL, bus_home_method_remove, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD_WITH_NAMES("Fixate", SD_BUS_METHOD_WITH_NAMES("Fixate",
"s", "s",
SD_BUS_PARAM(user_record), SD_BUS_PARAM(secret),
NULL,, NULL,,
bus_home_method_fixate, bus_home_method_fixate,
SD_BUS_VTABLE_SENSITIVE), SD_BUS_VTABLE_SENSITIVE),
SD_BUS_METHOD_WITH_NAMES("Authenticate", SD_BUS_METHOD_WITH_NAMES("Authenticate",
"s", "s",
SD_BUS_PARAM(user_record), SD_BUS_PARAM(secret),
NULL,, NULL,,
bus_home_method_authenticate, bus_home_method_authenticate,
SD_BUS_VTABLE_UNPRIVILEGED|SD_BUS_VTABLE_SENSITIVE), SD_BUS_VTABLE_UNPRIVILEGED|SD_BUS_VTABLE_SENSITIVE),
@ -833,27 +833,27 @@ const sd_bus_vtable home_vtable[] = {
SD_BUS_METHOD_WITH_NAMES("Resize", SD_BUS_METHOD_WITH_NAMES("Resize",
"ts", "ts",
SD_BUS_PARAM(size) SD_BUS_PARAM(size)
SD_BUS_PARAM(user_record), SD_BUS_PARAM(secret),
NULL,, NULL,,
bus_home_method_resize, bus_home_method_resize,
SD_BUS_VTABLE_UNPRIVILEGED|SD_BUS_VTABLE_SENSITIVE), SD_BUS_VTABLE_UNPRIVILEGED|SD_BUS_VTABLE_SENSITIVE),
SD_BUS_METHOD_WITH_NAMES("ChangePassword", SD_BUS_METHOD_WITH_NAMES("ChangePassword",
"ss", "ss",
SD_BUS_PARAM(new_user_record) SD_BUS_PARAM(new_secret)
SD_BUS_PARAM(old_user_record), SD_BUS_PARAM(old_secret),
NULL,, NULL,,
bus_home_method_change_password, bus_home_method_change_password,
SD_BUS_VTABLE_UNPRIVILEGED|SD_BUS_VTABLE_SENSITIVE), SD_BUS_VTABLE_UNPRIVILEGED|SD_BUS_VTABLE_SENSITIVE),
SD_BUS_METHOD("Lock", NULL, NULL, bus_home_method_lock, 0), SD_BUS_METHOD("Lock", NULL, NULL, bus_home_method_lock, 0),
SD_BUS_METHOD_WITH_NAMES("Unlock", SD_BUS_METHOD_WITH_NAMES("Unlock",
"s", "s",
SD_BUS_PARAM(user_record), SD_BUS_PARAM(secret),
NULL,, NULL,,
bus_home_method_unlock, bus_home_method_unlock,
SD_BUS_VTABLE_SENSITIVE), SD_BUS_VTABLE_SENSITIVE),
SD_BUS_METHOD_WITH_NAMES("Acquire", SD_BUS_METHOD_WITH_NAMES("Acquire",
"sb", "sb",
SD_BUS_PARAM(user_record) SD_BUS_PARAM(secret)
SD_BUS_PARAM(please_suspend), SD_BUS_PARAM(please_suspend),
"h", "h",
SD_BUS_PARAM(send_fd), SD_BUS_PARAM(send_fd),

View file

@ -661,7 +661,7 @@ static const sd_bus_vtable manager_vtable[] = {
SD_BUS_METHOD_WITH_NAMES("ActivateHome", SD_BUS_METHOD_WITH_NAMES("ActivateHome",
"ss", "ss",
SD_BUS_PARAM(user_name) SD_BUS_PARAM(user_name)
SD_BUS_PARAM(user_record), SD_BUS_PARAM(secret),
NULL,, NULL,,
method_activate_home, method_activate_home,
SD_BUS_VTABLE_SENSITIVE), SD_BUS_VTABLE_SENSITIVE),
@ -675,7 +675,7 @@ static const sd_bus_vtable manager_vtable[] = {
/* Add the JSON record to homed, but don't create actual $HOME */ /* Add the JSON record to homed, but don't create actual $HOME */
SD_BUS_METHOD_WITH_NAMES("RegisterHome", SD_BUS_METHOD_WITH_NAMES("RegisterHome",
"s", "s",
SD_BUS_PARAM(home_record), SD_BUS_PARAM(user_record),
NULL,, NULL,,
method_register_home, method_register_home,
SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_VTABLE_UNPRIVILEGED),
@ -691,7 +691,7 @@ static const sd_bus_vtable manager_vtable[] = {
/* Add JSON record, and create $HOME for it */ /* Add JSON record, and create $HOME for it */
SD_BUS_METHOD_WITH_NAMES("CreateHome", SD_BUS_METHOD_WITH_NAMES("CreateHome",
"s", "s",
SD_BUS_PARAM(home_record), SD_BUS_PARAM(user_record),
NULL,, NULL,,
method_create_home, method_create_home,
SD_BUS_VTABLE_UNPRIVILEGED|SD_BUS_VTABLE_SENSITIVE), SD_BUS_VTABLE_UNPRIVILEGED|SD_BUS_VTABLE_SENSITIVE),
@ -700,7 +700,7 @@ static const sd_bus_vtable manager_vtable[] = {
SD_BUS_METHOD_WITH_NAMES("RealizeHome", SD_BUS_METHOD_WITH_NAMES("RealizeHome",
"ss", "ss",
SD_BUS_PARAM(user_name) SD_BUS_PARAM(user_name)
SD_BUS_PARAM(user_record), SD_BUS_PARAM(secret),
NULL,, NULL,,
method_realize_home, method_realize_home,
SD_BUS_VTABLE_UNPRIVILEGED|SD_BUS_VTABLE_SENSITIVE), SD_BUS_VTABLE_UNPRIVILEGED|SD_BUS_VTABLE_SENSITIVE),
@ -717,7 +717,7 @@ static const sd_bus_vtable manager_vtable[] = {
SD_BUS_METHOD_WITH_NAMES("FixateHome", SD_BUS_METHOD_WITH_NAMES("FixateHome",
"ss", "ss",
SD_BUS_PARAM(user_name) SD_BUS_PARAM(user_name)
SD_BUS_PARAM(user_record), SD_BUS_PARAM(secret),
NULL,, NULL,,
method_fixate_home, method_fixate_home,
SD_BUS_VTABLE_SENSITIVE), SD_BUS_VTABLE_SENSITIVE),
@ -726,7 +726,7 @@ static const sd_bus_vtable manager_vtable[] = {
SD_BUS_METHOD_WITH_NAMES("AuthenticateHome", SD_BUS_METHOD_WITH_NAMES("AuthenticateHome",
"ss", "ss",
SD_BUS_PARAM(user_name) SD_BUS_PARAM(user_name)
SD_BUS_PARAM(user_record), SD_BUS_PARAM(secret),
NULL,, NULL,,
method_authenticate_home, method_authenticate_home,
SD_BUS_VTABLE_UNPRIVILEGED|SD_BUS_VTABLE_SENSITIVE), SD_BUS_VTABLE_UNPRIVILEGED|SD_BUS_VTABLE_SENSITIVE),
@ -743,7 +743,7 @@ static const sd_bus_vtable manager_vtable[] = {
"sts", "sts",
SD_BUS_PARAM(user_name) SD_BUS_PARAM(user_name)
SD_BUS_PARAM(size) SD_BUS_PARAM(size)
SD_BUS_PARAM(user_record), SD_BUS_PARAM(secret),
NULL,, NULL,,
method_resize_home, method_resize_home,
SD_BUS_VTABLE_UNPRIVILEGED|SD_BUS_VTABLE_SENSITIVE), SD_BUS_VTABLE_UNPRIVILEGED|SD_BUS_VTABLE_SENSITIVE),
@ -751,8 +751,8 @@ static const sd_bus_vtable manager_vtable[] = {
SD_BUS_METHOD_WITH_NAMES("ChangePasswordHome", SD_BUS_METHOD_WITH_NAMES("ChangePasswordHome",
"sss", "sss",
SD_BUS_PARAM(user_name) SD_BUS_PARAM(user_name)
SD_BUS_PARAM(new_user_record) SD_BUS_PARAM(new_secret)
SD_BUS_PARAM(old_user_record), SD_BUS_PARAM(old_secret),
NULL,, NULL,,
method_change_password_home, method_change_password_home,
SD_BUS_VTABLE_UNPRIVILEGED|SD_BUS_VTABLE_SENSITIVE), SD_BUS_VTABLE_UNPRIVILEGED|SD_BUS_VTABLE_SENSITIVE),
@ -769,7 +769,7 @@ static const sd_bus_vtable manager_vtable[] = {
SD_BUS_METHOD_WITH_NAMES("UnlockHome", SD_BUS_METHOD_WITH_NAMES("UnlockHome",
"ss", "ss",
SD_BUS_PARAM(user_name) SD_BUS_PARAM(user_name)
SD_BUS_PARAM(user_record), SD_BUS_PARAM(secret),
NULL,, NULL,,
method_unlock_home, method_unlock_home,
SD_BUS_VTABLE_SENSITIVE), SD_BUS_VTABLE_SENSITIVE),
@ -784,7 +784,7 @@ static const sd_bus_vtable manager_vtable[] = {
SD_BUS_METHOD_WITH_NAMES("AcquireHome", SD_BUS_METHOD_WITH_NAMES("AcquireHome",
"ssb", "ssb",
SD_BUS_PARAM(user_name) SD_BUS_PARAM(user_name)
SD_BUS_PARAM(user_record) SD_BUS_PARAM(secret)
SD_BUS_PARAM(please_suspend), SD_BUS_PARAM(please_suspend),
"h", "h",
SD_BUS_PARAM(send_fd), SD_BUS_PARAM(send_fd),