dlopen-tests.c revision 889706cbc739358c2a0aac2ba6bc054fdc8e048b
d27b1887e61f1dc53d77c37f59dbf5019242a686Christian Maeder Simo Sorce <simo@redhat.com>
d27b1887e61f1dc53d77c37f59dbf5019242a686Christian Maeder Copyright (C) 2013 Red Hat
d27b1887e61f1dc53d77c37f59dbf5019242a686Christian Maeder This program is free software; you can redistribute it and/or modify
d27b1887e61f1dc53d77c37f59dbf5019242a686Christian Maeder it under the terms of the GNU General Public License as published by
99b26e2ab8ba89bc9a050c1524137eb6269e2753Christian Maeder the Free Software Foundation; either version 3 of the License, or
18548c6cc2dff13bf9f5f08b3f6cde6ca914df1dChristian Maeder (at your option) any later version.
d27b1887e61f1dc53d77c37f59dbf5019242a686Christian Maeder This program is distributed in the hope that it will be useful,
d27b1887e61f1dc53d77c37f59dbf5019242a686Christian Maeder but WITHOUT ANY WARRANTY; without even the implied warranty of
ef1c24c8229ade3ac872febebd18c181e32fb9c4Christian Maeder MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8d2321e17a34951fbd52f68e9f9f148f0890e471Christian Maeder GNU General Public License for more details.
99b26e2ab8ba89bc9a050c1524137eb6269e2753Christian Maeder You should have received a copy of the GNU General Public License
986888e7f4d8ed681272a79c63f329ce8037063dcmaeder along with this program. If not, see <http://www.gnu.org/licenses/>.
275698320a734a6fd647ea6a461d6ce38862da1dChristian Maeder { "libsss_debug.so", { LIBPFX"libsss_debug.so", NULL } },
ef1c24c8229ade3ac872febebd18c181e32fb9c4Christian Maeder { "libsss_semanage.so", { LIBPFX"libsss_semanage.so", NULL } },
ef1c24c8229ade3ac872febebd18c181e32fb9c4Christian Maeder { "libipa_hbac.so", { LIBPFX"libipa_hbac.so", NULL } },
7c99a6c982aaf61547de8054296c8055c8d1a13aSimon Ulbricht { "libsss_idmap.so", { LIBPFX"libsss_idmap.so", NULL } },
ef1c24c8229ade3ac872febebd18c181e32fb9c4Christian Maeder { "libsss_nss_idmap.so", { LIBPFX"libsss_nss_idmap.so", NULL } },
024703c9d1326c23e307c0b0d453ed3358e87fe4cmaeder { "libnss_sss.so", { LIBPFX"libnss_sss.so", NULL } },
d97700a22b2585ece83b05f3fff945fdfd0c44b4Christian Maeder { "pam_sss.so", { LIBPFX"pam_sss.so", NULL } },
ea5ccb1c6e89486a54e1f4bd95840147e96093edChristian Maeder { "libwbclient.so", { LIBPFX"libwbclient.so", NULL } },
de8eee2014437ec4020be15cd363257f87e79943Christian Maeder#endif /* BUILD_LIBWBCLIENT */
fd94a6f66ccb5cef99aa42069b61e4b8734dbd3fChristian Maeder { "libsss_simpleifp.so", { LIBPFX"libsss_simpleifp.so", NULL } },
fd94a6f66ccb5cef99aa42069b61e4b8734dbd3fChristian Maeder#endif /* BUILD_IFP */
275698320a734a6fd647ea6a461d6ce38862da1dChristian Maeder { "libsss_sudo.so", { LIBPFX"libsss_sudo.so", NULL } },
473f5af6e4803fbeecc814065952396f2501039bChristian Maeder { "libsss_autofs.so", { LIBPFX"libsss_autofs.so", NULL } },
473f5af6e4803fbeecc814065952396f2501039bChristian Maeder { "sssd_krb5_locator_plugin.so", { LIBPFX"sssd_krb5_locator_plugin.so",
275698320a734a6fd647ea6a461d6ce38862da1dChristian Maeder { "sssd_krb5_localauth_plugin.so", { LIBPFX"sssd_krb5_localauth_plugin.so",
ea5ccb1c6e89486a54e1f4bd95840147e96093edChristian Maeder { "sssd_pac_plugin.so", { LIBPFX"sssd_pac_plugin.so", NULL } },
024703c9d1326c23e307c0b0d453ed3358e87fe4cmaeder { "cifs_idmap_sss.so", { LIBPFX"cifs_idmap_sss.so", NULL } },
df67ddf64192bfcae6ece65255ad796a17cbe532Christian Maeder { "memberof.so", { LIBPFX"memberof.so", NULL } },
3e87e1dc85fa76cc6eaeb8eafbc0bea77af939f4Christian Maeder { "libsss_child.so", { LIBPFX"libsss_util.so",
275698320a734a6fd647ea6a461d6ce38862da1dChristian Maeder { "libsss_crypt.so", { LIBPFX"libsss_crypt.so", NULL } },
526e7f36639cb58e3c99a54bea082499a6b04a25Christian Maeder { "libsss_util.so", { LIBPFX"libsss_util.so", NULL } },
473f5af6e4803fbeecc814065952396f2501039bChristian Maeder { "libsss_simple.so", { LIBPFX"libdlopen_test_providers.so",
526e7f36639cb58e3c99a54bea082499a6b04a25Christian Maeder { "libsss_ad.so", { LIBPFX"libdlopen_test_providers.so",
18548c6cc2dff13bf9f5f08b3f6cde6ca914df1dChristian Maeder { "libsss_ipa.so", { LIBPFX"libdlopen_test_providers.so",
275698320a734a6fd647ea6a461d6ce38862da1dChristian Maeder#endif /* BUILD_SAMBA */
18548c6cc2dff13bf9f5f08b3f6cde6ca914df1dChristian Maeder { "libsss_krb5.so", { LIBPFX"libdlopen_test_providers.so",
f56cdf11927c31495bae642a9eb383212c90ba61Christian Maeder { "libsss_krb5_common.so", { LIBPFX"libdlopen_test_providers.so",
2e2559f894aaa661b199e4fa00609f522bc5482aSimon Ulbricht { "libsss_ldap.so", { LIBPFX"libdlopen_test_providers.so",
be1ce1c2b2819ef32743136c13101f1927375311Christian Maeder { "libsss_ldap_common.so", { LIBPFX"libdlopen_test_providers.so",
275698320a734a6fd647ea6a461d6ce38862da1dChristian Maeder { "libsss_proxy.so", { LIBPFX"libdlopen_test_providers.so",
526e7f36639cb58e3c99a54bea082499a6b04a25Christian Maeder { "libdlopen_test_providers.so", { LIBPFX"libdlopen_test_providers.so",
3e87e1dc85fa76cc6eaeb8eafbc0bea77af939f4Christian Maeder { "_py2hbac.so", { LIBPFX"_py2hbac.so", NULL } },
275698320a734a6fd647ea6a461d6ce38862da1dChristian Maeder { "_py2sss.so", { LIBPFX"_py2sss.so", NULL } },
6a6689ad6d4c70af2ce3389f39a50982f20fd939Christian Maeder { "_py2sss_murmur.so", { LIBPFX"_py2sss_murmur.so", NULL } },
6a6689ad6d4c70af2ce3389f39a50982f20fd939Christian Maeder { "_py2sss_nss_idmap.so", { LIBPFX"_py2sss_nss_idmap.so", NULL } },
e98c3d3efab62d97ebdeed52f4109d961f6432aaChristian Maeder { "_py3hbac.so", { LIBPFX"_py3hbac.so", NULL } },
eca54dc24f2c59cc51645115347a89ba2b40de36cmaeder { "_py3sss_murmur.so", { LIBPFX"_py3sss_murmur.so", NULL } },
eca54dc24f2c59cc51645115347a89ba2b40de36cmaeder { "_py3sss_nss_idmap.so", { LIBPFX"_py3sss_nss_idmap.so", NULL } },
26acf851cacd7a31bdc9b25a42af9949942fa7c6Christian Maeder { "libsss_config.so", { LIBPFX"libsss_config.so", NULL } },
5fb6343a5a2b4bbc67bc83479c84a92d23d30edfChristian Maederstatic bool recursive_dlopen(const char **name, int round, char **errmsg)
18548c6cc2dff13bf9f5f08b3f6cde6ca914df1dChristian Maeder handle = dlopen(name[round], RTLD_GLOBAL|RTLD_NOW);
6a6689ad6d4c70af2ce3389f39a50982f20fd939Christian Maeder if (asprintf(errmsg, "dlopen() failed: %s", dlerror()) == -1)
12882fa70d12d9b56cbd850ccb4b724feb3c62d5Christian Maeder return false;
9f4902edfa3d477e42343e0ec357a2f93b1119d1Christian Maeder ok = recursive_dlopen(name, round, errmsg);
8723ec450f2e7a024230467c0c28a3f154905483cmaeder fail_unless(ok, "Error opening %s: [%s]", so[i].name, errmsg);