Re: username input filter (where to insert)



On Tue, Aug 05, 2003 at 02:45:15PM -0700, Mike Oliver wrote:
> DC <dc dcarr org> wrote:
> > [...] I want to insert a quick little filter into gdm that 
> > will take whatever the user typed as username (user string) and replace 
> > all spaces with underscores and then pass the username along.  This 
> > needs to take place before the username information is passed to PAM.  
> > My question is: Where is the best place (which function/sourcefile) to 
> > add my filter?  I've been looking at gdm_login.c but my C is not as good 
> > as that of the authors' of the file.
> 
> The best place is in your own PAM authentication module, which would
> call pam_get_user(), then mangle the resulting username according to
> whatever algorithm you want, then use pam_set_item(PAM_USER) to make
> the modified name visible to subsequent modules.  Insert this module at
> the top of the PAM 'auth' list for GDM.  Not only does this get you out
> of the business of hacking on the GDM source, it also solves the issue
> for any other PAM-aware login mechanism -- ssh, telnet, rsh, ftp and so
> on.
> 
> If you're not up to speed with PAM then an easy way to go would be to
> start with the source for whichever existing PAM module it is that
> calls pam_get_user() which causes GDM's conversation function to be
> invoked if the user name is not already known.  That's usually
> /usr/lib/security/pam_unix.so.

Do note though that this only applies to the devel version of GDM.

Which I suppose is just as stable as the stable version actually, so I'd
recommend using it anyway.  It doesn't require any new devel stuff except
that it requires a new libart and that's because you really want to get a
new libart since there are crashing bugs that affect gdm.

George

-- 
George <jirka 5z com>
   As long as people will accept crap, 
   it will be financially profitable to dispense it.
                       -- Dick Cavett, in "Playboy", 1971



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