Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 154757 Details for
Bug 223835
net-irc/unrealircd-3.2.7-r2 failed to load commands.so on startup
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
unrealircd-3.2.7-r2-notmpmods.patch - disables copying modules before loading
unrealircd-3.2.7-r2-notmpmods.patch (text/plain), 4.49 KB, created by
Chris Frederick
on 2008-05-29 22:06:01 UTC
(
hide
)
Description:
unrealircd-3.2.7-r2-notmpmods.patch - disables copying modules before loading
Filename:
MIME Type:
Creator:
Chris Frederick
Created:
2008-05-29 22:06:01 UTC
Size:
4.49 KB
patch
obsolete
>--- Unreal3.2.7/src/ircd.c.orig 2008-05-29 15:27:28.000000000 -0500 >+++ Unreal3.2.7/src/ircd.c 2008-05-29 15:27:52.000000000 -0500 >@@ -1263,7 +1263,9 @@ > initlists(); > initwhowas(); > initstats(); >+#ifdef COPY_MODULE_ONLOAD > DeleteTempModules(); >+#endif > booted = FALSE; > /* Hack to stop people from being able to read the config file */ > #if !defined(_WIN32) && !defined(_AMIGA) && DEFAULT_PERMISSIONS != 0 >--- Unreal3.2.7/src/modules.c.orig 2008-05-29 14:28:59.000000000 -0500 >+++ Unreal3.2.7/src/modules.c 2008-05-29 15:26:24.000000000 -0500 >@@ -173,6 +173,7 @@ > #endif > > >+#ifdef COPY_MODULE_ONLOAD > void DeleteTempModules(void) > { > char tempbuf[PATH_MAX+1]; >@@ -221,6 +222,7 @@ > FindClose(hFile); > #endif > } >+#endif > > void Module_Init(void) > { >@@ -322,10 +324,16 @@ > path_)); > path = path_; > >- >+#ifdef COPY_MODULE_ONLOAD >+ /* running on linux using grsecurity's trusted path execution will prevent >+ * module loading from the /tmp folder due to the module not being owned >+ * by root. Define COPY_MODULE_ONLOAD if you wish to use the unreal functions >+ * to copy the module before loading it. >+ */ > tmppath = unreal_mktemp("tmp", unreal_getfilename(path)); > if (!tmppath) > return "Unable to create temporary file!"; >+#endif > if(!strchr(path, '/')) > { > path = MyMalloc(strlen(path) + 3); >@@ -338,6 +346,12 @@ > snprintf(errorbuf, sizeof(errorbuf), "Cannot open module file: %s", strerror(errno)); > return errorbuf; > } >+#ifdef COPY_MODULE_ONLOAD >+ /* running on linux using grsecurity's trusted path execution will prevent >+ * module loading from the /tmp folder due to the module not being owned >+ * by root. Define COPY_MODULE_ONLOAD if you wish to use the unreal functions >+ * to copy the module before loading it. >+ */ > #ifdef __OpenBSD__ > /* For OpenBSD, do not do a hardlinkink attempt first because it checks inode > * numbers to see if a certain module is already loaded. -- Syzop >@@ -351,6 +365,9 @@ > snprintf(errorbuf, sizeof(errorbuf), "Failed to copy module file."); > return errorbuf; > } >+#else >+ tmppath = path; >+#endif > if ((Mod = irc_dlopen(tmppath, RTLD_NOW))) > { > /* We have engaged the borg cube. Scan for lifesigns. */ >@@ -361,7 +378,9 @@ > "Module was compiled for '%s', we were configured for '%s'. SOLUTION: Recompile the module(s).", > Mod_Version, expectedmodversion); > irc_dlclose(Mod); >+#ifdef COPY_MODULE_ONLOAD > remove(tmppath); >+#endif > return errorbuf; > } > if (!Mod_Version) >@@ -369,7 +388,9 @@ > snprintf(errorbuf, sizeof(errorbuf), > "Module is lacking Mod_Version. Perhaps a very old one you forgot to recompile?"); > irc_dlclose(Mod); >+#ifdef COPY_MODULE_ONLOAD > remove(tmppath); >+#endif > return errorbuf; > } > irc_dlsym(Mod, "compiler_version", compiler_version); >@@ -382,20 +403,26 @@ > "Module was compiled with GCC %s, core was compiled with GCC %s. SOLUTION: Recompile your UnrealIRCd and all it's modules by doing a 'make clean; ./Config -quick && make'.", > theyhad, wehave); > irc_dlclose(Mod); >+#ifdef COPY_MODULE_ONLOAD > remove(tmppath); >+#endif > return errorbuf; > } > irc_dlsym(Mod, "Mod_Header", mod_header); > if (!mod_header) > { > irc_dlclose(Mod); >+#ifdef COPY_MODULE_ONLOAD > remove(tmppath); >+#endif > return ("Unable to locate Mod_Header"); > } > if (!mod_header->modversion) > { > irc_dlclose(Mod); >+#ifdef COPY_MODULE_ONLOAD > remove(tmppath); >+#endif > return ("Lacking mod_header->modversion"); > } > if (!(modsys_ver = parse_modsys_version(mod_header->modversion))) >@@ -403,20 +430,26 @@ > snprintf(errorbuf, 1023, "Unsupported module system version '%s'", > mod_header->modversion); > irc_dlclose(Mod); >+#ifdef COPY_MODULE_ONLOAD > remove(tmppath); >+#endif > return(errorbuf); > } > if (!mod_header->name || !mod_header->version || > !mod_header->description) > { > irc_dlclose(Mod); >+#ifdef COPY_MODULE_ONLOAD > remove(tmppath); >+#endif > return("Lacking sane header pointer"); > } > if (Module_Find(mod_header->name)) > { > irc_dlclose(Mod); >+#ifdef COPY_MODULE_ONLOAD > remove(tmppath); >+#endif > return (NULL); > } > mod = (Module *)Module_make(mod_header, Mod); >@@ -699,7 +732,9 @@ > } > DelListItem(mi,Modules); > irc_dlclose(mi->dll); >+#ifdef COPY_MODULE_ONLOAD > remove(mi->tmp_file); >+#endif > MyFree(mi->tmp_file); > MyFree(mi); > } >@@ -1556,7 +1591,9 @@ > irc_dlsym(m->dll, "Mod_Unload", Mod_Unload); > if (Mod_Unload) > (*Mod_Unload)(0); >+#ifdef COPY_MODULE_ONLOAD > remove(m->tmp_file); >+#endif > } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 223835
:
154485
| 154757