X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=blobdiff_plain;f=etc%2Fuams%2Fuams_passwd.c;h=3e8333b0fc80252798979833b4206ba5f3590ea0;hp=5fcdce5661eaf95fa04160b75d6816bf90c50008;hb=75fe310224dffb96868d7f2cb1ec9125a84f2a08;hpb=3adfc34b14bf40a472c82eb328b9c3160df7e127 diff --git a/etc/uams/uams_passwd.c b/etc/uams/uams_passwd.c index 5fcdce56..3e8333b0 100644 --- a/etc/uams/uams_passwd.c +++ b/etc/uams/uams_passwd.c @@ -1,5 +1,5 @@ /* - * $Id: uams_passwd.c,v 1.25 2009-09-14 00:02:21 didg Exp $ + * $Id: uams_passwd.c,v 1.28 2009-11-05 14:38:07 franklahm Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) @@ -68,14 +68,16 @@ char *strchr (), *strrchr (); #include #include -static char *clientname; +static const char *clientname; #endif /* TRU64 */ -extern void append(void *, const char *, int); +/*XXX in etc/papd/file.h */ +struct papfile; +extern void append(struct papfile *, const char *, int); static int pwd_login(void *obj, char *username, int ulen, struct passwd **uam_pwd, - char *ibuf, int ibuflen, - char *rbuf _U_, int *rbuflen _U_) + char *ibuf, size_t ibuflen, + char *rbuf _U_, size_t *rbuflen _U_) { char *p; struct passwd *pwd; @@ -156,11 +158,11 @@ static int pwd_login(void *obj, char *username, int ulen, struct passwd **uam_pw /* cleartxt login */ static int passwd_login(void *obj, struct passwd **uam_pwd, - char *ibuf, int ibuflen, - char *rbuf, int *rbuflen) + char *ibuf, size_t ibuflen, + char *rbuf, size_t *rbuflen) { char *username; - int len, ulen; + size_t len, ulen; *rbuflen = 0; @@ -168,7 +170,7 @@ static int passwd_login(void *obj, struct passwd **uam_pwd, (void *) &username, &ulen) < 0) return AFPERR_MISC; - if (ibuflen <= 1) { + if (ibuflen < 2) { return( AFPERR_PARAM ); } @@ -197,11 +199,11 @@ static int passwd_login(void *obj, struct passwd **uam_pwd, len bytes unicode name */ static int passwd_login_ext(void *obj, char *uname, struct passwd **uam_pwd, - char *ibuf, int ibuflen, - char *rbuf, int *rbuflen) + char *ibuf, size_t ibuflen, + char *rbuf, size_t *rbuflen) { char *username; - int len, ulen; + size_t len, ulen; u_int16_t temp16; *rbuflen = 0; @@ -228,7 +230,7 @@ static int passwd_login_ext(void *obj, char *uname, struct passwd **uam_pwd, /* change passwd */ static int passwd_changepw(void *obj, char *username, struct passwd *pwd, char *ibuf, - int ibuflen, char *rbuf, int *rbuflen) + size_t ibuflen, char *rbuf, size_t *rbuflen) { #ifdef SHADOWPW struct spwd *sp; @@ -271,9 +273,7 @@ static int passwd_changepw(void *obj, char *username, /* Printer ClearTxtUAM login */ -static int passwd_printer(start, stop, username, out) -char *start, *stop, *username; -struct papfile *out; +static int passwd_printer(char *start, char *stop, char *username, struct papfile *out) { struct passwd *pwd; #ifdef SHADOWPW