]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cryptsetup-util: move definition of crypt_token_max()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 8 Jun 2025 00:55:08 +0000 (09:55 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 9 Jun 2025 13:45:23 +0000 (22:45 +0900)
As it uses streq(), but string-util.h is not included in the header.

src/shared/cryptsetup-util.c
src/shared/cryptsetup-util.h

index e45e8431bcddd839816d54af23b3077bfa9c5c95..b8281679dc35141604d2393e8bfcfc2275a0287a 100644 (file)
@@ -54,6 +54,12 @@ DLSYM_PROTOTYPE(crypt_token_json_get) = NULL;
 DLSYM_PROTOTYPE(crypt_token_json_set) = NULL;
 #if HAVE_CRYPT_TOKEN_MAX
 DLSYM_PROTOTYPE(crypt_token_max) = NULL;
+#else
+int crypt_token_max(_unused_ const char *type) {
+    assert(streq(type, CRYPT_LUKS2));
+
+    return 32;
+}
 #endif
 #if HAVE_CRYPT_TOKEN_SET_EXTERNAL_PATH
 DLSYM_PROTOTYPE(crypt_token_set_external_path) = NULL;
index 6ecc8f601f0f003b5205b4548da33e6400a4a0b4..df897c208ffd9e8afbca0c54f2f73a8733ce953e 100644 (file)
@@ -56,11 +56,7 @@ extern DLSYM_PROTOTYPE(crypt_token_json_set);
 extern DLSYM_PROTOTYPE(crypt_token_max);
 #else
 /* As a fallback, use the same hard-coded value libcryptsetup uses internally. */
-static inline int crypt_token_max(_unused_ const char *type) {
-    assert(streq(type, CRYPT_LUKS2));
-
-    return 32;
-}
+int crypt_token_max(_unused_ const char *type);
 #define sym_crypt_token_max(type) crypt_token_max(type)
 #endif
 #if HAVE_CRYPT_TOKEN_SET_EXTERNAL_PATH