Skip to content

Commit 05a7f4e

Browse files
committed
mysql_adaptor: unexpose dlsym API/service names
1 parent e01b0e8 commit 05a7f4e

File tree

3 files changed

+2
-40
lines changed

3 files changed

+2
-40
lines changed

Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ libgxs_mysql_adaptor_la_LIBADD = -lpthread ${crypt_LIBS} ${libHX_LIBS} ${fmt_LIB
181181
EXTRA_libgxs_mysql_adaptor_la_DEPENDENCIES = default.sym
182182
libgxs_ruleproc_la_SOURCES = lib/ruleproc.cpp
183183
libgxs_ruleproc_la_LDFLAGS = ${default_SYFLAGS}
184-
libgxs_ruleproc_la_LIBADD = ${vmime_LIBS} libgromox_common.la libgromox_exrpc.la
184+
libgxs_ruleproc_la_LIBADD = ${vmime_LIBS} libgromox_common.la libgromox_exrpc.la libgxs_mysql_adaptor.la
185185
EXTRA_libgxs_ruleproc_la_DEPENDENCIES = ${default_SYM}
186186

187187
cgkrepair_SOURCES = tools/cgkrepair.cpp tools/genimport.cpp tools/genimport.hpp

exch/mysql_adaptor/sql2.cpp

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -713,40 +713,5 @@ BOOL SVC_mysql_adaptor(enum plugin_op reason, const struct dlfuncs &data)
713713
mlog(LV_ERR, "mysql_adaptor: failed to startup");
714714
return false;
715715
}
716-
#define E(f, s) do { \
717-
if (!register_service((s), mysql_adaptor_ ## f)) { \
718-
mlog(LV_ERR, "mysql_adaptor: failed to register the \"%s\" service", (s)); \
719-
return false; \
720-
} \
721-
} while (false)
722-
E(meta, "mysql_auth_meta");
723-
E(login2, "mysql_auth_login2");
724-
E(setpasswd, "set_password");
725-
E(get_username_from_id, "get_username_from_id");
726-
E(get_id_from_maildir, "get_id_from_maildir");
727-
E(get_user_displayname, "get_user_displayname");
728-
E(get_user_privilege_bits, "get_user_privilege_bits");
729-
E(set_user_lang, "set_user_lang");
730-
E(set_timezone, "set_timezone");
731-
E(get_homedir, "get_homedir");
732-
E(get_homedir_by_id, "get_homedir_by_id");
733-
E(get_id_from_homedir, "get_id_from_homedir");
734-
E(get_user_ids, "get_user_ids");
735-
E(get_domain_ids, "get_domain_ids");
736-
E(get_org_domains, "get_org_domains");
737-
E(get_domain_info, "get_domain_info");
738-
E(check_same_org, "check_same_org");
739-
E(get_domain_groups, "get_domain_groups");
740-
E(get_group_users, "get_group_users");
741-
E(get_domain_users, "get_domain_users");
742-
E(check_mlist_include, "check_mlist_include");
743-
E(check_same_org2, "check_same_org2");
744-
E(get_mlist_memb, "get_mlist_memb");
745-
E(get_user_aliases, "get_user_aliases");
746-
E(get_user_properties, "get_user_properties");
747-
E(scndstore_hints, "scndstore_hints");
748-
E(domain_list_query, "domain_list_query");
749-
E(get_homeserver, "get_homeserver");
750-
#undef E
751716
return TRUE;
752717
}

lib/ruleproc.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ struct rxparam {
140140
}
141141

142142
unsigned int g_ruleproc_debug;
143-
static bool (*rp_getuserprops)(const char *, TPROPVAL_ARRAY &);
144143
static std::string rp_smtp_url;
145144
static thread_local alloc_context rp_alloc_ctx;
146145
static thread_local const char *rp_storedir;
@@ -875,7 +874,7 @@ static ec_error_t opx_process(rxparam &par, const rule_node &rule)
875874
static ec_error_t mr_get_policy(const char *ev_to, mr_policy &pol)
876875
{
877876
TPROPVAL_ARRAY uprop{};
878-
if (!rp_getuserprops(ev_to, uprop))
877+
if (!mysql_adaptor_get_user_properties(ev_to, uprop))
879878
return ecError;
880879
auto flag = uprop.get<const uint8_t>(PR_SCHDINFO_DISALLOW_OVERLAPPING_APPTS);
881880
pol.decline_overlap = flag != nullptr && *flag != 0;
@@ -1278,8 +1277,6 @@ BOOL SVC_ruleproc(enum plugin_op reason, const struct dlfuncs &param)
12781277
if (reason != PLUGIN_INIT)
12791278
return TRUE;
12801279
LINK_SVC_API(param);
1281-
if (query_service2("get_user_properties", rp_getuserprops) == nullptr)
1282-
return false;
12831280
if (!register_service("rules_execute", exmdb_local_rules_execute))
12841281
return false;
12851282
auto cfg = config_file_prg(nullptr, "gromox.cfg", rp_config_defaults);

0 commit comments

Comments
 (0)