-/* $OpenBSD: md5crypt.c,v 1.6 1996/10/15 09:25:32 deraadt Exp $ */
+/* $OpenBSD: md5crypt.c,v 1.7 1996/12/14 06:49:36 tholo Exp $ */
/*
* ----------------------------------------------------------------------------
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: md5crypt.c,v 1.6 1996/10/15 09:25:32 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: md5crypt.c,v 1.7 1996/12/14 06:49:36 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
#include <unistd.h>
* This string is magic for this algorithm. Having
* it this way, we can get get better later on
*/
- static char *magic = "$1$";
+ static unsigned char *magic = (unsigned char *)"$1$";
static char passwd[120], *p;
- static const char *sp,*ep;
+ static const unsigned char *sp,*ep;
unsigned char final[16];
- int sl,pl,i,j;
+ int sl,pl,i;
MD5_CTX ctx,ctx1;
unsigned long l;
/* Refine the Salt first */
- sp = salt;
+ sp = (const unsigned char *)salt;
/* If it starts with the magic string, then skip that */
- if(!strncmp(sp,magic,strlen(magic)))
- sp += strlen(magic);
+ if(!strncmp((const char *)sp,(const char *)magic,strlen((const char *)magic)))
+ sp += strlen((const char *)magic);
/* It stops at the first '$', max 8 chars */
for(ep=sp;*ep && *ep != '$' && ep < (sp+8);ep++)
MD5Init(&ctx);
/* The password first, since that is what is most unknown */
- MD5Update(&ctx,pw,strlen(pw));
+ MD5Update(&ctx,(const unsigned char *)pw,strlen(pw));
/* Then our magic string */
- MD5Update(&ctx,magic,strlen(magic));
+ MD5Update(&ctx,magic,strlen((const char *)magic));
/* Then the raw salt */
MD5Update(&ctx,sp,sl);
/* Then just as many characters of the MD5(pw,salt,pw) */
MD5Init(&ctx1);
- MD5Update(&ctx1,pw,strlen(pw));
+ MD5Update(&ctx1,(const unsigned char *)pw,strlen(pw));
MD5Update(&ctx1,sp,sl);
- MD5Update(&ctx1,pw,strlen(pw));
+ MD5Update(&ctx1,(const unsigned char *)pw,strlen(pw));
MD5Final(final,&ctx1);
for(pl = strlen(pw); pl > 0; pl -= 16)
MD5Update(&ctx,final,pl>16 ? 16 : pl);
if(i&1)
MD5Update(&ctx, final, 1);
else
- MD5Update(&ctx, pw, 1);
+ MD5Update(&ctx, (const unsigned char *)pw, 1);
/* Now make the output string */
- strcpy(passwd,magic);
- strncat(passwd,sp,sl);
+ strcpy(passwd,(const char *)magic);
+ strncat(passwd,(const char *)sp,sl);
strcat(passwd,"$");
MD5Final(final,&ctx);
for(i=0;i<1000;i++) {
MD5Init(&ctx1);
if(i & 1)
- MD5Update(&ctx1,pw,strlen(pw));
+ MD5Update(&ctx1,(const unsigned char *)pw,strlen(pw));
else
MD5Update(&ctx1,final,16);
MD5Update(&ctx1,sp,sl);
if(i % 7)
- MD5Update(&ctx1,pw,strlen(pw));
+ MD5Update(&ctx1,(const unsigned char *)pw,strlen(pw));
if(i & 1)
MD5Update(&ctx1,final,16);
else
- MD5Update(&ctx1,pw,strlen(pw));
+ MD5Update(&ctx1,(const unsigned char *)pw,strlen(pw));
MD5Final(final,&ctx1);
}
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: res_mkquery.c,v 1.4 1996/09/15 09:31:20 tholo Exp $";
+static char rcsid[] = "$OpenBSD: res_mkquery.c,v 1.5 1996/12/14 06:49:39 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
* Make an additional record for completion domain.
*/
buflen -= RRFIXEDSZ;
- if ((n = dn_comp(data, cp, buflen, dnptrs, lastdnptr)) < 0)
+ if ((n = dn_comp((const char *)data, cp, buflen, dnptrs, lastdnptr)) < 0)
return (-1);
cp += n;
buflen -= n;
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: auth_unix.c,v 1.6 1996/11/14 05:45:16 etheisen Exp $";
+static char *rcsid = "$OpenBSD: auth_unix.c,v 1.7 1996/12/14 06:49:40 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
/*
AUTH *
authunix_create_default()
{
- register int len;
+ register int len, i;
char machname[MAX_MACHINE_NAME + 1];
register uid_t uid;
register gid_t gid;
gid_t gids[NGRPS];
+ int gids2[NGRPS];
if (gethostname(machname, MAX_MACHINE_NAME) == -1)
abort();
gid = getegid();
if ((len = getgroups(NGRPS, gids)) < 0)
abort();
- return (authunix_create(machname, uid, gid, len, gids));
+ for (i = 0; i < len; i++)
+ gids2[i] = gids[i];
+ return (authunix_create(machname, uid, gid, len, gids2));
}
/*
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: clnt_raw.c,v 1.4 1996/09/15 09:31:32 tholo Exp $";
+static char *rcsid = "$OpenBSD: clnt_raw.c,v 1.5 1996/12/14 06:49:41 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
/*
XDR_SETPOS(xdrs, 0);
((struct rpc_msg *)clp->mashl_callmsg)->rm_xid ++ ;
if ((! XDR_PUTBYTES(xdrs, clp->mashl_callmsg, clp->mcnt)) ||
- (! XDR_PUTLONG(xdrs, &proc)) ||
+ (! XDR_PUTLONG(xdrs, (long *)&proc)) ||
(! AUTH_MARSHALL(h->cl_auth, xdrs)) ||
(! (*xargs)(xdrs, argsp))) {
return (RPC_CANTENCODEARGS);
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: xdr.c,v 1.3 1996/08/19 08:32:01 tholo Exp $";
+static char *rcsid = "$OpenBSD: xdr.c,v 1.4 1996/12/14 06:49:42 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
/*
case XDR_ENCODE:
l = (u_long) *up;
- return (XDR_PUTLONG(xdrs, &l));
+ return (XDR_PUTLONG(xdrs, (long *)&l));
case XDR_DECODE:
- if (!XDR_GETLONG(xdrs, &l)) {
+ if (!XDR_GETLONG(xdrs, (long *)&l)) {
return (FALSE);
}
*up = (u_int) l;
case XDR_ENCODE:
l = (u_long) *u_int32_p;
- return (XDR_PUTLONG(xdrs, &l));
+ return (XDR_PUTLONG(xdrs, (long *)&l));
case XDR_DECODE:
- if (!XDR_GETLONG(xdrs, &l)) {
+ if (!XDR_GETLONG(xdrs, (long *)&l)) {
return (FALSE);
}
*u_int32_p = (u_int32_t) l;
case XDR_ENCODE:
l = (u_long) *usp;
- return (XDR_PUTLONG(xdrs, &l));
+ return (XDR_PUTLONG(xdrs, (long *)&l));
case XDR_DECODE:
- if (!XDR_GETLONG(xdrs, &l)) {
+ if (!XDR_GETLONG(xdrs, (long *)&l)) {
return (FALSE);
}
*usp = (u_short) l;
case XDR_ENCODE:
l = (u_long) *u_int16_p;
- return (XDR_PUTLONG(xdrs, &l));
+ return (XDR_PUTLONG(xdrs, (long *)&l));
case XDR_DECODE:
- if (!XDR_GETLONG(xdrs, &l)) {
+ if (!XDR_GETLONG(xdrs, (long *)&l)) {
return (FALSE);
}
*u_int16_p = (u_int16_t) l;
}
#else
(void) (xdr_short(xdrs, (short *)ep));
- (void) (xdr_int(xdrs, (short *)ep));
+ (void) (xdr_int(xdrs, (int *)ep));
return (xdr_long(xdrs, (long *)ep));
#endif
}
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: vfprintf.c,v 1.5 1996/11/13 18:46:29 niklas Exp $";
+static char *rcsid = "$OpenBSD: vfprintf.c,v 1.6 1996/12/14 06:49:43 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
/*
#include "fvwrite.h"
static void __find_arguments(const char *fmt0, va_list ap, va_list **argtable);
-static void __grow_type_table(int nextarg, unsigned char **typetable,
+static int __grow_type_table(unsigned char **typetable,
int *tablesize);
/*
register int n, n2; /* handy integer (short term usage) */
register char *cp; /* handy char pointer (short term usage) */
register int flags; /* flags as above */
- int width; /* width from format (%8d), or 0 */
unsigned char *typetable; /* table of types */
unsigned char stattypetable[STATIC_ARG_TBL_SIZE];
int tablesize; /* current size of type table */
*/
#define ADDTYPE(type) \
((nextarg >= tablesize) ? \
- __grow_type_table(nextarg, &typetable, &tablesize) : 0, \
+ __grow_type_table(&typetable, &tablesize) : 0, \
typetable[nextarg++] = type, \
(nextarg > tablemax) ? tablemax = nextarg : 0)
fmt++; /* skip over '%' */
flags = 0;
- width = 0;
rflag: ch = *fmt++;
reswitch: switch (ch) {
nextarg = n;
goto rflag;
}
- width = n;
goto reswitch;
#ifdef FLOATING_POINT
case 'L':
/*
* Increase the size of the type table.
*/
-static void
-__grow_type_table (nextarg, typetable, tablesize)
- int nextarg;
+static int
+__grow_type_table (typetable, tablesize)
unsigned char **typetable;
int *tablesize;
{
memset (&typetable [*tablesize], T_UNUSED, (newsize - *tablesize));
*tablesize = newsize;
+ return(0);
}
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: xdr_ypstat.c,v 1.3 1996/08/19 08:35:07 tholo Exp $";
+static char *rcsid = "$OpenBSD: xdr_ypstat.c,v 1.4 1996/12/14 06:49:45 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
XDR *xdrs;
ypstat *objp;
{
- return xdr_enum(xdrs, objp);
+ return xdr_enum(xdrs, (enum_t *)objp);
}
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: yp_all.c,v 1.4 1996/08/19 08:35:07 tholo Exp $";
+static char *rcsid = "$OpenBSD: yp_all.c,v 1.5 1996/12/14 06:49:46 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
while(1) {
if( !xdr_ypresp_all(xdrs, &out)) {
xdr_free(xdr_ypresp_all, (char *)&out);
- *objp = YP_YPERR;
+ *objp = (u_long)YP_YPERR;
return FALSE;
}
if(out.more == 0) {
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: ypprot_err.c,v 1.3 1996/08/19 08:35:13 tholo Exp $";
+static char *rcsid = "$OpenBSD: ypprot_err.c,v 1.4 1996/12/14 06:49:47 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
ypprot_err(incode)
unsigned int incode;
{
- switch (incode) {
+ switch ((int)incode) {
case YP_TRUE:
return 0;
case YP_FALSE: