From: niklas Date: Thu, 1 May 1997 22:14:44 +0000 (+0000) Subject: Umm, fix signedness error in my last commit, be explicit X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=8c318623b827399f1e0f0e306d0938e5fa208cf4;p=openbsd Umm, fix signedness error in my last commit, be explicit about the fact that ordernumbers are 32 bit --- diff --git a/usr.sbin/ypserv/common/yplib_host.c b/usr.sbin/ypserv/common/yplib_host.c index de4d0c551f1..7989643d132 100644 --- a/usr.sbin/ypserv/common/yplib_host.c +++ b/usr.sbin/ypserv/common/yplib_host.c @@ -1,4 +1,4 @@ -/* $OpenBSD: yplib_host.c,v 1.5 1996/05/30 09:53:02 deraadt Exp $ */ +/* $OpenBSD: yplib_host.c,v 1.6 1997/05/01 22:14:44 niklas Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt @@ -32,7 +32,7 @@ */ #ifndef LINT -static char *rcsid = "$OpenBSD: yplib_host.c,v 1.5 1996/05/30 09:53:02 deraadt Exp $"; +static char *rcsid = "$OpenBSD: yplib_host.c,v 1.6 1997/05/01 22:14:44 niklas Exp $"; #endif #include @@ -319,7 +319,7 @@ yp_order_host(client, indomain, inmap, outorder) CLIENT *client; char *indomain; char *inmap; -int *outorder; +u_int32_t *outorder; { struct ypresp_order ypro; struct ypreq_nokey yprnk; diff --git a/usr.sbin/ypserv/common/yplib_host.h b/usr.sbin/ypserv/common/yplib_host.h index 521380101b0..814315d79c1 100644 --- a/usr.sbin/ypserv/common/yplib_host.h +++ b/usr.sbin/ypserv/common/yplib_host.h @@ -1,4 +1,4 @@ -/* $OpenBSD: yplib_host.h,v 1.3 1996/05/30 09:53:03 deraadt Exp $ */ +/* $OpenBSD: yplib_host.h,v 1.4 1997/05/01 22:14:45 niklas Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt @@ -46,7 +46,7 @@ int yp_next_host __P((CLIENT *client, char *indomain, char *inmap, int yp_master_host __P((CLIENT *client, char *indomain, char *inmap, char **outname)); int yp_order_host __P((CLIENT *client, - char *indomain, char *inmap, int *outorder)); + char *indomain, char *inmap, u_int32_t *outorder)); int yp_all_host __P((CLIENT *client, char *indomain, char *inmap, struct ypall_callback *incallback)); int yp_maplist_host __P((CLIENT *client, char *indomain, diff --git a/usr.sbin/ypserv/yppush/yppush.c b/usr.sbin/ypserv/yppush/yppush.c index a4e774e4692..aac2f7485d8 100644 --- a/usr.sbin/ypserv/yppush/yppush.c +++ b/usr.sbin/ypserv/yppush/yppush.c @@ -1,4 +1,4 @@ -/* $OpenBSD: yppush.c,v 1.6 1997/03/15 00:08:58 gene Exp $ */ +/* $OpenBSD: yppush.c,v 1.7 1997/05/01 22:14:46 niklas Exp $ */ /* * Copyright (c) 1995 Mats O Jansson @@ -32,7 +32,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: yppush.c,v 1.6 1997/03/15 00:08:58 gene Exp $"; +static char rcsid[] = "$OpenBSD: yppush.c,v 1.7 1997/05/01 22:14:46 niklas Exp $"; #endif /* not lint */ #include @@ -57,7 +57,7 @@ static char rcsid[] = "$OpenBSD: yppush.c,v 1.6 1997/03/15 00:08:58 gene Exp $"; int Verbose = 0; char Domain[MAXHOSTNAMELEN], Map[255]; -u_long OrderNum; +u_int32_t OrderNum; char *master; extern void yppush_xfrrespprog_1(struct svc_req *request, SVCXPRT *xprt); @@ -124,7 +124,7 @@ CLIENT *client; request.port=transp->xp_port; if (Verbose) - printf("%d: %s(%d@%s) -> %s@%s\n", + printf("%d: %s(%u@%s) -> %s@%s\n", request.transid, request.map_parms.map, request.map_parms.ordernum, diff --git a/usr.sbin/ypserv/ypserv/yp.h b/usr.sbin/ypserv/ypserv/yp.h index ab1369dcbf8..09b9851bae9 100644 --- a/usr.sbin/ypserv/ypserv/yp.h +++ b/usr.sbin/ypserv/ypserv/yp.h @@ -1,4 +1,4 @@ -/* $OpenBSD: yp.h,v 1.3 1997/03/30 20:51:19 maja Exp $ */ +/* $OpenBSD: yp.h,v 1.4 1997/05/01 22:14:47 niklas Exp $ */ /* * Please do not edit this file. @@ -125,7 +125,7 @@ bool_t xdr_valdat(); struct ypmap_parms { domainname domain; mapname map; - u_int ordernum; + u_int32_t ordernum; peername peer; }; typedef struct ypmap_parms ypmap_parms; @@ -228,7 +228,7 @@ bool_t xdr_ypresp_master(); struct ypresp_order { ypstat stat; - u_int ordernum; + u_int32_t ordernum; }; typedef struct ypresp_order ypresp_order; #ifdef __cplusplus diff --git a/usr.sbin/ypserv/ypserv/ypserv_db.c b/usr.sbin/ypserv/ypserv/ypserv_db.c index 562d4b4a2e9..3c796d6e905 100644 --- a/usr.sbin/ypserv/ypserv/ypserv_db.c +++ b/usr.sbin/ypserv/ypserv/ypserv_db.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ypserv_db.c,v 1.11 1997/04/12 16:53:06 deraadt Exp $ */ +/* $OpenBSD: ypserv_db.c,v 1.12 1997/05/01 22:14:48 niklas Exp $ */ /* * Copyright (c) 1994 Mats O Jansson @@ -34,7 +34,7 @@ */ #ifndef LINT -static char rcsid[] = "$OpenBSD: ypserv_db.c,v 1.11 1997/04/12 16:53:06 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: ypserv_db.c,v 1.12 1997/05/01 22:14:48 niklas Exp $"; #endif /* @@ -652,7 +652,7 @@ ypdb_get_order(domain, map) } else { strncpy(order, v.dptr, v.dsize); order[v.dsize] = '\0'; - res.ordernum = (u_int) atol(order); + res.ordernum = (u_int32_t)atol(order); } } diff --git a/usr.sbin/ypserv/ypxfr/ypxfr.c b/usr.sbin/ypserv/ypxfr/ypxfr.c index 4620eac16bf..a7430e05fe2 100644 --- a/usr.sbin/ypserv/ypxfr/ypxfr.c +++ b/usr.sbin/ypserv/ypxfr/ypxfr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ypxfr.c,v 1.18 1997/05/01 17:49:45 niklas Exp $ */ +/* $OpenBSD: ypxfr.c,v 1.19 1997/05/01 22:14:48 niklas Exp $ */ /* * Copyright (c) 1994 Mats O Jansson @@ -32,7 +32,7 @@ */ #ifndef LINT -static char rcsid[] = "$OpenBSD: ypxfr.c,v 1.18 1997/05/01 17:49:45 niklas Exp $"; +static char rcsid[] = "$OpenBSD: ypxfr.c,v 1.19 1997/05/01 22:14:48 niklas Exp $"; #endif #include @@ -95,7 +95,7 @@ int get_local_ordernum(domain, map, lordernum) char *domain; char *map; -int *lordernum; +u_int32_t *lordernum; { char map_path[MAXPATHLEN]; char order_key[] = YP_LAST_KEY; @@ -147,7 +147,7 @@ int *lordernum; } else { strncpy(order, v.dptr, sizeof order-1); order[sizeof order-1] = '\0'; - *lordernum = atoi((char *)&order); + *lordernum = (u_int32_t)atol(order); } } @@ -165,8 +165,8 @@ get_remote_ordernum(client, domain, map, lordernum, rordernum) CLIENT *client; char *domain; char *map; -int lordernum; -int *rordernum; +u_int32_t lordernum; +u_int32_t *rordernum; { int status; @@ -221,14 +221,14 @@ char *temp_map; int add_order(db, ordernum) DBM *db; -int ordernum; +u_int32_t ordernum; { char datestr[11]; datum key,val; char keystr[] = YP_LAST_KEY; int status; - sprintf(datestr, "%010d", ordernum); + sprintf(datestr, "%010u", ordernum); key.dptr = keystr; key.dsize = strlen(keystr); @@ -430,7 +430,7 @@ char *argv[]; char *ipadd = NULL; char *port = NULL; char *map = NULL; - int ordernum, new_ordernum; + u_int32_t ordernum, new_ordernum; struct ypall_callback callback; CLIENT *client; int status,xfr_status;