[tpop3d-discuss]Some conditions may lead getpwuid to fail

ohp@pyrenet.fr ohp at pyrenet.fr
Mon, 2 Oct 2006 18:42:38 +0200 (MET DST)


I don't understand what you mean...
I have virtual accounts per domain, each account has the same uid per
domain with no problem...

Feel free to ask for the schema...

Regards,
On Mon, 2 Oct 2006, Giampaolo Tomassoni wrote:

> Date: Mon, 2 Oct 2006 17:08:53 +0200
> From: Giampaolo Tomassoni <g.tomassoni@libero.it>
> To: tpop3d-discuss@lists.beasts.org
> Subject: Re:  [tpop3d-discuss]Some conditions may lead getpwuid to fail
>
> No reply to this? Not even a "Blah!". :(
>
> giampaolo
>
>
> > Dears,
> >
> > I see that in many auth_ modules in tpop3d (at least auth_pgsql)
> > user authentication involves the invoking of parse_uid() from
> > util.c, followed by a getpwuid() to obtain the user's struct passwd.
> >
> > The purpose seems to me to obtain the struct passwd by allowing
> > the user database back-ends to return either a username or a uid.
> >
> > Unfortunately, this causes some troubles to me. When it is
> > difficult to assign a unique id to each user, mailbox users are
> > often given a single uid and the user itself is identified only
> > by its name, not by its uid. So, the chain parse_uid() ->
> > getpwuid() may give wrong results and should be avoided. Also, it
> > is inefficient when a username is involved, since basicly
> > parse_uid() must already obtain the passwd structure in order to
> > convert the username to its uid.
> >
> > The basic idea for a fix which doesn't impact on other cases,
> > would be to use getpwuid() only when the user field contains
> > numbers, while relaying on getpwnam() when a username is instead involved.
> >
> > A attach a small patch which fixes this for the auth_pgsql
> > module, since this is the only one I can actually test. The patch
> > adds the new function get_pw_by_name_or_uid() to util.c, which
> > basicly mimes the work of parse_uid(), but gives back a struct
> > passwd* by mean of getpwuid() or getpwnam(). In auth_pgsql.c, a
> > call to this function replaces the parse_uid() -> getpwuid() chain.
> >
> > I hope to see it in the main branch soon or later: it really
> > seems to fix my problem.
> >
> > Regards,
> >
> > -----------------------------------
> > Giampaolo Tomassoni - IT Consultant
> > Piazza VIII Aprile 1948, 4
> > I-53044 Chiusi (SI) - Italy
> > Ph: +39-0578-21100
> >
>
>
> _______________________________________________
> tpop3d-discuss mailing list
> tpop3d-discuss@lists.beasts.org
> http://lists.beasts.org/mailman/listinfo/tpop3d-discuss
>

-- 
Olivier PRENANT        	        Tel: +33-5-61-50-97-00 (Work)
15, Chemin des Monges                +33-5-61-50-97-01 (Fax)
31190 AUTERIVE                       +33-6-07-63-80-64 (GSM)
FRANCE                          Email: ohp@pyrenet.fr
------------------------------------------------------------------------------
Make your life a dream, make your dream a reality. (St Exupery)