libsubid: Fail on plugin loading if no subid_free provided

This commit is contained in:
Daniel Bershatsky
2024-06-12 21:45:31 +02:00
committed by Alejandro Colomar
parent 29dbcfbabd
commit b620b5d0d1
2 changed files with 6 additions and 2 deletions
+2 -2
View File
@@ -133,8 +133,8 @@ void nss_init(const char *nsswitch_path) {
}
subid_nss->free = dlsym(h, "shadow_subid_free");
if (!subid_nss->free) {
// Fallback to free(3) for backward compatibility.
subid_nss->free = free;
fprintf(shadow_logfd, "%s did not provide @subid_free@\n", libname);
goto close_lib;
}
subid_nss->handle = h;
goto done;
+4
View File
@@ -138,3 +138,7 @@ enum subid_status shadow_subid_list_owner_ranges(const char *owner, enum subid_t
return SUBID_STATUS_SUCCESS;
}
void shadow_subid_free(void *ptr) {
free(ptr);
}