summaryrefslogtreecommitdiffstats
path: root/src/shared/idn-util.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:42 +0000
commit78e9bb837c258ac0ec7712b3d612cc2f407e731e (patch)
treef515d16b6efd858a9aeb5b0ef5d6f90bf288283d /src/shared/idn-util.c
parentAdding debian version 255.5-1. (diff)
downloadsystemd-78e9bb837c258ac0ec7712b3d612cc2f407e731e.tar.xz
systemd-78e9bb837c258ac0ec7712b3d612cc2f407e731e.zip
Merging upstream version 256.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/shared/idn-util.c')
-rw-r--r--src/shared/idn-util.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/shared/idn-util.c b/src/shared/idn-util.c
index 26a9d60..aa88e11 100644
--- a/src/shared/idn-util.c
+++ b/src/shared/idn-util.c
@@ -16,11 +16,16 @@ static void* idn_dl = NULL;
#endif
#if HAVE_LIBIDN2
-int (*sym_idn2_lookup_u8)(const uint8_t* src, uint8_t** lookupname, int flags) = NULL;
+DLSYM_FUNCTION(idn2_lookup_u8);
const char *(*sym_idn2_strerror)(int rc) _const_ = NULL;
-int (*sym_idn2_to_unicode_8z8z)(const char * input, char ** output, int flags) = NULL;
+DLSYM_FUNCTION(idn2_to_unicode_8z8z);
int dlopen_idn(void) {
+ ELF_NOTE_DLOPEN("idn",
+ "Support for internationalized domain names",
+ ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
+ "libidn2.so.0");
+
return dlopen_many_sym_or_warn(
&idn_dl, "libidn2.so.0", LOG_DEBUG,
DLSYM_ARG(idn2_lookup_u8),
@@ -30,15 +35,20 @@ int dlopen_idn(void) {
#endif
#if HAVE_LIBIDN
-int (*sym_idna_to_ascii_4i)(const uint32_t * in, size_t inlen, char *out, int flags);
-int (*sym_idna_to_unicode_44i)(const uint32_t * in, size_t inlen, uint32_t * out, size_t * outlen, int flags);
-char* (*sym_stringprep_ucs4_to_utf8)(const uint32_t * str, ssize_t len, size_t * items_read, size_t * items_written);
-uint32_t* (*sym_stringprep_utf8_to_ucs4)(const char *str, ssize_t len, size_t *items_written);
+DLSYM_FUNCTION(idna_to_ascii_4i);
+DLSYM_FUNCTION(idna_to_unicode_44i);
+DLSYM_FUNCTION(stringprep_ucs4_to_utf8);
+DLSYM_FUNCTION(stringprep_utf8_to_ucs4);
int dlopen_idn(void) {
_cleanup_(dlclosep) void *dl = NULL;
int r;
+ ELF_NOTE_DLOPEN("idn",
+ "Support for internationalized domain names",
+ ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
+ "libidn.so.12", "libidn.so.11");
+
if (idn_dl)
return 0; /* Already loaded */