mind04 / mod-ruid2

mod_ruid2 is a suexec module for apache which takes advantage of POSIX.1e capabilities to increase performance.
Apache License 2.0
57 stars 22 forks source link

Centos 6 with Kernel 3.10 ruid_setup>ruid_set_perm:setgid(48) failed #12

Open getchudez opened 9 years ago

getchudez commented 9 years ago

Hello, I'm using mod_ruid2 for a long time and this is the first time that I'm having issue. I'm installing a new server to replace an old one. I installed mod_ruid2 using yum

mod_ruid2-0.9.8-2.el6.x86_64

After the installation I've configured on the following way one of the virtual host

<Directory /var/www/vhosts/MYDOMAIN.COM/httpdocs> RMode config RUidGid mydomain psacln RGroups psacln

But when I'm trying to test my website i'm getting the following error at /var/log/httpd/error_log

[Tue Jul 07 12:48:44 2015] [error] mod_ruid2 www.MYDOMAIN.COM GET / HTTP/1.0 ruid_setup>ruid_set_perm:setgid(48) failed. getgid=48 getuid=48

My server doesn't have SELinux configured, in fact it's disabled. I checked the source code and found the lines where it's giving error Line 523, where is checking if setgid(gid) is 0

    if (setgid(gid) != 0)
    {
            ap_log_error (APLOG_MARK, APLOG_ERR, 0, NULL, "%s %s %s %s>%s:setgid(%d) failed. getgid=%d getuid=%d", MODULE_NAME, ap_get_server_name(r), r->the_request, from_func, __func__, dconf->ruid_gid, getgid(), getuid());
            retval = HTTP_FORBIDDEN;
    } else {
            if (setuid(uid) != 0)
            {
                    ap_log_error (APLOG_MARK, APLOG_ERR, 0, NULL, "%s %s %s %s>%s:setuid(%d) failed. getuid=%d", MODULE_NAME, ap_get_server_name(r), r->the_request, from_func, __func__, dconf->ruid_uid, getuid());
                    retval = HTTP_FORBIDDEN;
            }
    }

My question is, is there any chance that Kernel 3.x are blocking some action at this module? I couldn't find the same issue at internet.

UPDATE: I've been able to install a kernel 2.6.X and it's working without problem but now I'm beeing crazy trying to understand/find why it's not working with kernel 3.10.X

sandormarton commented 8 years ago

Have seen this error on new boxes, where i migrated working setups from old ( but both had same OS/Apache/PHP version, but do to being different provider, they did run different kernel - can't tell now which exactly ). Non working setup was like this :

<VirtualHost ..>
 ...
 <Directory /abc/com>
  Mode config
  RUidGid some thing
  ...
 </Directory >
</VirtualHost>

Once i moved ruid2 config outside of Directory, started working without changing kernel :

<VirtualHost ..>
 ...

 Mode config
 RUidGid some thing
 <Directory /abc/com>
  ...
 </Directory >
</VirtualHost>

While its not an equivalent config, it may help someone.