Skip to content

Commit

Permalink
Fix module export for get_user_from_member (#1633)
Browse files Browse the repository at this point in the history
Found by: Mystery-X
Patch by: thommey

Also enable RTLD_NOW linking so module loading fails as early as possible.
  • Loading branch information
thommey authored Jun 30, 2024
1 parent ee8b2d3 commit 5c34bd6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/mod/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@ typedef void (*chanout_butfunc)(int, int, const char *, ...) ATTRIBUTE_FORMAT(pr
#define lookup_user_record ((struct userrec * (*)(memberlist *, char *, char *))global[323])
/* 324 - 327 */
#define find_member_from_nick ((memberlist * (*) (char *))global[324])
#define get_user_from_member ((struct userrec * (*) (memberlist *))global[325])


/* hostmasking */
Expand Down
9 changes: 3 additions & 6 deletions src/modules.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,7 @@
# ifndef RTLD_NOW
# define RTLD_NOW 1
# endif
# ifdef RTLD_LAZY
# define DLFLAGS RTLD_LAZY|RTLD_GLOBAL
# else
# define DLFLAGS RTLD_NOW|RTLD_GLOBAL
# endif
# define DLFLAGS RTLD_NOW|RTLD_GLOBAL
# endif /* MOD_USE_DL */
#endif /* !STATIC */

Expand Down Expand Up @@ -629,7 +625,8 @@ Function global_table[] = {
(Function) & argv0,
(Function) lookup_user_record,
/* 324 - 327 */
(Function) find_member_from_nick
(Function) find_member_from_nick,
(Function) get_user_from_member,
};

void init_modules(void)
Expand Down

0 comments on commit 5c34bd6

Please sign in to comment.