]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
pwquality: drop 'sym_' prefix from cleanup function
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 25 Oct 2025 02:54:07 +0000 (11:54 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 25 Oct 2025 02:54:21 +0000 (11:54 +0900)
This also drops unnecessary symbols in header.

src/shared/password-quality-util-pwquality.c
src/shared/password-quality-util-pwquality.h

index 49ea7d2fe2f20016eb42c45e171167e69f048a44..dfb618a4ba01b2e9ac5a817d52bd6352a6454737 100644 (file)
@@ -25,6 +25,8 @@ DLSYM_PROTOTYPE(pwquality_read_config) = NULL;
 DLSYM_PROTOTYPE(pwquality_set_int_value) = NULL;
 DLSYM_PROTOTYPE(pwquality_strerror) = NULL;
 
+DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(pwquality_settings_t*, sym_pwquality_free_settings, pwquality_free_settingsp, NULL);
+
 static void pwq_maybe_disable_dictionary(pwquality_settings_t *pwq) {
         char buf[PWQ_MAX_ERROR_MESSAGE_LEN];
         const char *path;
@@ -59,7 +61,7 @@ static void pwq_maybe_disable_dictionary(pwquality_settings_t *pwq) {
 }
 
 static int pwq_allocate_context(pwquality_settings_t **ret) {
-        _cleanup_(sym_pwquality_free_settingsp) pwquality_settings_t *pwq = NULL;
+        _cleanup_(pwquality_free_settingsp) pwquality_settings_t *pwq = NULL;
         char buf[PWQ_MAX_ERROR_MESSAGE_LEN];
         void *auxerror;
         int r;
@@ -86,7 +88,7 @@ static int pwq_allocate_context(pwquality_settings_t **ret) {
 }
 
 int suggest_passwords(void) {
-        _cleanup_(sym_pwquality_free_settingsp) pwquality_settings_t *pwq = NULL;
+        _cleanup_(pwquality_free_settingsp) pwquality_settings_t *pwq = NULL;
         _cleanup_strv_free_erase_ char **suggestions = NULL;
         _cleanup_(erase_and_freep) char *joined = NULL;
         char buf[PWQ_MAX_ERROR_MESSAGE_LEN];
@@ -119,7 +121,7 @@ int suggest_passwords(void) {
 }
 
 int check_password_quality(const char *password, const char *old, const char *username, char **ret_error) {
-        _cleanup_(sym_pwquality_free_settingsp) pwquality_settings_t *pwq = NULL;
+        _cleanup_(pwquality_free_settingsp) pwquality_settings_t *pwq = NULL;
         char buf[PWQ_MAX_ERROR_MESSAGE_LEN];
         void *auxerror;
         int r;
index 6ef4088716ee0becf46c5564b193bf7b032db65f..aaede45c2f0deb00f6283058154016ea1d52a65e 100644 (file)
@@ -6,22 +6,8 @@
 #if HAVE_PWQUALITY
 #include <pwquality.h>
 
-#include "dlfcn-util.h"
-
-extern DLSYM_PROTOTYPE(pwquality_check);
-extern DLSYM_PROTOTYPE(pwquality_default_settings);
-extern DLSYM_PROTOTYPE(pwquality_free_settings);
-extern DLSYM_PROTOTYPE(pwquality_generate);
-extern DLSYM_PROTOTYPE(pwquality_get_str_value);
-extern DLSYM_PROTOTYPE(pwquality_read_config);
-extern DLSYM_PROTOTYPE(pwquality_set_int_value);
-extern DLSYM_PROTOTYPE(pwquality_strerror);
-
-DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(pwquality_settings_t*, sym_pwquality_free_settings, NULL);
-
 int suggest_passwords(void);
 int check_password_quality(const char *password, const char *old, const char *username, char **ret_error);
-
 #endif
 
 int dlopen_pwquality(void);