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

Re: add user ?




On Fri, 21 Feb 1997, Dave Kinchlea wrote:
> Well, looking at the source in PAM 0.56/modules/pam_unix/pam_unix_passwd.c, 
> I note that it is done wrong (in my view), it uses fcntl(/etc/.pwd.lock)
> but it doesn't fail if /etc/.pwd.lock already exists (which means that it
> won't honour adduser's lock). It ought to use open(O_CREAT|O_EXCL) but it
> doesn't. This explains the behaviour you are seeing.

I have PAM 0.50 and I also looked at /modules/pam_unix/pam_unix_passwd.c,
but i didn't notice any flocking (or calling fcntl) in it.
Here is this file ...

#include <stdlib.h>
#include <stdio.h>
#include <syslog.h>
#ifndef LINUX    /* AGM added this as of 0.2 */
#include <security/pam_appl.h>
#endif           /* ditto */
#include <security/pam_modules.h>

static char rcsid[] = "$Id: pam_unix_passwd.c,v 1.1 1996/03/09 09:10:57 morgan Exp $ (C) Alexander O. Yuriev";


int _pam_unix_chauthtok( int flags, int argc, const char **argv );

int _pam_unix_chauthtok( int glags, int argc, const char **argv )
{
	syslog( LOG_DEBUG, 
		"_pam_unix_chauthtok() is not implemented. Returning PAM_SUCCESS ");
	return PAM_SUCCESS;
}



int pam_sm_chauthtok(	pam_handle_t *pamh, 
			int flags,
			int argc, 
			const char **argv)
{
    return ( _pam_unix_chauthtok( flags, argc, argv ) );
}

__________________________
Can you tell me what does pam exactly do to lock /etc/passwd ?

Thank yopu for help :)

Sasha



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