why is (gid_t)-1 treated as a group mapping failure?

James Peach jpeach at samba.org
Wed May 2 18:13:45 GMT 2007


On 01/05/2007, at 7:22 PM, Gerald (Jerry) Carter wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> James Peach wrote:
>> Hi all,
>>
>> There's a bunch of code sprinkled throughout the
>> passdb layer(s) that asserts that -1 cannot be a valid
>> ID.
>
> It's a hack to allow the nss_info layer to return
> a primary group id and override the Windows primary
> group (e.g gidNumber attribute in posixAccount for RFC2307).

So the idea is that when you get an account with gid == -1, you  
allocate a local gid for it using the idmap allocate backend?

> - -1 seemed a better choice than 0.

Yeh, this makes sense, as chown(2) also regards -1 as an invalid GID.

--
James Peach | jpeach at samba.org



More information about the samba-technical mailing list