You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Graham Leggett <mi...@sharp.fm> on 2003/01/22 15:45:49 UTC

"Group" not working properly

Hi all,

While testing mod_ldap, I noticed it was creating a shared memory file 
like so:

[minfrin@jessica httpd-2.0]$ ls -al /tmp/mod_ldap_cache
-rw-r--r--    1 nobody   4294967295        4 Jan 22 14:09 
/tmp/mod_ldap_cache

The groupid is set to 4294967295 - which is bogus.

The default config file says (said) this:

User nobody
Group #-1

I am not sure whether "#-1" is being interpreted as 4294967295, or if 
this figure comes from some area of not-previously-initialised variable.

Anyone know what is going on?

Regards,
Graham
-- 
-----------------------------------------
minfrin@sharp.fm		"There's a moon
					over Bourbon Street
						tonight..."


Re: "Group" not working properly

Posted by Eli Marmor <ma...@netmask.it>.
Graham Leggett wrote:
> 
> Hi all,
> 
> While testing mod_ldap, I noticed it was creating a shared memory file
> like so:
> 
> [minfrin@jessica httpd-2.0]$ ls -al /tmp/mod_ldap_cache
> -rw-r--r--    1 nobody   4294967295        4 Jan 22 14:09
> /tmp/mod_ldap_cache
> 
> The groupid is set to 4294967295 - which is bogus.
> 
> The default config file says (said) this:
> 
> User nobody
> Group #-1
> 
> I am not sure whether "#-1" is being interpreted as 4294967295, or if
> this figure comes from some area of not-previously-initialised variable.

-1, when assigned to unsigned int of 32 bit, is indeed interpreted as
4294967295 (i.e. 2^32=4294967295+1).

May be the result of a wrong cast of signed to unsigned.

-- 
Eli Marmor
marmor@netmask.it
CTO, Founder
Netmask (El-Mar) Internet Technologies Ltd.
__________________________________________________________
Tel.:   +972-9-766-1020          8 Yad-Harutzim St.
Fax.:   +972-9-766-1314          P.O.B. 7004
Mobile: +972-50-23-7338          Kfar-Saba 44641, Israel

Re: "Group" not working properly

Posted by Greg Ames <gr...@apache.org>.
Graham Leggett wrote:
> Hi all,
> 
> While testing mod_ldap, I noticed it was creating a shared memory file 
> like so:
> 
> [minfrin@jessica httpd-2.0]$ ls -al /tmp/mod_ldap_cache
> -rw-r--r--    1 nobody   4294967295        4 Jan 22 14:09 
> /tmp/mod_ldap_cache
> 
> The groupid is set to 4294967295 - which is bogus.
> 
> The default config file says (said) this:
> 
> User nobody
> Group #-1

That #-1 has caused me grief before when testing just the httpd core on some 
platforms (OS/390? Linux? FreeBSD?...can't remember).  I'd prefer to replace it 
if we had a more portable alternative.

Greg



Re: "Group" not working properly

Posted by Graham Leggett <mi...@sharp.fm>.
Jeff Trawick wrote:

> As others mentioned, that big number has the same representation as 32-bit
> -1.  I checked a couple of systems and gid_t is unsigned 32-bit there,
> and Apache treats the number as gid_t internally.  The user can code that
> big unsigned number for group if they want to.  Operationally, the right
> thing happens either way; there is no bug.

Is it possible to put a warning in there, because 4294967295 "looks wrong".

Regards,
Graham
-- 
-----------------------------------------
minfrin@sharp.fm		"There's a moon
					over Bourbon Street
						tonight..."


Re: "Group" not working properly

Posted by Jeff Trawick <tr...@attglobal.net>.
Graham Leggett wrote:

> Hi all,
>
> While testing mod_ldap, I noticed it was creating a shared memory file
> like so:
>
> [minfrin@jessica httpd-2.0]$ ls -al /tmp/mod_ldap_cache
> -rw-r--r--    1 nobody   4294967295        4 Jan 22 14:09
> /tmp/mod_ldap_cache

As others mentioned, that big number has the same representation as 32-bit
-1.  I checked a couple of systems and gid_t is unsigned 32-bit there,
and Apache treats the number as gid_t internally.  The user can code that
big unsigned number for group if they want to.  Operationally, the right
thing happens either way; there is no bug.

Perhaps some people would rather see

Group #4294967295

instead of

Group #-1

in the default config file?

I prefer the second flavor actually (historical (i.e., google-able) and more
concise).


Re: "Group" not working properly

Posted by Cliff Woolley <jw...@virginia.edu>.
On Wed, 22 Jan 2003, Graham Leggett wrote:

> > I am not sure whether "#-1" is being interpreted as 4294967295, or if

Sure.  4294967295 = (2^32 - 1).  :-)


Re: "Group" not working properly

Posted by Graham Leggett <mi...@sharp.fm>.
Graham Leggett wrote:

> User nobody
> Group #-1
> 
> I am not sure whether "#-1" is being interpreted as 4294967295, or if 
> this figure comes from some area of not-previously-initialised variable.
> 
> Anyone know what is going on?

Forgot to mention - this is v2.0.45-dev.

Regards,
Graham
-- 
-----------------------------------------
minfrin@sharp.fm		"There's a moon
					over Bourbon Street
						tonight..."