uid/gid with auth_mysql (was: Re: [tpop3d-discuss] Using maildir)

Chris Lightfoot chris at ex-parrot.com
Mon, 13 Aug 2001 00:43:06 +0100


On Mon, Aug 13, 2001 at 01:37:13AM +0200, Jakob Hirsch wrote:
> Hello one more time,
> 
> > might be desirable. That's why auth-other and auth-perl
> > exist. It would not be difficult to modify the auth_mysql
> 
> I need one of these two while migrating the old pop3-mailboxes with
> standard unix-names to user@domain-logins (in fact it's only changing
> the client-config since I can the same pop3-mailbox with both
> authentication methods). But now I have problems with this two (as said
> before, tpop3d 1.3.4):
> 
> - auth-perl works after a little tweaking, but it seems that the
> uid/gid-results are not correctly used. My script returns them like the
> examples in the script-directory:
> return { 'result' => 'YES', 'logmsg' => 'authenticated user',
>     'uid' => 'vmail', 'gid' => 'mail',
>     'mboxtype' => 'maildir', 'mailbox' => '/var/spool/mail/test/user' };
> (mailbox is hardcoded for test purposes)
> 
> but the log always says:
> authcontext_new_user_pass: began session for `jh' with perl; uid 12, gid
> 0
> A little testing gave, that he puts the gid (group mail is 12 on my
> system) I gave into the uid-field and set's gid to 0 everytime. I looked
> into the sources, but found nothing special (I'm no C programmer, so
> ...).

Apologies. This is indeed a bug. On line 321 of
auth_perl.c, replace

        else if (!parse_gid(I->v, &uid)) INVALID("gid", (char*)I->v);
 
with

        else if (!parse_gid(I->v, &gid)) INVALID("gid", (char*)I->v);

I will release a new version to fix this fairly shortly.

I can't at present help with the auth-other problem you've
reported, but I will investigate it.

-- 
Chris Lightfoot -- www.ex-parrot.com/~chris/
 A bureaucrat's idea of cleaning up his files is
 to make a copy of everything before he destroys it