From: Lennart Poettering Date: Thu, 2 Nov 2023 16:56:16 +0000 (+0100) Subject: cryptsetup: rename usrptr to userdata X-Git-Tag: v255-rc1~32^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c50a7776c18357819fd1a04aefcda6dd163dae50;p=thirdparty%2Fsystemd.git cryptsetup: rename usrptr to userdata Across our codebase we call the generic pointer "userdata", not "userptr". Do so here too. --- diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c index a0f93178f73..618fd91d5c0 100644 --- a/src/cryptsetup/cryptsetup.c +++ b/src/cryptsetup/cryptsetup.c @@ -1175,7 +1175,7 @@ static int crypt_activate_by_token_pin_ask_password( const char *type, usec_t until, bool headless, - void *usrptr, + void *userdata, uint32_t activation_flags, const char *message, const char *key_name, @@ -1186,9 +1186,9 @@ static int crypt_activate_by_token_pin_ask_password( _cleanup_strv_free_erase_ char **pins = NULL; int r; - r = crypt_activate_by_token_pin(cd, name, type, CRYPT_ANY_TOKEN, NULL, 0, usrptr, activation_flags); + r = crypt_activate_by_token_pin(cd, name, type, CRYPT_ANY_TOKEN, /* pin=*/ NULL, /* pin_size= */ 0, userdata, activation_flags); if (r > 0) /* returns unlocked keyslot id on success */ - r = 0; + return 0; if (r != -ENOANO) /* needs pin or pin is wrong */ return r; @@ -1197,9 +1197,9 @@ static int crypt_activate_by_token_pin_ask_password( return r; STRV_FOREACH(p, pins) { - r = crypt_activate_by_token_pin(cd, name, type, CRYPT_ANY_TOKEN, *p, strlen(*p), usrptr, activation_flags); + r = crypt_activate_by_token_pin(cd, name, type, CRYPT_ANY_TOKEN, *p, strlen(*p), userdata, activation_flags); if (r > 0) /* returns unlocked keyslot id on success */ - r = 0; + return 0; if (r != -ENOANO) /* needs pin or pin is wrong */ return r; } @@ -1209,14 +1209,14 @@ static int crypt_activate_by_token_pin_ask_password( for (;;) { pins = strv_free_erase(pins); - r = ask_password_auto(message, "drive-harddisk", NULL, key_name, credential_name, until, flags, &pins); + r = ask_password_auto(message, "drive-harddisk", /* id= */ NULL, key_name, credential_name, until, flags, &pins); if (r < 0) return r; STRV_FOREACH(p, pins) { - r = crypt_activate_by_token_pin(cd, name, type, CRYPT_ANY_TOKEN, *p, strlen(*p), usrptr, activation_flags); + r = crypt_activate_by_token_pin(cd, name, type, CRYPT_ANY_TOKEN, *p, strlen(*p), userdata, activation_flags); if (r > 0) /* returns unlocked keyslot id on success */ - r = 0; + return 0; if (r != -ENOANO) /* needs pin or pin is wrong */ return r; } @@ -1234,7 +1234,7 @@ static int attach_luks2_by_fido2_via_plugin( const char *name, usec_t until, bool headless, - void *usrptr, + void *userdata, uint32_t activation_flags) { return crypt_activate_by_token_pin_ask_password( @@ -1243,7 +1243,7 @@ static int attach_luks2_by_fido2_via_plugin( "systemd-fido2", until, headless, - usrptr, + userdata, activation_flags, "Please enter security token PIN:", "fido2-pin", @@ -2264,10 +2264,10 @@ static int run(int argc, char *argv[]) { r = crypt_activate_by_token_pin_ask_password( cd, volume, - NULL, + /* type= */ NULL, until, arg_headless, - NULL, + /* userdata= */ NULL, flags, "Please enter LUKS2 token PIN:", "luks2-pin",