2 ** Copyright 2000-2004 Double Precision, Inc. See COPYING for
3 ** distribution information.
7 #include "authstaticlist.h"
8 #include "courierauthsasl.h"
10 #include "courierauthdebug.h"
18 #include <sys/select.h>
19 #include "numlib/numlib.h"
20 #include "authchangepwdir.h"
22 static const char rcsid
[]="$Id: authmoduser2.c,v 1.9 2004/11/17 01:16:00 mrsam Exp $";
24 extern int authdaemondopasswd(char *, int);
26 static int badstr(const char *p
)
31 if ((int)(unsigned char)*p
< ' ')
38 int auth_passwd(const char *service
,
45 if (badstr(service
) || badstr(uid
) || badstr(opwd
) || badstr(npwd
))
51 buf
=malloc(strlen(service
)+strlen(uid
)+strlen(opwd
)+
57 sprintf(buf
, "PASSWD %s\t%s\t%s\t%s\n",
58 service
, uid
, opwd
, npwd
);
60 if (authdaemondopasswd(buf
, strlen(buf
)))