/*
- * $Id: auth.c,v 1.37 2002-11-15 10:59:11 srittau Exp $
+ * $Id: auth.c,v 1.39 2002-11-26 08:22:37 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
u_int16_t type;
u_int32_t idlen;
- u_int32_t tklen; /* FIXME: u_int16_t? */
+ u_int16_t tklen; /* FIXME: spec u_int32_t? */
pid_t token;
*rbuflen = 0;
rbuf += sizeof(type);
*rbuflen += sizeof(tklen);
- tklen = htonl(sizeof(pid_t));
+ tklen = htons(sizeof(pid_t));
memcpy(rbuf, &tklen, sizeof(tklen));
rbuf += sizeof(tklen);
return send_reply(obj, AFPERR_PARAM);
/* Pad */
- ibuf++;
- ibuflen--;
+ if ((unsigned long) ibuf & 1) { /* pad character */
+ ibuf++;
+ ibuflen--;
+ }
/* FIXME user name are in unicode */
i = afp_uam->u.uam_login.login_ext(obj, username, &pwd, ibuf, ibuflen, rbuf, rbuflen);