[mpm-itk] Access to ap_has_irreversibly_setuid from a third party module

Jean Weisbuch jean at phpnet.org
Wed Jan 18 13:39:26 UTC 2017

I need to access to "ap_has_irreversibly_setuid" from a third party 
right now it does that :

    if (vhr->itk_enable) {
    	module *mpm_itk_module = ap_find_linked_module("mpm_itk.c");
    	if (mpm_itk_module == NULL) {
    		ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, "vhs_itk_post_read: mpm_itk.c is not loaded");

    	extern AP_DECLARE_DATA int ap_has_irreversibly_setuid;
    	// If ITK already dropped the privileges for this connection and this virtualhost needs yet another UID/GID, it will close the connection so the client can open a new connection for this query ##
    	if (ap_has_irreversibly_setuid) {

vhr->itk_enable is set by a configuration directive to enable the itk 
support of the module (which is optional).

The problem is that if the mpm_itk module is not loaded, httpd returns a 
fatal error even if the itk support of the module has been set to Off :

    |httpd: Syntax error on line XXX of httpd.conf: Syntax error on line
    XX of httpd.conf: Cannot load modules/mod_vhs.so into server:
    XXX/mod_vhs.so: undefined symbol: ap_has_irreversibly_setuid|

Is there a way to avoid this error without having to compile the module 
with itk support disabled so the module could be "distributed" and used 
on setup that might or might not have itk loaded or that unloading the 
itk module wont break the service?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.err.no/pipermail/mpm-itk/attachments/20170118/54c939c1/attachment.html>

More information about the mpm-itk mailing list