Re: initgroups() failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dan,

Thanks for replying. Unfortunately, there are no related messages in Console.app. System.log also does not raise any red flags. I would really like to find out (but don't know exactly how to go about it) is whether the initgroups() call is failing because of not being called by the super-user or because of something else. I wrote a small C program that called initgroups and tried calling it when httpd was working correctly as well as after it had crashed due to the initgroups() failure. In both cases, the initgroups call in my program returned successfully (0) when the program was called with a sudo.

The following is a small snippet of the code I threw together:

gid_t *gids, gid;
int ngroups;

gid = (gid_t) <group id>;
int ret = initgroups("<user>", gid);

It may also be important to note that the user and group that I have defined in Apache are NOT the standard (_)www/(_)www or daemon/daemon users. However, the user I set httpd to run as, is a member of the group that apache is running as. Also, the crash occurs regardless of what user/group combination I use, so I'm not sure if that narrows down the problem at all.

Again, thanks for replying and any thoughts/suggestions would be greatly appreciated.

Thanks,
-AS


On Thu, Oct 9, 2008 at 5:41 AM, Dan Poirier <poirier@xxxxxxxxx> wrote:
Eric Covener said the following on 10/08/2008 10:43 PM:

On Wed, Oct 8, 2008 at 10:01 PM, Arvind Shenoy <ashenoy2985@xxxxxxxxx> wrote:
Hello,
I recently installed httpd-2.2.9 (with LDAP and SSL) on my Mac OS X 10.5.4
box. Everything went very smoothly except for one thing; Apache keeps
shutting down due to the following initgroups failures:
[Wed Sep 24 19:02:11 2008] [alert] (2)No such file or directory: initgroups:
unable to set groups for User <user> and Group <gid>
and
[Wed Oct 08 15:00:48 2008] [alert] (22)Invalid argument: initgroups: unable
to set groups for User <user> and Group <gid>

trivia that may help, I've seen initgroups() crash when LDAP is used
on linux from nsswitch.conf and Apache is linked with some other LDAP.

Does initgroups have anything interesting in the manual your system
for those errno values?


The man page for initgroups on Mac OS X says only:  The initgroups() function returns -1 if it was not invoked by the superuser.  But
looking at the code, there are other possible causes.

Arvind, have you checked the console for any messages that Mac OS X
might have logged at the time of the problem?  If directory services
is having problems, it might log them there.
(/Applications/Utilities/Console.app).



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
 "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux