libsubid: Fail on plugin loading if no subid_free provided
This commit is contained in:
committed by
Alejandro Colomar
parent
29dbcfbabd
commit
b620b5d0d1
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user