Spell void * as void * rather than caddr_t. This is complicated by the
fact that caddr_t is often misspelled as char *. Sponsored by: DARPA, NAI Labs
This commit is contained in:
parent
6c28b67b1e
commit
f249dbcc71
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=95658
@ -98,8 +98,8 @@ typedef struct __rpc_client {
|
|||||||
struct clnt_ops {
|
struct clnt_ops {
|
||||||
/* call remote procedure */
|
/* call remote procedure */
|
||||||
enum clnt_stat (*cl_call)(struct __rpc_client *,
|
enum clnt_stat (*cl_call)(struct __rpc_client *,
|
||||||
rpcproc_t, xdrproc_t, caddr_t, xdrproc_t,
|
rpcproc_t, xdrproc_t, void *, xdrproc_t,
|
||||||
caddr_t, struct timeval);
|
void *, struct timeval);
|
||||||
/* abort a call */
|
/* abort a call */
|
||||||
void (*cl_abort)(struct __rpc_client *);
|
void (*cl_abort)(struct __rpc_client *);
|
||||||
/* get specific error code */
|
/* get specific error code */
|
||||||
@ -107,12 +107,12 @@ typedef struct __rpc_client {
|
|||||||
struct rpc_err *);
|
struct rpc_err *);
|
||||||
/* frees results */
|
/* frees results */
|
||||||
bool_t (*cl_freeres)(struct __rpc_client *,
|
bool_t (*cl_freeres)(struct __rpc_client *,
|
||||||
xdrproc_t, caddr_t);
|
xdrproc_t, void *);
|
||||||
/* destroy this structure */
|
/* destroy this structure */
|
||||||
void (*cl_destroy)(struct __rpc_client *);
|
void (*cl_destroy)(struct __rpc_client *);
|
||||||
/* the ioctl() of rpc */
|
/* the ioctl() of rpc */
|
||||||
bool_t (*cl_control)(struct __rpc_client *, u_int,
|
bool_t (*cl_control)(struct __rpc_client *, u_int,
|
||||||
char *);
|
void *);
|
||||||
} *cl_ops;
|
} *cl_ops;
|
||||||
void *cl_private; /* private stuff */
|
void *cl_private; /* private stuff */
|
||||||
char *cl_netid; /* network token */
|
char *cl_netid; /* network token */
|
||||||
@ -155,17 +155,17 @@ struct rpc_timers {
|
|||||||
* CLIENT *rh;
|
* CLIENT *rh;
|
||||||
* rpcproc_t proc;
|
* rpcproc_t proc;
|
||||||
* xdrproc_t xargs;
|
* xdrproc_t xargs;
|
||||||
* caddr_t argsp;
|
* void *argsp;
|
||||||
* xdrproc_t xres;
|
* xdrproc_t xres;
|
||||||
* caddr_t resp;
|
* void *resp;
|
||||||
* struct timeval timeout;
|
* struct timeval timeout;
|
||||||
*/
|
*/
|
||||||
#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \
|
#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \
|
||||||
((*(rh)->cl_ops->cl_call)(rh, proc, xargs, \
|
((*(rh)->cl_ops->cl_call)(rh, proc, xargs, \
|
||||||
(caddr_t)(void *)argsp, xres, (caddr_t)(void *)resp, secs))
|
argsp, xres, resp, secs))
|
||||||
#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \
|
#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \
|
||||||
((*(rh)->cl_ops->cl_call)(rh, proc, xargs, \
|
((*(rh)->cl_ops->cl_call)(rh, proc, xargs, \
|
||||||
(caddr_t)(void *)argsp, xres, (caddr_t)(void *)resp, secs))
|
argsp, xres, resp, secs))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* void
|
* void
|
||||||
@ -189,7 +189,7 @@ struct rpc_timers {
|
|||||||
* CLNT_FREERES(rh, xres, resp);
|
* CLNT_FREERES(rh, xres, resp);
|
||||||
* CLIENT *rh;
|
* CLIENT *rh;
|
||||||
* xdrproc_t xres;
|
* xdrproc_t xres;
|
||||||
* caddr_t resp;
|
* void *resp;
|
||||||
*/
|
*/
|
||||||
#define CLNT_FREERES(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
|
#define CLNT_FREERES(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
|
||||||
#define clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
|
#define clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
|
||||||
|
@ -76,8 +76,8 @@ extern enum clnt_stat pmap_rmtcall(struct sockaddr_in *,
|
|||||||
xdrproc_t, caddr_t,
|
xdrproc_t, caddr_t,
|
||||||
struct timeval, u_long *);
|
struct timeval, u_long *);
|
||||||
extern enum clnt_stat clnt_broadcast(u_long, u_long, u_long,
|
extern enum clnt_stat clnt_broadcast(u_long, u_long, u_long,
|
||||||
xdrproc_t, char *,
|
xdrproc_t, void *,
|
||||||
xdrproc_t, char *,
|
xdrproc_t, void *,
|
||||||
resultproc_t);
|
resultproc_t);
|
||||||
extern u_short pmap_getport(struct sockaddr_in *,
|
extern u_short pmap_getport(struct sockaddr_in *,
|
||||||
u_long, u_long, u_int);
|
u_long, u_long, u_int);
|
||||||
|
@ -91,12 +91,12 @@ typedef struct __rpc_svcxprt {
|
|||||||
enum xprt_stat (*xp_stat)(struct __rpc_svcxprt *);
|
enum xprt_stat (*xp_stat)(struct __rpc_svcxprt *);
|
||||||
/* get arguments */
|
/* get arguments */
|
||||||
bool_t (*xp_getargs)(struct __rpc_svcxprt *, xdrproc_t,
|
bool_t (*xp_getargs)(struct __rpc_svcxprt *, xdrproc_t,
|
||||||
caddr_t);
|
void *);
|
||||||
/* send reply */
|
/* send reply */
|
||||||
bool_t (*xp_reply)(struct __rpc_svcxprt *, struct rpc_msg *);
|
bool_t (*xp_reply)(struct __rpc_svcxprt *, struct rpc_msg *);
|
||||||
/* free mem allocated for args */
|
/* free mem allocated for args */
|
||||||
bool_t (*xp_freeargs)(struct __rpc_svcxprt *, xdrproc_t,
|
bool_t (*xp_freeargs)(struct __rpc_svcxprt *, xdrproc_t,
|
||||||
caddr_t);
|
void *);
|
||||||
/* destroy this struct */
|
/* destroy this struct */
|
||||||
void (*xp_destroy)(struct __rpc_svcxprt *);
|
void (*xp_destroy)(struct __rpc_svcxprt *);
|
||||||
} *xp_ops;
|
} *xp_ops;
|
||||||
@ -147,7 +147,7 @@ struct svc_req {
|
|||||||
* SVCXPRT *xprt;
|
* SVCXPRT *xprt;
|
||||||
* struct rpc_msg *msg;
|
* struct rpc_msg *msg;
|
||||||
* xdrproc_t xargs;
|
* xdrproc_t xargs;
|
||||||
* caddr_t argsp;
|
* void * argsp;
|
||||||
*/
|
*/
|
||||||
#define SVC_RECV(xprt, msg) \
|
#define SVC_RECV(xprt, msg) \
|
||||||
(*(xprt)->xp_ops->xp_recv)((xprt), (msg))
|
(*(xprt)->xp_ops->xp_recv)((xprt), (msg))
|
||||||
@ -259,7 +259,7 @@ __END_DECLS
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
extern bool_t svc_sendreply(SVCXPRT *, xdrproc_t, char *);
|
extern bool_t svc_sendreply(SVCXPRT *, xdrproc_t, void *);
|
||||||
extern void svcerr_decode(SVCXPRT *);
|
extern void svcerr_decode(SVCXPRT *);
|
||||||
extern void svcerr_weakauth(SVCXPRT *);
|
extern void svcerr_weakauth(SVCXPRT *);
|
||||||
extern void svcerr_noproc(SVCXPRT *);
|
extern void svcerr_noproc(SVCXPRT *);
|
||||||
|
@ -138,7 +138,7 @@ typedef bool_t (*xdrproc_t)(XDR *, void *, u_int);
|
|||||||
/*
|
/*
|
||||||
* XXX can't actually prototype it, because some take three args!!!
|
* XXX can't actually prototype it, because some take three args!!!
|
||||||
*/
|
*/
|
||||||
typedef bool_t (*xdrproc_t)(/* XDR *, void *, u_int */);
|
typedef bool_t (*xdrproc_t)(XDR *, ...);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -314,7 +314,7 @@ extern bool_t xdr_quadruple(XDR *, long double *);
|
|||||||
extern bool_t xdr_reference(XDR *, char **, u_int, xdrproc_t);
|
extern bool_t xdr_reference(XDR *, char **, u_int, xdrproc_t);
|
||||||
extern bool_t xdr_pointer(XDR *, char **, u_int, xdrproc_t);
|
extern bool_t xdr_pointer(XDR *, char **, u_int, xdrproc_t);
|
||||||
extern bool_t xdr_wrapstring(XDR *, char **);
|
extern bool_t xdr_wrapstring(XDR *, char **);
|
||||||
extern void xdr_free(xdrproc_t, char *);
|
extern void xdr_free(xdrproc_t, void *);
|
||||||
extern bool_t xdr_hyper(XDR *, quad_t *);
|
extern bool_t xdr_hyper(XDR *, quad_t *);
|
||||||
extern bool_t xdr_u_hyper(XDR *, u_quad_t *);
|
extern bool_t xdr_u_hyper(XDR *, u_quad_t *);
|
||||||
extern bool_t xdr_longlong_t(XDR *, quad_t *);
|
extern bool_t xdr_longlong_t(XDR *, quad_t *);
|
||||||
@ -347,9 +347,9 @@ extern void xdrstdio_create(XDR *, FILE *, enum xdr_op);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* XDR pseudo records for tcp */
|
/* XDR pseudo records for tcp */
|
||||||
extern void xdrrec_create(XDR *, u_int, u_int, char *,
|
extern void xdrrec_create(XDR *, u_int, u_int, void *,
|
||||||
int (*)(char *, char *, int),
|
int (*)(void *, void *, int),
|
||||||
int (*)(char *, char *, int));
|
int (*)(void *, void *, int));
|
||||||
|
|
||||||
/* make end of xdr record */
|
/* make end of xdr record */
|
||||||
extern bool_t xdrrec_endofrecord(XDR *, int);
|
extern bool_t xdrrec_endofrecord(XDR *, int);
|
||||||
|
@ -81,8 +81,8 @@ int yp_next(char *indomain, char *inmap, char *inkey, int inkeylen,
|
|||||||
int yp_master(char *indomain, char *inmap, char **outname);
|
int yp_master(char *indomain, char *inmap, char **outname);
|
||||||
int yp_order(char *indomain, char *inmap, int *outorder);
|
int yp_order(char *indomain, char *inmap, int *outorder);
|
||||||
int yp_all(char *indomain, char *inmap, struct ypall_callback *incallback);
|
int yp_all(char *indomain, char *inmap, struct ypall_callback *incallback);
|
||||||
char * yperr_string(int incode);
|
const char *yperr_string(int incode);
|
||||||
char * ypbinderr_string(int incode);
|
const char *ypbinderr_string(int incode);
|
||||||
int ypprot_err(unsigned int incode);
|
int ypprot_err(unsigned int incode);
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
||||||
|
@ -343,8 +343,8 @@ __rpc_get_time_offset(td, srv, thost, uaddr, netid)
|
|||||||
tv.tv_sec = 5;
|
tv.tv_sec = 5;
|
||||||
tv.tv_usec = 0;
|
tv.tv_usec = 0;
|
||||||
time_valid = 0;
|
time_valid = 0;
|
||||||
status = clnt_call(clnt, RPCBPROC_GETTIME, xdr_void, NULL,
|
status = clnt_call(clnt, RPCBPROC_GETTIME, (xdrproc_t)xdr_void, NULL,
|
||||||
xdr_u_long, (char *)&thetime, tv);
|
(xdrproc_t)xdr_u_long, &thetime, tv);
|
||||||
/*
|
/*
|
||||||
* The only error we check for is anything but success. In
|
* The only error we check for is anything but success. In
|
||||||
* fact we could have seen PROGMISMATCH if talking to a 4.1
|
* fact we could have seen PROGMISMATCH if talking to a 4.1
|
||||||
|
@ -68,10 +68,10 @@ __FBSDID("$FreeBSD$");
|
|||||||
|
|
||||||
static struct clnt_ops *clnt_dg_ops(void);
|
static struct clnt_ops *clnt_dg_ops(void);
|
||||||
static bool_t time_not_ok(struct timeval *);
|
static bool_t time_not_ok(struct timeval *);
|
||||||
static enum clnt_stat clnt_dg_call(CLIENT *, rpcproc_t, xdrproc_t, caddr_t,
|
static enum clnt_stat clnt_dg_call(CLIENT *, rpcproc_t, xdrproc_t, void *,
|
||||||
xdrproc_t, caddr_t, struct timeval);
|
xdrproc_t, void *, struct timeval);
|
||||||
static void clnt_dg_geterr(CLIENT *, struct rpc_err *);
|
static void clnt_dg_geterr(CLIENT *, struct rpc_err *);
|
||||||
static bool_t clnt_dg_freeres(CLIENT *, xdrproc_t, caddr_t);
|
static bool_t clnt_dg_freeres(CLIENT *, xdrproc_t, void *);
|
||||||
static void clnt_dg_abort(CLIENT *);
|
static void clnt_dg_abort(CLIENT *);
|
||||||
static bool_t clnt_dg_control(CLIENT *, u_int, char *);
|
static bool_t clnt_dg_control(CLIENT *, u_int, char *);
|
||||||
static void clnt_dg_destroy(CLIENT *);
|
static void clnt_dg_destroy(CLIENT *);
|
||||||
@ -294,9 +294,9 @@ clnt_dg_call(cl, proc, xargs, argsp, xresults, resultsp, utimeout)
|
|||||||
CLIENT *cl; /* client handle */
|
CLIENT *cl; /* client handle */
|
||||||
rpcproc_t proc; /* procedure number */
|
rpcproc_t proc; /* procedure number */
|
||||||
xdrproc_t xargs; /* xdr routine for args */
|
xdrproc_t xargs; /* xdr routine for args */
|
||||||
caddr_t argsp; /* pointer to args */
|
void *argsp; /* pointer to args */
|
||||||
xdrproc_t xresults; /* xdr routine for results */
|
xdrproc_t xresults; /* xdr routine for results */
|
||||||
caddr_t resultsp; /* pointer to results */
|
void *resultsp; /* pointer to results */
|
||||||
struct timeval utimeout; /* seconds to wait before giving up */
|
struct timeval utimeout; /* seconds to wait before giving up */
|
||||||
{
|
{
|
||||||
struct cu_data *cu = (struct cu_data *)cl->cl_private;
|
struct cu_data *cu = (struct cu_data *)cl->cl_private;
|
||||||
@ -594,7 +594,7 @@ static bool_t
|
|||||||
clnt_dg_freeres(cl, xdr_res, res_ptr)
|
clnt_dg_freeres(cl, xdr_res, res_ptr)
|
||||||
CLIENT *cl;
|
CLIENT *cl;
|
||||||
xdrproc_t xdr_res;
|
xdrproc_t xdr_res;
|
||||||
caddr_t res_ptr;
|
void *res_ptr;
|
||||||
{
|
{
|
||||||
struct cu_data *cu = (struct cu_data *)cl->cl_private;
|
struct cu_data *cu = (struct cu_data *)cl->cl_private;
|
||||||
XDR *xdrs = &(cu->cu_outxdrs);
|
XDR *xdrs = &(cu->cu_outxdrs);
|
||||||
|
@ -76,10 +76,10 @@ static struct clntraw_private {
|
|||||||
u_int mcnt;
|
u_int mcnt;
|
||||||
} *clntraw_private;
|
} *clntraw_private;
|
||||||
|
|
||||||
static enum clnt_stat clnt_raw_call(CLIENT *, rpcproc_t, xdrproc_t, caddr_t,
|
static enum clnt_stat clnt_raw_call(CLIENT *, rpcproc_t, xdrproc_t, void *,
|
||||||
xdrproc_t, caddr_t, struct timeval);
|
xdrproc_t, void *, struct timeval);
|
||||||
static void clnt_raw_geterr(CLIENT *, struct rpc_err *);
|
static void clnt_raw_geterr(CLIENT *, struct rpc_err *);
|
||||||
static bool_t clnt_raw_freeres(CLIENT *, xdrproc_t, caddr_t);
|
static bool_t clnt_raw_freeres(CLIENT *, xdrproc_t, void *);
|
||||||
static void clnt_raw_abort(CLIENT *);
|
static void clnt_raw_abort(CLIENT *);
|
||||||
static bool_t clnt_raw_control(CLIENT *, u_int, char *);
|
static bool_t clnt_raw_control(CLIENT *, u_int, char *);
|
||||||
static void clnt_raw_destroy(CLIENT *);
|
static void clnt_raw_destroy(CLIENT *);
|
||||||
@ -145,9 +145,9 @@ clnt_raw_call(h, proc, xargs, argsp, xresults, resultsp, timeout)
|
|||||||
CLIENT *h;
|
CLIENT *h;
|
||||||
rpcproc_t proc;
|
rpcproc_t proc;
|
||||||
xdrproc_t xargs;
|
xdrproc_t xargs;
|
||||||
caddr_t argsp;
|
void *argsp;
|
||||||
xdrproc_t xresults;
|
xdrproc_t xresults;
|
||||||
caddr_t resultsp;
|
void *resultsp;
|
||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
{
|
{
|
||||||
struct clntraw_private *clp = clntraw_private;
|
struct clntraw_private *clp = clntraw_private;
|
||||||
@ -251,7 +251,7 @@ static bool_t
|
|||||||
clnt_raw_freeres(cl, xdr_res, res_ptr)
|
clnt_raw_freeres(cl, xdr_res, res_ptr)
|
||||||
CLIENT *cl;
|
CLIENT *cl;
|
||||||
xdrproc_t xdr_res;
|
xdrproc_t xdr_res;
|
||||||
caddr_t res_ptr;
|
void *res_ptr;
|
||||||
{
|
{
|
||||||
struct clntraw_private *clp = clntraw_private;
|
struct clntraw_private *clp = clntraw_private;
|
||||||
XDR *xdrs = &clp->xdr_stream;
|
XDR *xdrs = &clp->xdr_stream;
|
||||||
|
@ -87,17 +87,17 @@ struct cmessage {
|
|||||||
struct cmsgcred cmcred;
|
struct cmsgcred cmcred;
|
||||||
};
|
};
|
||||||
|
|
||||||
static enum clnt_stat clnt_vc_call(CLIENT *, rpcproc_t, xdrproc_t, caddr_t,
|
static enum clnt_stat clnt_vc_call(CLIENT *, rpcproc_t, xdrproc_t, void *,
|
||||||
xdrproc_t, caddr_t, struct timeval);
|
xdrproc_t, void *, struct timeval);
|
||||||
static void clnt_vc_geterr(CLIENT *, struct rpc_err *);
|
static void clnt_vc_geterr(CLIENT *, struct rpc_err *);
|
||||||
static bool_t clnt_vc_freeres(CLIENT *, xdrproc_t, caddr_t);
|
static bool_t clnt_vc_freeres(CLIENT *, xdrproc_t, void *);
|
||||||
static void clnt_vc_abort(CLIENT *);
|
static void clnt_vc_abort(CLIENT *);
|
||||||
static bool_t clnt_vc_control(CLIENT *, u_int, char *);
|
static bool_t clnt_vc_control(CLIENT *, u_int, char *);
|
||||||
static void clnt_vc_destroy(CLIENT *);
|
static void clnt_vc_destroy(CLIENT *);
|
||||||
static struct clnt_ops *clnt_vc_ops(void);
|
static struct clnt_ops *clnt_vc_ops(void);
|
||||||
static bool_t time_not_ok(struct timeval *);
|
static bool_t time_not_ok(struct timeval *);
|
||||||
static int read_vc(caddr_t, caddr_t, int);
|
static int read_vc(void *, void *, int);
|
||||||
static int write_vc(caddr_t, caddr_t, int);
|
static int write_vc(void *, void *, int);
|
||||||
static int __msgwrite(int, void *, size_t);
|
static int __msgwrite(int, void *, size_t);
|
||||||
static int __msgread(int, void *, size_t);
|
static int __msgread(int, void *, size_t);
|
||||||
|
|
||||||
@ -304,10 +304,10 @@ clnt_vc_create(fd, raddr, prog, vers, sendsz, recvsz)
|
|||||||
if (ct) {
|
if (ct) {
|
||||||
if (ct->ct_addr.len)
|
if (ct->ct_addr.len)
|
||||||
mem_free(ct->ct_addr.buf, ct->ct_addr.len);
|
mem_free(ct->ct_addr.buf, ct->ct_addr.len);
|
||||||
mem_free((caddr_t)ct, sizeof (struct ct_data));
|
mem_free(ct, sizeof (struct ct_data));
|
||||||
}
|
}
|
||||||
if (cl)
|
if (cl)
|
||||||
mem_free((caddr_t)cl, sizeof (CLIENT));
|
mem_free(cl, sizeof (CLIENT));
|
||||||
}
|
}
|
||||||
return ((CLIENT *)NULL);
|
return ((CLIENT *)NULL);
|
||||||
}
|
}
|
||||||
@ -317,9 +317,9 @@ clnt_vc_call(cl, proc, xdr_args, args_ptr, xdr_results, results_ptr, timeout)
|
|||||||
CLIENT *cl;
|
CLIENT *cl;
|
||||||
rpcproc_t proc;
|
rpcproc_t proc;
|
||||||
xdrproc_t xdr_args;
|
xdrproc_t xdr_args;
|
||||||
caddr_t args_ptr;
|
void *args_ptr;
|
||||||
xdrproc_t xdr_results;
|
xdrproc_t xdr_results;
|
||||||
caddr_t results_ptr;
|
void *results_ptr;
|
||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
{
|
{
|
||||||
struct ct_data *ct = (struct ct_data *) cl->cl_private;
|
struct ct_data *ct = (struct ct_data *) cl->cl_private;
|
||||||
@ -457,7 +457,7 @@ static bool_t
|
|||||||
clnt_vc_freeres(cl, xdr_res, res_ptr)
|
clnt_vc_freeres(cl, xdr_res, res_ptr)
|
||||||
CLIENT *cl;
|
CLIENT *cl;
|
||||||
xdrproc_t xdr_res;
|
xdrproc_t xdr_res;
|
||||||
caddr_t res_ptr;
|
void *res_ptr;
|
||||||
{
|
{
|
||||||
struct ct_data *ct;
|
struct ct_data *ct;
|
||||||
XDR *xdrs;
|
XDR *xdrs;
|
||||||
@ -660,13 +660,13 @@ clnt_vc_destroy(cl)
|
|||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
read_vc(ctp, buf, len)
|
read_vc(ctp, buf, len)
|
||||||
caddr_t ctp;
|
void *ctp;
|
||||||
caddr_t buf;
|
void *buf;
|
||||||
int len;
|
int len;
|
||||||
{
|
{
|
||||||
struct sockaddr sa;
|
struct sockaddr sa;
|
||||||
socklen_t sal;
|
socklen_t sal;
|
||||||
struct ct_data *ct = (struct ct_data *)(void *)ctp;
|
struct ct_data *ct = (struct ct_data *)ctp;
|
||||||
struct pollfd fd;
|
struct pollfd fd;
|
||||||
int milliseconds = (int)((ct->ct_wait.tv_sec * 1000) +
|
int milliseconds = (int)((ct->ct_wait.tv_sec * 1000) +
|
||||||
(ct->ct_wait.tv_usec / 1000));
|
(ct->ct_wait.tv_usec / 1000));
|
||||||
@ -717,13 +717,13 @@ read_vc(ctp, buf, len)
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
write_vc(ctp, buf, len)
|
write_vc(ctp, buf, len)
|
||||||
caddr_t ctp;
|
void *ctp;
|
||||||
caddr_t buf;
|
void *buf;
|
||||||
int len;
|
int len;
|
||||||
{
|
{
|
||||||
struct sockaddr sa;
|
struct sockaddr sa;
|
||||||
socklen_t sal;
|
socklen_t sal;
|
||||||
struct ct_data *ct = (struct ct_data *)(void *)ctp;
|
struct ct_data *ct = (struct ct_data *)ctp;
|
||||||
int i, cnt;
|
int i, cnt;
|
||||||
|
|
||||||
sal = sizeof(sa);
|
sal = sizeof(sa);
|
||||||
|
@ -93,7 +93,7 @@ _des_crypt_call(buf, len, dparms)
|
|||||||
bcopy(result_1->des_ivec, dparms->des_ivec, 8);
|
bcopy(result_1->des_ivec, dparms->des_ivec, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
clnt_freeres(clnt, xdr_desresp, (char *)result_1);
|
clnt_freeres(clnt, (xdrproc_t)xdr_desresp, result_1);
|
||||||
clnt_destroy(clnt);
|
clnt_destroy(clnt);
|
||||||
|
|
||||||
return(stat);
|
return(stat);
|
||||||
|
@ -86,7 +86,7 @@ cryptkeyres *(*__key_encryptsession_pk_LOCAL)() = 0;
|
|||||||
cryptkeyres *(*__key_decryptsession_pk_LOCAL)() = 0;
|
cryptkeyres *(*__key_decryptsession_pk_LOCAL)() = 0;
|
||||||
des_block *(*__key_gendes_LOCAL)() = 0;
|
des_block *(*__key_gendes_LOCAL)() = 0;
|
||||||
|
|
||||||
static int key_call( u_long, xdrproc_t, char *, xdrproc_t, char * );
|
static int key_call( u_long, xdrproc_t, void *, xdrproc_t, void *);
|
||||||
|
|
||||||
int
|
int
|
||||||
key_setsecret(secretkey)
|
key_setsecret(secretkey)
|
||||||
@ -94,8 +94,8 @@ key_setsecret(secretkey)
|
|||||||
{
|
{
|
||||||
keystatus status;
|
keystatus status;
|
||||||
|
|
||||||
if (!key_call((u_long) KEY_SET, xdr_keybuf, (char *) secretkey,
|
if (!key_call((u_long) KEY_SET, (xdrproc_t)xdr_keybuf, secretkey,
|
||||||
xdr_keystatus, (char *)&status)) {
|
(xdrproc_t)xdr_keystatus, &status)) {
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
if (status != KEY_SUCCESS) {
|
if (status != KEY_SUCCESS) {
|
||||||
@ -119,8 +119,8 @@ key_secretkey_is_set(void)
|
|||||||
struct key_netstres kres;
|
struct key_netstres kres;
|
||||||
|
|
||||||
memset((void*)&kres, 0, sizeof (kres));
|
memset((void*)&kres, 0, sizeof (kres));
|
||||||
if (key_call((u_long) KEY_NET_GET, xdr_void, (char *)NULL,
|
if (key_call((u_long) KEY_NET_GET, (xdrproc_t)xdr_void, NULL,
|
||||||
xdr_key_netstres, (char *) &kres) &&
|
(xdrproc_t)xdr_key_netstres, &kres) &&
|
||||||
(kres.status == KEY_SUCCESS) &&
|
(kres.status == KEY_SUCCESS) &&
|
||||||
(kres.key_netstres_u.knet.st_priv_key[0] != 0)) {
|
(kres.key_netstres_u.knet.st_priv_key[0] != 0)) {
|
||||||
/* avoid leaving secret key in memory */
|
/* avoid leaving secret key in memory */
|
||||||
@ -142,8 +142,8 @@ key_encryptsession_pk(remotename, remotekey, deskey)
|
|||||||
arg.remotename = remotename;
|
arg.remotename = remotename;
|
||||||
arg.remotekey = *remotekey;
|
arg.remotekey = *remotekey;
|
||||||
arg.deskey = *deskey;
|
arg.deskey = *deskey;
|
||||||
if (!key_call((u_long)KEY_ENCRYPT_PK, xdr_cryptkeyarg2, (char *)&arg,
|
if (!key_call((u_long)KEY_ENCRYPT_PK, (xdrproc_t)xdr_cryptkeyarg2, &arg,
|
||||||
xdr_cryptkeyres, (char *)&res)) {
|
(xdrproc_t)xdr_cryptkeyres, &res)) {
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
if (res.status != KEY_SUCCESS) {
|
if (res.status != KEY_SUCCESS) {
|
||||||
@ -166,8 +166,8 @@ key_decryptsession_pk(remotename, remotekey, deskey)
|
|||||||
arg.remotename = remotename;
|
arg.remotename = remotename;
|
||||||
arg.remotekey = *remotekey;
|
arg.remotekey = *remotekey;
|
||||||
arg.deskey = *deskey;
|
arg.deskey = *deskey;
|
||||||
if (!key_call((u_long)KEY_DECRYPT_PK, xdr_cryptkeyarg2, (char *)&arg,
|
if (!key_call((u_long)KEY_DECRYPT_PK, (xdrproc_t)xdr_cryptkeyarg2, &arg,
|
||||||
xdr_cryptkeyres, (char *)&res)) {
|
(xdrproc_t)xdr_cryptkeyres, &res)) {
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
if (res.status != KEY_SUCCESS) {
|
if (res.status != KEY_SUCCESS) {
|
||||||
@ -188,8 +188,8 @@ key_encryptsession(remotename, deskey)
|
|||||||
|
|
||||||
arg.remotename = (char *) remotename;
|
arg.remotename = (char *) remotename;
|
||||||
arg.deskey = *deskey;
|
arg.deskey = *deskey;
|
||||||
if (!key_call((u_long)KEY_ENCRYPT, xdr_cryptkeyarg, (char *)&arg,
|
if (!key_call((u_long)KEY_ENCRYPT, (xdrproc_t)xdr_cryptkeyarg, &arg,
|
||||||
xdr_cryptkeyres, (char *)&res)) {
|
(xdrproc_t)xdr_cryptkeyres, &res)) {
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
if (res.status != KEY_SUCCESS) {
|
if (res.status != KEY_SUCCESS) {
|
||||||
@ -210,8 +210,8 @@ key_decryptsession(remotename, deskey)
|
|||||||
|
|
||||||
arg.remotename = (char *) remotename;
|
arg.remotename = (char *) remotename;
|
||||||
arg.deskey = *deskey;
|
arg.deskey = *deskey;
|
||||||
if (!key_call((u_long)KEY_DECRYPT, xdr_cryptkeyarg, (char *)&arg,
|
if (!key_call((u_long)KEY_DECRYPT, (xdrproc_t)xdr_cryptkeyarg, &arg,
|
||||||
xdr_cryptkeyres, (char *)&res)) {
|
(xdrproc_t)xdr_cryptkeyres, &res)) {
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
if (res.status != KEY_SUCCESS) {
|
if (res.status != KEY_SUCCESS) {
|
||||||
@ -226,8 +226,8 @@ int
|
|||||||
key_gendes(key)
|
key_gendes(key)
|
||||||
des_block *key;
|
des_block *key;
|
||||||
{
|
{
|
||||||
if (!key_call((u_long)KEY_GEN, xdr_void, (char *)NULL,
|
if (!key_call((u_long)KEY_GEN, (xdrproc_t)xdr_void, NULL,
|
||||||
xdr_des_block, (char *)key)) {
|
(xdrproc_t)xdr_des_block, key)) {
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
return (0);
|
return (0);
|
||||||
@ -240,8 +240,8 @@ struct key_netstarg *arg;
|
|||||||
keystatus status;
|
keystatus status;
|
||||||
|
|
||||||
|
|
||||||
if (!key_call((u_long) KEY_NET_PUT, xdr_key_netstarg, (char *) arg,
|
if (!key_call((u_long) KEY_NET_PUT, (xdrproc_t)xdr_key_netstarg, arg,
|
||||||
xdr_keystatus, (char *) &status)){
|
(xdrproc_t)xdr_keystatus, &status)){
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -260,8 +260,8 @@ key_get_conv(pkey, deskey)
|
|||||||
{
|
{
|
||||||
cryptkeyres res;
|
cryptkeyres res;
|
||||||
|
|
||||||
if (!key_call((u_long) KEY_GET_CONV, xdr_keybuf, pkey,
|
if (!key_call((u_long) KEY_GET_CONV, (xdrproc_t)xdr_keybuf, pkey,
|
||||||
xdr_cryptkeyres, (char *)&res)) {
|
(xdrproc_t)xdr_cryptkeyres, &res)) {
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
if (res.status != KEY_SUCCESS) {
|
if (res.status != KEY_SUCCESS) {
|
||||||
@ -427,9 +427,9 @@ static int
|
|||||||
key_call(proc, xdr_arg, arg, xdr_rslt, rslt)
|
key_call(proc, xdr_arg, arg, xdr_rslt, rslt)
|
||||||
u_long proc;
|
u_long proc;
|
||||||
xdrproc_t xdr_arg;
|
xdrproc_t xdr_arg;
|
||||||
char *arg;
|
void *arg;
|
||||||
xdrproc_t xdr_rslt;
|
xdrproc_t xdr_rslt;
|
||||||
char *rslt;
|
void *rslt;
|
||||||
{
|
{
|
||||||
CLIENT *clnt;
|
CLIENT *clnt;
|
||||||
struct timeval wait_time;
|
struct timeval wait_time;
|
||||||
|
@ -182,7 +182,7 @@ clntudp_bufcreate(raddr, prog, vers, wait, sockp, sendsz, recvsz)
|
|||||||
if (cl == NULL) {
|
if (cl == NULL) {
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
(void) CLNT_CONTROL(cl, CLSET_RETRY_TIMEOUT, (char *)(void *)&wait);
|
(void) CLNT_CONTROL(cl, CLSET_RETRY_TIMEOUT, &wait);
|
||||||
return (cl);
|
return (cl);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -394,9 +394,9 @@ clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
|
|||||||
u_long vers; /* version number */
|
u_long vers; /* version number */
|
||||||
u_long proc; /* procedure number */
|
u_long proc; /* procedure number */
|
||||||
xdrproc_t xargs; /* xdr routine for args */
|
xdrproc_t xargs; /* xdr routine for args */
|
||||||
caddr_t argsp; /* pointer to args */
|
void *argsp; /* pointer to args */
|
||||||
xdrproc_t xresults; /* xdr routine for results */
|
xdrproc_t xresults; /* xdr routine for results */
|
||||||
caddr_t resultsp; /* pointer to results */
|
void *resultsp; /* pointer to results */
|
||||||
resultproc_t eachresult; /* call with each result obtained */
|
resultproc_t eachresult; /* call with each result obtained */
|
||||||
{
|
{
|
||||||
extern mutex_t tsd_lock;
|
extern mutex_t tsd_lock;
|
||||||
|
@ -360,7 +360,7 @@ bool_t
|
|||||||
svc_sendreply(xprt, xdr_results, xdr_location)
|
svc_sendreply(xprt, xdr_results, xdr_location)
|
||||||
SVCXPRT *xprt;
|
SVCXPRT *xprt;
|
||||||
xdrproc_t xdr_results;
|
xdrproc_t xdr_results;
|
||||||
caddr_t xdr_location;
|
void * xdr_location;
|
||||||
{
|
{
|
||||||
struct rpc_msg rply;
|
struct rpc_msg rply;
|
||||||
|
|
||||||
@ -443,7 +443,7 @@ __svc_versquiet_on(xprt)
|
|||||||
u_long tmp;
|
u_long tmp;
|
||||||
|
|
||||||
tmp = ((u_long) xprt->xp_p3) | SVC_VERSQUIET;
|
tmp = ((u_long) xprt->xp_p3) | SVC_VERSQUIET;
|
||||||
xprt->xp_p3 = (caddr_t) tmp;
|
xprt->xp_p3 = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -453,7 +453,7 @@ __svc_versquiet_off(xprt)
|
|||||||
u_long tmp;
|
u_long tmp;
|
||||||
|
|
||||||
tmp = ((u_long) xprt->xp_p3) & ~SVC_VERSQUIET;
|
tmp = ((u_long) xprt->xp_p3) & ~SVC_VERSQUIET;
|
||||||
xprt->xp_p3 = (caddr_t) tmp;
|
xprt->xp_p3 = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -74,8 +74,8 @@ static void svc_dg_ops(SVCXPRT *);
|
|||||||
static enum xprt_stat svc_dg_stat(SVCXPRT *);
|
static enum xprt_stat svc_dg_stat(SVCXPRT *);
|
||||||
static bool_t svc_dg_recv(SVCXPRT *, struct rpc_msg *);
|
static bool_t svc_dg_recv(SVCXPRT *, struct rpc_msg *);
|
||||||
static bool_t svc_dg_reply(SVCXPRT *, struct rpc_msg *);
|
static bool_t svc_dg_reply(SVCXPRT *, struct rpc_msg *);
|
||||||
static bool_t svc_dg_getargs(SVCXPRT *, xdrproc_t, caddr_t);
|
static bool_t svc_dg_getargs(SVCXPRT *, xdrproc_t, void *);
|
||||||
static bool_t svc_dg_freeargs(SVCXPRT *, xdrproc_t, caddr_t);
|
static bool_t svc_dg_freeargs(SVCXPRT *, xdrproc_t, void *);
|
||||||
static void svc_dg_destroy(SVCXPRT *);
|
static void svc_dg_destroy(SVCXPRT *);
|
||||||
static bool_t svc_dg_control(SVCXPRT *, const u_int, void *);
|
static bool_t svc_dg_control(SVCXPRT *, const u_int, void *);
|
||||||
static int cache_get(SVCXPRT *, struct rpc_msg *, char **, size_t *);
|
static int cache_get(SVCXPRT *, struct rpc_msg *, char **, size_t *);
|
||||||
@ -137,7 +137,7 @@ svc_dg_create(fd, sendsize, recvsize)
|
|||||||
XDR_DECODE);
|
XDR_DECODE);
|
||||||
su->su_cache = NULL;
|
su->su_cache = NULL;
|
||||||
xprt->xp_fd = fd;
|
xprt->xp_fd = fd;
|
||||||
xprt->xp_p2 = (caddr_t)(void *)su;
|
xprt->xp_p2 = su;
|
||||||
xprt->xp_verf.oa_base = su->su_verfbody;
|
xprt->xp_verf.oa_base = su->su_verfbody;
|
||||||
svc_dg_ops(xprt);
|
svc_dg_ops(xprt);
|
||||||
xprt->xp_rtaddr.maxlen = sizeof (struct sockaddr_storage);
|
xprt->xp_rtaddr.maxlen = sizeof (struct sockaddr_storage);
|
||||||
@ -250,7 +250,7 @@ static bool_t
|
|||||||
svc_dg_getargs(xprt, xdr_args, args_ptr)
|
svc_dg_getargs(xprt, xdr_args, args_ptr)
|
||||||
SVCXPRT *xprt;
|
SVCXPRT *xprt;
|
||||||
xdrproc_t xdr_args;
|
xdrproc_t xdr_args;
|
||||||
caddr_t args_ptr;
|
void *args_ptr;
|
||||||
{
|
{
|
||||||
return (*xdr_args)(&(su_data(xprt)->su_xdrs), args_ptr);
|
return (*xdr_args)(&(su_data(xprt)->su_xdrs), args_ptr);
|
||||||
}
|
}
|
||||||
@ -259,7 +259,7 @@ static bool_t
|
|||||||
svc_dg_freeargs(xprt, xdr_args, args_ptr)
|
svc_dg_freeargs(xprt, xdr_args, args_ptr)
|
||||||
SVCXPRT *xprt;
|
SVCXPRT *xprt;
|
||||||
xdrproc_t xdr_args;
|
xdrproc_t xdr_args;
|
||||||
caddr_t args_ptr;
|
void *args_ptr;
|
||||||
{
|
{
|
||||||
XDR *xdrs = &(su_data(xprt)->su_xdrs);
|
XDR *xdrs = &(su_data(xprt)->su_xdrs);
|
||||||
|
|
||||||
|
@ -75,8 +75,8 @@ extern mutex_t svcraw_lock;
|
|||||||
static enum xprt_stat svc_raw_stat(SVCXPRT *);
|
static enum xprt_stat svc_raw_stat(SVCXPRT *);
|
||||||
static bool_t svc_raw_recv(SVCXPRT *, struct rpc_msg *);
|
static bool_t svc_raw_recv(SVCXPRT *, struct rpc_msg *);
|
||||||
static bool_t svc_raw_reply(SVCXPRT *, struct rpc_msg *);
|
static bool_t svc_raw_reply(SVCXPRT *, struct rpc_msg *);
|
||||||
static bool_t svc_raw_getargs(SVCXPRT *, xdrproc_t, caddr_t);
|
static bool_t svc_raw_getargs(SVCXPRT *, xdrproc_t, void *);
|
||||||
static bool_t svc_raw_freeargs(SVCXPRT *, xdrproc_t, caddr_t);
|
static bool_t svc_raw_freeargs(SVCXPRT *, xdrproc_t, void *);
|
||||||
static void svc_raw_destroy(SVCXPRT *);
|
static void svc_raw_destroy(SVCXPRT *);
|
||||||
static void svc_raw_ops(SVCXPRT *);
|
static void svc_raw_ops(SVCXPRT *);
|
||||||
static bool_t svc_raw_control(SVCXPRT *, const u_int, void *);
|
static bool_t svc_raw_control(SVCXPRT *, const u_int, void *);
|
||||||
@ -179,7 +179,7 @@ static bool_t
|
|||||||
svc_raw_getargs(xprt, xdr_args, args_ptr)
|
svc_raw_getargs(xprt, xdr_args, args_ptr)
|
||||||
SVCXPRT *xprt;
|
SVCXPRT *xprt;
|
||||||
xdrproc_t xdr_args;
|
xdrproc_t xdr_args;
|
||||||
caddr_t args_ptr;
|
void *args_ptr;
|
||||||
{
|
{
|
||||||
struct svc_raw_private *srp;
|
struct svc_raw_private *srp;
|
||||||
|
|
||||||
@ -198,7 +198,7 @@ static bool_t
|
|||||||
svc_raw_freeargs(xprt, xdr_args, args_ptr)
|
svc_raw_freeargs(xprt, xdr_args, args_ptr)
|
||||||
SVCXPRT *xprt;
|
SVCXPRT *xprt;
|
||||||
xdrproc_t xdr_args;
|
xdrproc_t xdr_args;
|
||||||
caddr_t args_ptr;
|
void *args_ptr;
|
||||||
{
|
{
|
||||||
struct svc_raw_private *srp;
|
struct svc_raw_private *srp;
|
||||||
XDR *xdrs;
|
XDR *xdrs;
|
||||||
|
@ -77,12 +77,12 @@ static SVCXPRT *makefd_xprt(int, u_int, u_int);
|
|||||||
static bool_t rendezvous_request(SVCXPRT *, struct rpc_msg *);
|
static bool_t rendezvous_request(SVCXPRT *, struct rpc_msg *);
|
||||||
static enum xprt_stat rendezvous_stat(SVCXPRT *);
|
static enum xprt_stat rendezvous_stat(SVCXPRT *);
|
||||||
static void svc_vc_destroy(SVCXPRT *);
|
static void svc_vc_destroy(SVCXPRT *);
|
||||||
static int read_vc(caddr_t, caddr_t, int);
|
static int read_vc(void *, void *, int);
|
||||||
static int write_vc(caddr_t, caddr_t, int);
|
static int write_vc(void *, void *, int);
|
||||||
static enum xprt_stat svc_vc_stat(SVCXPRT *);
|
static enum xprt_stat svc_vc_stat(SVCXPRT *);
|
||||||
static bool_t svc_vc_recv(SVCXPRT *, struct rpc_msg *);
|
static bool_t svc_vc_recv(SVCXPRT *, struct rpc_msg *);
|
||||||
static bool_t svc_vc_getargs(SVCXPRT *, xdrproc_t, caddr_t);
|
static bool_t svc_vc_getargs(SVCXPRT *, xdrproc_t, void *);
|
||||||
static bool_t svc_vc_freeargs(SVCXPRT *, xdrproc_t, caddr_t);
|
static bool_t svc_vc_freeargs(SVCXPRT *, xdrproc_t, void *);
|
||||||
static bool_t svc_vc_reply(SVCXPRT *, struct rpc_msg *);
|
static bool_t svc_vc_reply(SVCXPRT *, struct rpc_msg *);
|
||||||
static void svc_vc_rendezvous_ops(SVCXPRT *);
|
static void svc_vc_rendezvous_ops(SVCXPRT *);
|
||||||
static void svc_vc_ops(SVCXPRT *);
|
static void svc_vc_ops(SVCXPRT *);
|
||||||
@ -145,7 +145,7 @@ svc_vc_create(fd, sendsize, recvsize)
|
|||||||
goto cleanup_svc_vc_create;
|
goto cleanup_svc_vc_create;
|
||||||
}
|
}
|
||||||
xprt->xp_tp = NULL;
|
xprt->xp_tp = NULL;
|
||||||
xprt->xp_p1 = (caddr_t)(void *)r;
|
xprt->xp_p1 = r;
|
||||||
xprt->xp_p2 = NULL;
|
xprt->xp_p2 = NULL;
|
||||||
xprt->xp_p3 = NULL;
|
xprt->xp_p3 = NULL;
|
||||||
xprt->xp_verf = _null_auth;
|
xprt->xp_verf = _null_auth;
|
||||||
@ -265,8 +265,8 @@ makefd_xprt(fd, sendsize, recvsize)
|
|||||||
}
|
}
|
||||||
cd->strm_stat = XPRT_IDLE;
|
cd->strm_stat = XPRT_IDLE;
|
||||||
xdrrec_create(&(cd->xdrs), sendsize, recvsize,
|
xdrrec_create(&(cd->xdrs), sendsize, recvsize,
|
||||||
(caddr_t)(void *)xprt, read_vc, write_vc);
|
xprt, read_vc, write_vc);
|
||||||
xprt->xp_p1 = (caddr_t)(void *)cd;
|
xprt->xp_p1 = cd;
|
||||||
xprt->xp_verf.oa_base = cd->verf_body;
|
xprt->xp_verf.oa_base = cd->verf_body;
|
||||||
svc_vc_ops(xprt); /* truely deals with calls */
|
svc_vc_ops(xprt); /* truely deals with calls */
|
||||||
xprt->xp_port = 0; /* this is a connection, not a rendezvouser */
|
xprt->xp_port = 0; /* this is a connection, not a rendezvouser */
|
||||||
@ -389,8 +389,8 @@ svc_vc_control(xprt, rq, in)
|
|||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
read_vc(xprtp, buf, len)
|
read_vc(xprtp, buf, len)
|
||||||
caddr_t xprtp;
|
void *xprtp;
|
||||||
caddr_t buf;
|
void *buf;
|
||||||
int len;
|
int len;
|
||||||
{
|
{
|
||||||
SVCXPRT *xprt;
|
SVCXPRT *xprt;
|
||||||
@ -400,7 +400,7 @@ read_vc(xprtp, buf, len)
|
|||||||
struct sockaddr *sa;
|
struct sockaddr *sa;
|
||||||
struct cmessage *cm;
|
struct cmessage *cm;
|
||||||
|
|
||||||
xprt = (SVCXPRT *)(void *)xprtp;
|
xprt = (SVCXPRT *)xprtp;
|
||||||
assert(xprt != NULL);
|
assert(xprt != NULL);
|
||||||
|
|
||||||
sock = xprt->xp_fd;
|
sock = xprt->xp_fd;
|
||||||
@ -447,15 +447,15 @@ read_vc(xprtp, buf, len)
|
|||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
write_vc(xprtp, buf, len)
|
write_vc(xprtp, buf, len)
|
||||||
caddr_t xprtp;
|
void *xprtp;
|
||||||
caddr_t buf;
|
void *buf;
|
||||||
int len;
|
int len;
|
||||||
{
|
{
|
||||||
SVCXPRT *xprt;
|
SVCXPRT *xprt;
|
||||||
int i, cnt;
|
int i, cnt;
|
||||||
struct sockaddr *sa;
|
struct sockaddr *sa;
|
||||||
|
|
||||||
xprt = (SVCXPRT *)(void *)xprtp;
|
xprt = (SVCXPRT *)xprtp;
|
||||||
assert(xprt != NULL);
|
assert(xprt != NULL);
|
||||||
|
|
||||||
sa = (struct sockaddr *)xprt->xp_rtaddr.buf;
|
sa = (struct sockaddr *)xprt->xp_rtaddr.buf;
|
||||||
@ -527,7 +527,7 @@ static bool_t
|
|||||||
svc_vc_getargs(xprt, xdr_args, args_ptr)
|
svc_vc_getargs(xprt, xdr_args, args_ptr)
|
||||||
SVCXPRT *xprt;
|
SVCXPRT *xprt;
|
||||||
xdrproc_t xdr_args;
|
xdrproc_t xdr_args;
|
||||||
caddr_t args_ptr;
|
void *args_ptr;
|
||||||
{
|
{
|
||||||
|
|
||||||
assert(xprt != NULL);
|
assert(xprt != NULL);
|
||||||
@ -540,7 +540,7 @@ static bool_t
|
|||||||
svc_vc_freeargs(xprt, xdr_args, args_ptr)
|
svc_vc_freeargs(xprt, xdr_args, args_ptr)
|
||||||
SVCXPRT *xprt;
|
SVCXPRT *xprt;
|
||||||
xdrproc_t xdr_args;
|
xdrproc_t xdr_args;
|
||||||
caddr_t args_ptr;
|
void *args_ptr;
|
||||||
{
|
{
|
||||||
XDR *xdrs;
|
XDR *xdrs;
|
||||||
|
|
||||||
@ -613,11 +613,11 @@ svc_vc_rendezvous_ops(xprt)
|
|||||||
ops.xp_recv = rendezvous_request;
|
ops.xp_recv = rendezvous_request;
|
||||||
ops.xp_stat = rendezvous_stat;
|
ops.xp_stat = rendezvous_stat;
|
||||||
ops.xp_getargs =
|
ops.xp_getargs =
|
||||||
(bool_t (*)(SVCXPRT *, xdrproc_t, caddr_t))abort;
|
(bool_t (*)(SVCXPRT *, xdrproc_t, void *))abort;
|
||||||
ops.xp_reply =
|
ops.xp_reply =
|
||||||
(bool_t (*)(SVCXPRT *, struct rpc_msg *))abort;
|
(bool_t (*)(SVCXPRT *, struct rpc_msg *))abort;
|
||||||
ops.xp_freeargs =
|
ops.xp_freeargs =
|
||||||
(bool_t (*)(SVCXPRT *, xdrproc_t, caddr_t))abort,
|
(bool_t (*)(SVCXPRT *, xdrproc_t, void *))abort,
|
||||||
ops.xp_destroy = svc_vc_destroy;
|
ops.xp_destroy = svc_vc_destroy;
|
||||||
ops2.xp_control = svc_vc_control;
|
ops2.xp_control = svc_vc_control;
|
||||||
}
|
}
|
||||||
@ -687,7 +687,7 @@ __msgwrite(sock, buf, cnt)
|
|||||||
msg.msg_iovlen = 1;
|
msg.msg_iovlen = 1;
|
||||||
msg.msg_name = NULL;
|
msg.msg_name = NULL;
|
||||||
msg.msg_namelen = 0;
|
msg.msg_namelen = 0;
|
||||||
msg.msg_control = (caddr_t)&cm;
|
msg.msg_control = &cm;
|
||||||
msg.msg_controllen = sizeof(struct cmessage);
|
msg.msg_controllen = sizeof(struct cmessage);
|
||||||
msg.msg_flags = 0;
|
msg.msg_flags = 0;
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ static const char xdr_zero[BYTES_PER_XDR_UNIT] = { 0, 0, 0, 0 };
|
|||||||
void
|
void
|
||||||
xdr_free(proc, objp)
|
xdr_free(proc, objp)
|
||||||
xdrproc_t proc;
|
xdrproc_t proc;
|
||||||
char *objp;
|
void *objp;
|
||||||
{
|
{
|
||||||
XDR x;
|
XDR x;
|
||||||
|
|
||||||
@ -90,9 +90,7 @@ xdr_free(proc, objp)
|
|||||||
* XDR nothing
|
* XDR nothing
|
||||||
*/
|
*/
|
||||||
bool_t
|
bool_t
|
||||||
xdr_void(/* xdrs, addr */)
|
xdr_void(void)
|
||||||
/* XDR *xdrs; */
|
|
||||||
/* caddr_t addr; */
|
|
||||||
{
|
{
|
||||||
|
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
|
@ -110,7 +110,7 @@ typedef struct rec_strm {
|
|||||||
/*
|
/*
|
||||||
* out-goung bits
|
* out-goung bits
|
||||||
*/
|
*/
|
||||||
int (*writeit)(char *, char *, int);
|
int (*writeit)(void *, void *, int);
|
||||||
char *out_base; /* output buffer (points to frag header) */
|
char *out_base; /* output buffer (points to frag header) */
|
||||||
char *out_finger; /* next output position */
|
char *out_finger; /* next output position */
|
||||||
char *out_boundry; /* data cannot up to this address */
|
char *out_boundry; /* data cannot up to this address */
|
||||||
@ -119,7 +119,7 @@ typedef struct rec_strm {
|
|||||||
/*
|
/*
|
||||||
* in-coming bits
|
* in-coming bits
|
||||||
*/
|
*/
|
||||||
int (*readit)(char *, char *, int);
|
int (*readit)(void *, void *, int);
|
||||||
u_long in_size; /* fixed size of the input buffer */
|
u_long in_size; /* fixed size of the input buffer */
|
||||||
char *in_base;
|
char *in_base;
|
||||||
char *in_finger; /* location of next byte to be had */
|
char *in_finger; /* location of next byte to be had */
|
||||||
@ -152,11 +152,11 @@ xdrrec_create(xdrs, sendsize, recvsize, tcp_handle, readit, writeit)
|
|||||||
XDR *xdrs;
|
XDR *xdrs;
|
||||||
u_int sendsize;
|
u_int sendsize;
|
||||||
u_int recvsize;
|
u_int recvsize;
|
||||||
char *tcp_handle;
|
void *tcp_handle;
|
||||||
/* like read, but pass it a tcp_handle, not sock */
|
/* like read, but pass it a tcp_handle, not sock */
|
||||||
int (*readit)(char *, char *, int);
|
int (*readit)(void *, void *, int);
|
||||||
/* like write, but pass it a tcp_handle, not sock */
|
/* like write, but pass it a tcp_handle, not sock */
|
||||||
int (*writeit)(char *, char *, int);
|
int (*writeit)(void *, void *, int);
|
||||||
{
|
{
|
||||||
RECSTREAM *rstrm = mem_alloc(sizeof(RECSTREAM));
|
RECSTREAM *rstrm = mem_alloc(sizeof(RECSTREAM));
|
||||||
|
|
||||||
|
@ -69,12 +69,12 @@ xdr_ypresp_all_seq(XDR *xdrs, u_long *objp)
|
|||||||
bzero(&out, sizeof out);
|
bzero(&out, sizeof out);
|
||||||
while (1) {
|
while (1) {
|
||||||
if (!xdr_ypresp_all(xdrs, &out)) {
|
if (!xdr_ypresp_all(xdrs, &out)) {
|
||||||
xdr_free(xdr_ypresp_all, (char *)&out);
|
xdr_free((xdrproc_t)xdr_ypresp_all, &out);
|
||||||
*objp = YP_YPERR;
|
*objp = YP_YPERR;
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
if (out.more == 0) {
|
if (out.more == 0) {
|
||||||
xdr_free(xdr_ypresp_all, (char *)&out);
|
xdr_free((xdrproc_t)xdr_ypresp_all, &out);
|
||||||
*objp = YP_NOMORE;
|
*objp = YP_NOMORE;
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
}
|
}
|
||||||
@ -89,7 +89,7 @@ xdr_ypresp_all_seq(XDR *xdrs, u_long *objp)
|
|||||||
bcopy(out.ypresp_all_u.val.val.valdat_val, val,
|
bcopy(out.ypresp_all_u.val.val.valdat_val, val,
|
||||||
out.ypresp_all_u.val.val.valdat_len);
|
out.ypresp_all_u.val.val.valdat_len);
|
||||||
val[out.ypresp_all_u.val.val.valdat_len] = '\0';
|
val[out.ypresp_all_u.val.val.valdat_len] = '\0';
|
||||||
xdr_free(xdr_ypresp_all, (char *)&out);
|
xdr_free((xdrproc_t)xdr_ypresp_all, &out);
|
||||||
|
|
||||||
r = (*ypresp_allfn)(status,
|
r = (*ypresp_allfn)(status,
|
||||||
key, out.ypresp_all_u.val.key.keydat_len,
|
key, out.ypresp_all_u.val.key.keydat_len,
|
||||||
@ -102,11 +102,11 @@ xdr_ypresp_all_seq(XDR *xdrs, u_long *objp)
|
|||||||
return (TRUE);
|
return (TRUE);
|
||||||
break;
|
break;
|
||||||
case YP_NOMORE:
|
case YP_NOMORE:
|
||||||
xdr_free(xdr_ypresp_all, (char *)&out);
|
xdr_free((xdrproc_t)xdr_ypresp_all, &out);
|
||||||
*objp = YP_NOMORE;
|
*objp = YP_NOMORE;
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
default:
|
default:
|
||||||
xdr_free(xdr_ypresp_all, (char *)&out);
|
xdr_free((xdrproc_t)xdr_ypresp_all, &out);
|
||||||
*objp = status;
|
*objp = status;
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
}
|
}
|
||||||
|
@ -260,7 +260,7 @@ ypmatch_cache_lookup(struct dom_binding *ypdb, char *map, keydat *key,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
char *
|
const char *
|
||||||
ypbinderr_string(int incode)
|
ypbinderr_string(int incode)
|
||||||
{
|
{
|
||||||
static char err[80];
|
static char err[80];
|
||||||
@ -461,7 +461,8 @@ _yp_dobind(char *dom, struct dom_binding **ypdb)
|
|||||||
tv.tv_sec = _yplib_timeout/2;
|
tv.tv_sec = _yplib_timeout/2;
|
||||||
tv.tv_usec = 0;
|
tv.tv_usec = 0;
|
||||||
r = clnt_call(client, YPBINDPROC_DOMAIN,
|
r = clnt_call(client, YPBINDPROC_DOMAIN,
|
||||||
xdr_domainname, (char *)&dom, xdr_ypbind_resp, &ypbr, tv);
|
(xdrproc_t)xdr_domainname, &dom,
|
||||||
|
(xdrproc_t)xdr_ypbind_resp, &ypbr, tv);
|
||||||
if (r != RPC_SUCCESS) {
|
if (r != RPC_SUCCESS) {
|
||||||
clnt_destroy(client);
|
clnt_destroy(client);
|
||||||
ysd->dom_vers = -1;
|
ysd->dom_vers = -1;
|
||||||
@ -663,7 +664,8 @@ yp_match(char *indomain, char *inmap, const char *inkey, int inkeylen,
|
|||||||
bzero((char *)&yprv, sizeof yprv);
|
bzero((char *)&yprv, sizeof yprv);
|
||||||
|
|
||||||
r = clnt_call(ysd->dom_client, YPPROC_MATCH,
|
r = clnt_call(ysd->dom_client, YPPROC_MATCH,
|
||||||
xdr_ypreq_key, &yprk, xdr_ypresp_val, &yprv, tv);
|
(xdrproc_t)xdr_ypreq_key, &yprk,
|
||||||
|
(xdrproc_t)xdr_ypresp_val, &yprv, tv);
|
||||||
if (r != RPC_SUCCESS) {
|
if (r != RPC_SUCCESS) {
|
||||||
clnt_perror(ysd->dom_client, "yp_match: clnt_call");
|
clnt_perror(ysd->dom_client, "yp_match: clnt_call");
|
||||||
_yp_unbind(ysd);
|
_yp_unbind(ysd);
|
||||||
@ -680,7 +682,7 @@ yp_match(char *indomain, char *inmap, const char *inkey, int inkeylen,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
xdr_free(xdr_ypresp_val, (char *)&yprv);
|
xdr_free((xdrproc_t)xdr_ypresp_val, &yprv);
|
||||||
return (r);
|
return (r);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -726,7 +728,8 @@ yp_first(char *indomain, char *inmap, char **outkey, int *outkeylen,
|
|||||||
bzero((char *)&yprkv, sizeof yprkv);
|
bzero((char *)&yprkv, sizeof yprkv);
|
||||||
|
|
||||||
r = clnt_call(ysd->dom_client, YPPROC_FIRST,
|
r = clnt_call(ysd->dom_client, YPPROC_FIRST,
|
||||||
xdr_ypreq_nokey, &yprnk, xdr_ypresp_key_val, &yprkv, tv);
|
(xdrproc_t)xdr_ypreq_nokey, &yprnk,
|
||||||
|
(xdrproc_t)xdr_ypresp_key_val, &yprkv, tv);
|
||||||
if (r != RPC_SUCCESS) {
|
if (r != RPC_SUCCESS) {
|
||||||
clnt_perror(ysd->dom_client, "yp_first: clnt_call");
|
clnt_perror(ysd->dom_client, "yp_first: clnt_call");
|
||||||
_yp_unbind(ysd);
|
_yp_unbind(ysd);
|
||||||
@ -743,7 +746,7 @@ yp_first(char *indomain, char *inmap, char **outkey, int *outkeylen,
|
|||||||
(*outval)[*outvallen] = '\0';
|
(*outval)[*outvallen] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
xdr_free(xdr_ypresp_key_val, (char *)&yprkv);
|
xdr_free((xdrproc_t)xdr_ypresp_key_val, &yprkv);
|
||||||
return (r);
|
return (r);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -781,7 +784,8 @@ yp_next(char *indomain, char *inmap, char *inkey, int inkeylen,
|
|||||||
bzero((char *)&yprkv, sizeof yprkv);
|
bzero((char *)&yprkv, sizeof yprkv);
|
||||||
|
|
||||||
r = clnt_call(ysd->dom_client, YPPROC_NEXT,
|
r = clnt_call(ysd->dom_client, YPPROC_NEXT,
|
||||||
xdr_ypreq_key, &yprk, xdr_ypresp_key_val, &yprkv, tv);
|
(xdrproc_t)xdr_ypreq_key, &yprk,
|
||||||
|
(xdrproc_t)xdr_ypresp_key_val, &yprkv, tv);
|
||||||
if (r != RPC_SUCCESS) {
|
if (r != RPC_SUCCESS) {
|
||||||
clnt_perror(ysd->dom_client, "yp_next: clnt_call");
|
clnt_perror(ysd->dom_client, "yp_next: clnt_call");
|
||||||
_yp_unbind(ysd);
|
_yp_unbind(ysd);
|
||||||
@ -798,7 +802,7 @@ yp_next(char *indomain, char *inmap, char *inkey, int inkeylen,
|
|||||||
(*outval)[*outvallen] = '\0';
|
(*outval)[*outvallen] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
xdr_free(xdr_ypresp_key_val, (char *)&yprkv);
|
xdr_free((xdrproc_t)xdr_ypresp_key_val, &yprkv);
|
||||||
return (r);
|
return (r);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -844,8 +848,8 @@ yp_all(char *indomain, char *inmap, struct ypall_callback *incallback)
|
|||||||
ypresp_data = (void *)incallback->data;
|
ypresp_data = (void *)incallback->data;
|
||||||
|
|
||||||
if (clnt_call(clnt, YPPROC_ALL,
|
if (clnt_call(clnt, YPPROC_ALL,
|
||||||
xdr_ypreq_nokey, &yprnk,
|
(xdrproc_t)xdr_ypreq_nokey, &yprnk,
|
||||||
xdr_ypresp_all_seq, &status, tv) != RPC_SUCCESS) {
|
(xdrproc_t)xdr_ypresp_all_seq, &status, tv) != RPC_SUCCESS) {
|
||||||
clnt_perror(ysd->dom_client, "yp_all: clnt_call");
|
clnt_perror(ysd->dom_client, "yp_all: clnt_call");
|
||||||
clnt_destroy(clnt);
|
clnt_destroy(clnt);
|
||||||
_yp_unbind(ysd);
|
_yp_unbind(ysd);
|
||||||
@ -854,7 +858,7 @@ yp_all(char *indomain, char *inmap, struct ypall_callback *incallback)
|
|||||||
|
|
||||||
clnt_destroy(clnt);
|
clnt_destroy(clnt);
|
||||||
savstat = status;
|
savstat = status;
|
||||||
xdr_free(xdr_ypresp_all_seq, (char *)&status); /* not really needed... */
|
xdr_free((xdrproc_t)xdr_ypresp_all_seq, &status); /* not really needed... */
|
||||||
if (savstat != YP_NOMORE)
|
if (savstat != YP_NOMORE)
|
||||||
return (ypprot_err(savstat));
|
return (ypprot_err(savstat));
|
||||||
return (0);
|
return (0);
|
||||||
@ -888,7 +892,8 @@ yp_order(char *indomain, char *inmap, int *outorder)
|
|||||||
bzero((char *)(char *)&ypro, sizeof ypro);
|
bzero((char *)(char *)&ypro, sizeof ypro);
|
||||||
|
|
||||||
r = clnt_call(ysd->dom_client, YPPROC_ORDER,
|
r = clnt_call(ysd->dom_client, YPPROC_ORDER,
|
||||||
xdr_ypreq_nokey, &yprnk, xdr_ypresp_order, &ypro, tv);
|
(xdrproc_t)xdr_ypreq_nokey, &yprnk,
|
||||||
|
(xdrproc_t)xdr_ypresp_order, &ypro, tv);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NIS+ in YP compat mode doesn't support the YPPROC_ORDER
|
* NIS+ in YP compat mode doesn't support the YPPROC_ORDER
|
||||||
@ -908,7 +913,7 @@ yp_order(char *indomain, char *inmap, int *outorder)
|
|||||||
*outorder = ypro.ordernum;
|
*outorder = ypro.ordernum;
|
||||||
}
|
}
|
||||||
|
|
||||||
xdr_free(xdr_ypresp_order, (char *)&ypro);
|
xdr_free((xdrproc_t)xdr_ypresp_order, &ypro);
|
||||||
return (r);
|
return (r);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -939,7 +944,8 @@ yp_master(char *indomain, char *inmap, char **outname)
|
|||||||
bzero((char *)&yprm, sizeof yprm);
|
bzero((char *)&yprm, sizeof yprm);
|
||||||
|
|
||||||
r = clnt_call(ysd->dom_client, YPPROC_MASTER,
|
r = clnt_call(ysd->dom_client, YPPROC_MASTER,
|
||||||
xdr_ypreq_nokey, &yprnk, xdr_ypresp_master, &yprm, tv);
|
(xdrproc_t)xdr_ypreq_nokey, &yprnk,
|
||||||
|
(xdrproc_t)xdr_ypresp_master, &yprm, tv);
|
||||||
if (r != RPC_SUCCESS) {
|
if (r != RPC_SUCCESS) {
|
||||||
clnt_perror(ysd->dom_client, "yp_master: clnt_call");
|
clnt_perror(ysd->dom_client, "yp_master: clnt_call");
|
||||||
_yp_unbind(ysd);
|
_yp_unbind(ysd);
|
||||||
@ -950,7 +956,7 @@ yp_master(char *indomain, char *inmap, char **outname)
|
|||||||
*outname = (char *)strdup(yprm.peer);
|
*outname = (char *)strdup(yprm.peer);
|
||||||
}
|
}
|
||||||
|
|
||||||
xdr_free(xdr_ypresp_master, (char *)&yprm);
|
xdr_free((xdrproc_t)xdr_ypresp_master, &yprm);
|
||||||
return (r);
|
return (r);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -977,7 +983,8 @@ yp_maplist(char *indomain, struct ypmaplist **outmaplist)
|
|||||||
bzero((char *)&ypml, sizeof ypml);
|
bzero((char *)&ypml, sizeof ypml);
|
||||||
|
|
||||||
r = clnt_call(ysd->dom_client, YPPROC_MAPLIST,
|
r = clnt_call(ysd->dom_client, YPPROC_MAPLIST,
|
||||||
xdr_domainname,(char *)&indomain,xdr_ypresp_maplist,&ypml,tv);
|
(xdrproc_t)xdr_domainname, &indomain,
|
||||||
|
(xdrproc_t)xdr_ypresp_maplist, &ypml,tv);
|
||||||
if (r != RPC_SUCCESS) {
|
if (r != RPC_SUCCESS) {
|
||||||
clnt_perror(ysd->dom_client, "yp_maplist: clnt_call");
|
clnt_perror(ysd->dom_client, "yp_maplist: clnt_call");
|
||||||
_yp_unbind(ysd);
|
_yp_unbind(ysd);
|
||||||
@ -987,11 +994,11 @@ yp_maplist(char *indomain, struct ypmaplist **outmaplist)
|
|||||||
*outmaplist = ypml.maps;
|
*outmaplist = ypml.maps;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* NO: xdr_free(xdr_ypresp_maplist, &ypml);*/
|
/* NO: xdr_free((xdrproc_t)xdr_ypresp_maplist, &ypml);*/
|
||||||
return (r);
|
return (r);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
const char *
|
||||||
yperr_string(int incode)
|
yperr_string(int incode)
|
||||||
{
|
{
|
||||||
static char err[80];
|
static char err[80];
|
||||||
|
@ -114,7 +114,7 @@ rquota_service(struct svc_req *request, SVCXPRT *transp)
|
|||||||
{
|
{
|
||||||
switch (request->rq_proc) {
|
switch (request->rq_proc) {
|
||||||
case NULLPROC:
|
case NULLPROC:
|
||||||
(void)svc_sendreply(transp, xdr_void, (char *)NULL);
|
(void)svc_sendreply(transp, (xdrproc_t)xdr_void, (char *)NULL);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RQUOTAPROC_GETQUOTA:
|
case RQUOTAPROC_GETQUOTA:
|
||||||
@ -140,7 +140,7 @@ sendquota(struct svc_req *request, SVCXPRT *transp)
|
|||||||
struct timeval timev;
|
struct timeval timev;
|
||||||
|
|
||||||
bzero((char *)&getq_args, sizeof(getq_args));
|
bzero((char *)&getq_args, sizeof(getq_args));
|
||||||
if (!svc_getargs(transp, xdr_getquota_args, (caddr_t)&getq_args)) {
|
if (!svc_getargs(transp, (xdrproc_t)xdr_getquota_args, &getq_args)) {
|
||||||
svcerr_decode(transp);
|
svcerr_decode(transp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -172,10 +172,10 @@ sendquota(struct svc_req *request, SVCXPRT *transp)
|
|||||||
getq_rslt.getquota_rslt_u.gqr_rquota.rq_ftimeleft =
|
getq_rslt.getquota_rslt_u.gqr_rquota.rq_ftimeleft =
|
||||||
dqblk.dqb_itime - timev.tv_sec;
|
dqblk.dqb_itime - timev.tv_sec;
|
||||||
}
|
}
|
||||||
if (!svc_sendreply(transp, xdr_getquota_rslt, (char *)&getq_rslt)) {
|
if (!svc_sendreply(transp, (xdrproc_t)xdr_getquota_rslt, &getq_rslt)) {
|
||||||
svcerr_systemerr(transp);
|
svcerr_systemerr(transp);
|
||||||
}
|
}
|
||||||
if (!svc_freeargs(transp, xdr_getquota_args, (caddr_t)&getq_args)) {
|
if (!svc_freeargs(transp, (xdrproc_t)xdr_getquota_args, &getq_args)) {
|
||||||
syslog(LOG_ERR, "unable to free arguments");
|
syslog(LOG_ERR, "unable to free arguments");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -273,7 +273,7 @@ getfsquota(long id, char *path, struct dqblk *dqblk)
|
|||||||
* Convert implicit 0 quota (EOF)
|
* Convert implicit 0 quota (EOF)
|
||||||
* into an explicit one (zero'ed dqblk)
|
* into an explicit one (zero'ed dqblk)
|
||||||
*/
|
*/
|
||||||
bzero((caddr_t) dqblk, sizeof(struct dqblk));
|
bzero(dqblk, sizeof(struct dqblk));
|
||||||
ret = 1;
|
ret = 1;
|
||||||
break;
|
break;
|
||||||
case sizeof(struct dqblk): /* OK */
|
case sizeof(struct dqblk): /* OK */
|
||||||
|
@ -438,7 +438,7 @@ rstat_service(struct svc_req *rqstp, SVCXPRT *transp)
|
|||||||
|
|
||||||
switch (rqstp->rq_proc) {
|
switch (rqstp->rq_proc) {
|
||||||
case NULLPROC:
|
case NULLPROC:
|
||||||
(void)svc_sendreply(transp, xdr_void, (char *)NULL);
|
(void)svc_sendreply(transp, (xdrproc_t)xdr_void, NULL);
|
||||||
goto leave;
|
goto leave;
|
||||||
|
|
||||||
case RSTATPROC_STATS:
|
case RSTATPROC_STATS:
|
||||||
@ -486,15 +486,16 @@ rstat_service(struct svc_req *rqstp, SVCXPRT *transp)
|
|||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
bzero((char *)&argument, sizeof(argument));
|
bzero((char *)&argument, sizeof(argument));
|
||||||
if (!svc_getargs(transp, xdr_argument, (caddr_t)&argument)) {
|
if (!svc_getargs(transp, (xdrproc_t)xdr_argument, &argument)) {
|
||||||
svcerr_decode(transp);
|
svcerr_decode(transp);
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
result = (*local)(&argument, rqstp);
|
result = (*local)(&argument, rqstp);
|
||||||
if (result != NULL && !svc_sendreply(transp, xdr_result, result)) {
|
if (result != NULL &&
|
||||||
|
!svc_sendreply(transp, (xdrproc_t)xdr_result, result)) {
|
||||||
svcerr_systemerr(transp);
|
svcerr_systemerr(transp);
|
||||||
}
|
}
|
||||||
if (!svc_freeargs(transp, xdr_argument, (caddr_t)&argument))
|
if (!svc_freeargs(transp, (xdrproc_t)xdr_argument, &argument))
|
||||||
errx(1, "unable to free arguments");
|
errx(1, "unable to free arguments");
|
||||||
leave:
|
leave:
|
||||||
if (from_inetd)
|
if (from_inetd)
|
||||||
|
@ -322,7 +322,7 @@ rusers_service(struct svc_req *rqstp, SVCXPRT *transp)
|
|||||||
|
|
||||||
switch (rqstp->rq_proc) {
|
switch (rqstp->rq_proc) {
|
||||||
case NULLPROC:
|
case NULLPROC:
|
||||||
(void)svc_sendreply(transp, xdr_void, (char *)NULL);
|
(void)svc_sendreply(transp, (xdrproc_t)xdr_void, NULL);
|
||||||
goto leave;
|
goto leave;
|
||||||
|
|
||||||
case RUSERSPROC_NUM:
|
case RUSERSPROC_NUM:
|
||||||
@ -369,16 +369,17 @@ rusers_service(struct svc_req *rqstp, SVCXPRT *transp)
|
|||||||
svcerr_noproc(transp);
|
svcerr_noproc(transp);
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
bzero((char *)&argument, sizeof(argument));
|
bzero(&argument, sizeof(argument));
|
||||||
if (!svc_getargs(transp, xdr_argument, (caddr_t)&argument)) {
|
if (!svc_getargs(transp, (xdrproc_t)xdr_argument, &argument)) {
|
||||||
svcerr_decode(transp);
|
svcerr_decode(transp);
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
result = (*local)(&argument, rqstp);
|
result = (*local)(&argument, rqstp);
|
||||||
if (result != NULL && !svc_sendreply(transp, xdr_result, result)) {
|
if (result != NULL &&
|
||||||
|
!svc_sendreply(transp, (xdrproc_t)xdr_result, result)) {
|
||||||
svcerr_systemerr(transp);
|
svcerr_systemerr(transp);
|
||||||
}
|
}
|
||||||
if (!svc_freeargs(transp, xdr_argument, (caddr_t)&argument)) {
|
if (!svc_freeargs(transp, (xdrproc_t)xdr_argument, &argument)) {
|
||||||
syslog(LOG_ERR, "unable to free arguments");
|
syslog(LOG_ERR, "unable to free arguments");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ main(int argc, char *argv[])
|
|||||||
(void)pmap_unset(WALLPROG, WALLVERS);
|
(void)pmap_unset(WALLPROG, WALLVERS);
|
||||||
if ((s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
|
if ((s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
|
||||||
err(1, "socket");
|
err(1, "socket");
|
||||||
bzero((char *)&sa, sizeof sa);
|
bzero(&sa, sizeof sa);
|
||||||
if (bind(s, (struct sockaddr *)&sa, sizeof sa) < 0)
|
if (bind(s, (struct sockaddr *)&sa, sizeof sa) < 0)
|
||||||
err(1, "bind");
|
err(1, "bind");
|
||||||
|
|
||||||
@ -184,7 +184,7 @@ wallprog_1(struct svc_req *rqstp, SVCXPRT *transp)
|
|||||||
|
|
||||||
switch (rqstp->rq_proc) {
|
switch (rqstp->rq_proc) {
|
||||||
case NULLPROC:
|
case NULLPROC:
|
||||||
(void)svc_sendreply(transp, xdr_void, (char *)NULL);
|
(void)svc_sendreply(transp, (xdrproc_t)xdr_void, NULL);
|
||||||
goto leave;
|
goto leave;
|
||||||
|
|
||||||
case WALLPROC_WALL:
|
case WALLPROC_WALL:
|
||||||
@ -197,16 +197,17 @@ wallprog_1(struct svc_req *rqstp, SVCXPRT *transp)
|
|||||||
svcerr_noproc(transp);
|
svcerr_noproc(transp);
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
bzero((char *)&argument, sizeof(argument));
|
bzero(&argument, sizeof(argument));
|
||||||
if (!svc_getargs(transp, xdr_argument, (caddr_t)&argument)) {
|
if (!svc_getargs(transp, (xdrproc_t)xdr_argument, &argument)) {
|
||||||
svcerr_decode(transp);
|
svcerr_decode(transp);
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
result = (*local)(&argument, rqstp);
|
result = (*local)(&argument, rqstp);
|
||||||
if (result != NULL && !svc_sendreply(transp, xdr_result, result)) {
|
if (result != NULL &&
|
||||||
|
!svc_sendreply(transp, (xdrproc_t)xdr_result, result)) {
|
||||||
svcerr_systemerr(transp);
|
svcerr_systemerr(transp);
|
||||||
}
|
}
|
||||||
if (!svc_freeargs(transp, xdr_argument, (caddr_t)&argument)) {
|
if (!svc_freeargs(transp, (xdrproc_t)xdr_argument, &argument)) {
|
||||||
syslog(LOG_ERR, "unable to free arguments");
|
syslog(LOG_ERR, "unable to free arguments");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@ spray_service(struct svc_req *rqstp, SVCXPRT *transp)
|
|||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
|
|
||||||
case NULLPROC:
|
case NULLPROC:
|
||||||
(void)svc_sendreply(transp, xdr_void, (char *)NULL);
|
(void)svc_sendreply(transp, (xdrproc_t)xdr_void, NULL);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case SPRAYPROC_SPRAY:
|
case SPRAYPROC_SPRAY:
|
||||||
@ -157,7 +157,7 @@ spray_service(struct svc_req *rqstp, SVCXPRT *transp)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!svc_sendreply(transp, xdr_spraycumul, (caddr_t)&scum)) {
|
if (!svc_sendreply(transp, (xdrproc_t)xdr_spraycumul, &scum)) {
|
||||||
svcerr_systemerr(transp);
|
svcerr_systemerr(transp);
|
||||||
syslog(LOG_ERR, "bad svc_sendreply");
|
syslog(LOG_ERR, "bad svc_sendreply");
|
||||||
}
|
}
|
||||||
|
@ -84,8 +84,8 @@ create tcp handle"));
|
|||||||
ypresp_allfn = callback;
|
ypresp_allfn = callback;
|
||||||
ypresp_data = NULL;
|
ypresp_data = NULL;
|
||||||
|
|
||||||
(void)clnt_call(clnt, YPPROC_ALL, xdr_ypreq_nokey, &req,
|
(void)clnt_call(clnt, YPPROC_ALL, (xdrproc_t)xdr_ypreq_nokey, &req,
|
||||||
xdr_ypresp_all_seq, &status, timeout);
|
(xdrproc_t)xdr_ypresp_all_seq, &status, timeout);
|
||||||
|
|
||||||
clnt_destroy(clnt);
|
clnt_destroy(clnt);
|
||||||
|
|
||||||
|
@ -263,7 +263,7 @@ ypxfr_match(char *server, char *domain, char *map, char *key,
|
|||||||
CLIENT *clnt;
|
CLIENT *clnt;
|
||||||
static char buf[YPMAXRECORD + 2];
|
static char buf[YPMAXRECORD + 2];
|
||||||
|
|
||||||
bzero((char *)buf, sizeof(buf));
|
bzero(buf, sizeof(buf));
|
||||||
|
|
||||||
if ((clnt = clnt_create(server, YPPROG,YPVERS,"udp")) == NULL) {
|
if ((clnt = clnt_create(server, YPPROG,YPVERS,"udp")) == NULL) {
|
||||||
yp_error("failed to create UDP handle: %s",
|
yp_error("failed to create UDP handle: %s",
|
||||||
@ -286,11 +286,11 @@ ypxfr_match(char *server, char *domain, char *map, char *key,
|
|||||||
clnt_destroy(clnt);
|
clnt_destroy(clnt);
|
||||||
|
|
||||||
if (ypval->stat != YP_TRUE) {
|
if (ypval->stat != YP_TRUE) {
|
||||||
xdr_free(xdr_ypresp_val, (char *)ypval);
|
xdr_free((xdrproc_t)xdr_ypresp_val, ypval);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
xdr_free(xdr_ypresp_val, (char *)ypval);
|
xdr_free((xdrproc_t)xdr_ypresp_val, ypval);
|
||||||
|
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
@ -633,83 +633,83 @@ keyprogram(rqstp, transp)
|
|||||||
netobj key_get_conv_2_arg;
|
netobj key_get_conv_2_arg;
|
||||||
} argument;
|
} argument;
|
||||||
char *result;
|
char *result;
|
||||||
bool_t(*xdr_argument)(), (*xdr_result)();
|
xdrproc_t xdr_argument, xdr_result;
|
||||||
char *(*local) ();
|
char *(*local) ();
|
||||||
uid_t uid = -1;
|
uid_t uid = -1;
|
||||||
int check_auth;
|
int check_auth;
|
||||||
|
|
||||||
switch (rqstp->rq_proc) {
|
switch (rqstp->rq_proc) {
|
||||||
case NULLPROC:
|
case NULLPROC:
|
||||||
svc_sendreply(transp, xdr_void, (char *)NULL);
|
svc_sendreply(transp, (xdrproc_t)xdr_void, NULL);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case KEY_SET:
|
case KEY_SET:
|
||||||
xdr_argument = xdr_keybuf;
|
xdr_argument = (xdrproc_t)xdr_keybuf;
|
||||||
xdr_result = xdr_int;
|
xdr_result = (xdrproc_t)xdr_int;
|
||||||
local = (char *(*)()) key_set_1_svc_prog;
|
local = (char *(*)()) key_set_1_svc_prog;
|
||||||
check_auth = 1;
|
check_auth = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KEY_ENCRYPT:
|
case KEY_ENCRYPT:
|
||||||
xdr_argument = xdr_cryptkeyarg;
|
xdr_argument = (xdrproc_t)xdr_cryptkeyarg;
|
||||||
xdr_result = xdr_cryptkeyres;
|
xdr_result = (xdrproc_t)xdr_cryptkeyres;
|
||||||
local = (char *(*)()) key_encrypt_1_svc_prog;
|
local = (char *(*)()) key_encrypt_1_svc_prog;
|
||||||
check_auth = 1;
|
check_auth = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KEY_DECRYPT:
|
case KEY_DECRYPT:
|
||||||
xdr_argument = xdr_cryptkeyarg;
|
xdr_argument = (xdrproc_t)xdr_cryptkeyarg;
|
||||||
xdr_result = xdr_cryptkeyres;
|
xdr_result = (xdrproc_t)xdr_cryptkeyres;
|
||||||
local = (char *(*)()) key_decrypt_1_svc_prog;
|
local = (char *(*)()) key_decrypt_1_svc_prog;
|
||||||
check_auth = 1;
|
check_auth = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KEY_GEN:
|
case KEY_GEN:
|
||||||
xdr_argument = xdr_void;
|
xdr_argument = (xdrproc_t)xdr_void;
|
||||||
xdr_result = xdr_des_block;
|
xdr_result = (xdrproc_t)xdr_des_block;
|
||||||
local = (char *(*)()) key_gen_1_svc_prog;
|
local = (char *(*)()) key_gen_1_svc_prog;
|
||||||
check_auth = 0;
|
check_auth = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KEY_GETCRED:
|
case KEY_GETCRED:
|
||||||
xdr_argument = xdr_netnamestr;
|
xdr_argument = (xdrproc_t)xdr_netnamestr;
|
||||||
xdr_result = xdr_getcredres;
|
xdr_result = (xdrproc_t)xdr_getcredres;
|
||||||
local = (char *(*)()) key_getcred_1_svc_prog;
|
local = (char *(*)()) key_getcred_1_svc_prog;
|
||||||
check_auth = 0;
|
check_auth = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KEY_ENCRYPT_PK:
|
case KEY_ENCRYPT_PK:
|
||||||
xdr_argument = xdr_cryptkeyarg2;
|
xdr_argument = (xdrproc_t)xdr_cryptkeyarg2;
|
||||||
xdr_result = xdr_cryptkeyres;
|
xdr_result = (xdrproc_t)xdr_cryptkeyres;
|
||||||
local = (char *(*)()) key_encrypt_pk_2_svc_prog;
|
local = (char *(*)()) key_encrypt_pk_2_svc_prog;
|
||||||
check_auth = 1;
|
check_auth = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KEY_DECRYPT_PK:
|
case KEY_DECRYPT_PK:
|
||||||
xdr_argument = xdr_cryptkeyarg2;
|
xdr_argument = (xdrproc_t)xdr_cryptkeyarg2;
|
||||||
xdr_result = xdr_cryptkeyres;
|
xdr_result = (xdrproc_t)xdr_cryptkeyres;
|
||||||
local = (char *(*)()) key_decrypt_pk_2_svc_prog;
|
local = (char *(*)()) key_decrypt_pk_2_svc_prog;
|
||||||
check_auth = 1;
|
check_auth = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case KEY_NET_PUT:
|
case KEY_NET_PUT:
|
||||||
xdr_argument = xdr_key_netstarg;
|
xdr_argument = (xdrproc_t)xdr_key_netstarg;
|
||||||
xdr_result = xdr_keystatus;
|
xdr_result = (xdrproc_t)xdr_keystatus;
|
||||||
local = (char *(*)()) key_net_put_2_svc_prog;
|
local = (char *(*)()) key_net_put_2_svc_prog;
|
||||||
check_auth = 1;
|
check_auth = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KEY_NET_GET:
|
case KEY_NET_GET:
|
||||||
xdr_argument = (xdrproc_t) xdr_void;
|
xdr_argument = (xdrproc_t) xdr_void;
|
||||||
xdr_result = xdr_key_netstres;
|
xdr_result = (xdrproc_t)xdr_key_netstres;
|
||||||
local = (char *(*)()) key_net_get_2_svc_prog;
|
local = (char *(*)()) key_net_get_2_svc_prog;
|
||||||
check_auth = 1;
|
check_auth = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KEY_GET_CONV:
|
case KEY_GET_CONV:
|
||||||
xdr_argument = (xdrproc_t) xdr_keybuf;
|
xdr_argument = (xdrproc_t) xdr_keybuf;
|
||||||
xdr_result = xdr_cryptkeyres;
|
xdr_result = (xdrproc_t)xdr_cryptkeyres;
|
||||||
local = (char *(*)()) key_get_conv_2_svc_prog;
|
local = (char *(*)()) key_get_conv_2_svc_prog;
|
||||||
check_auth = 1;
|
check_auth = 1;
|
||||||
break;
|
break;
|
||||||
@ -738,18 +738,18 @@ keyprogram(rqstp, transp)
|
|||||||
uid = ((struct authsys_parms *)rqstp->rq_clntcred)->aup_uid;
|
uid = ((struct authsys_parms *)rqstp->rq_clntcred)->aup_uid;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset((char *) &argument, 0, sizeof (argument));
|
memset(&argument, 0, sizeof (argument));
|
||||||
if (!svc_getargs(transp, xdr_argument, (caddr_t)&argument)) {
|
if (!svc_getargs(transp, xdr_argument, &argument)) {
|
||||||
svcerr_decode(transp);
|
svcerr_decode(transp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result = (*local) (uid, &argument);
|
result = (*local) (uid, &argument);
|
||||||
if (!svc_sendreply(transp, xdr_result, (char *) result)) {
|
if (!svc_sendreply(transp, xdr_result, result)) {
|
||||||
if (debugging)
|
if (debugging)
|
||||||
(void) fprintf(stderr, "unable to reply\n");
|
(void) fprintf(stderr, "unable to reply\n");
|
||||||
svcerr_systemerr(transp);
|
svcerr_systemerr(transp);
|
||||||
}
|
}
|
||||||
if (!svc_freeargs(transp, xdr_argument, (caddr_t)&argument)) {
|
if (!svc_freeargs(transp, xdr_argument, &argument)) {
|
||||||
if (debugging)
|
if (debugging)
|
||||||
(void) fprintf(stderr,
|
(void) fprintf(stderr,
|
||||||
"unable to free arguments\n");
|
"unable to free arguments\n");
|
||||||
|
@ -103,7 +103,7 @@ ypxfrd_getmap_1_svc(ypxfr_mapname *argp, struct svc_req *rqstp)
|
|||||||
|
|
||||||
snprintf (buf, sizeof(buf), "%s/%s/%s", yp_dir, argp->xfrdomain,
|
snprintf (buf, sizeof(buf), "%s/%s/%s", yp_dir, argp->xfrdomain,
|
||||||
argp->xfrmap);
|
argp->xfrmap);
|
||||||
if (access((char *)&buf, R_OK) == -1) {
|
if (access(buf, R_OK) == -1) {
|
||||||
result.xfr_u.xfrstat = XFR_ACCESS;
|
result.xfr_u.xfrstat = XFR_ACCESS;
|
||||||
return(&result);
|
return(&result);
|
||||||
}
|
}
|
||||||
@ -132,14 +132,14 @@ ypxfrd_getmap_1_svc(ypxfr_mapname *argp, struct svc_req *rqstp)
|
|||||||
forked++;
|
forked++;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if ((fp = open((char *)&buf, O_RDONLY)) == -1) {
|
if ((fp = open(buf, O_RDONLY)) == -1) {
|
||||||
result.xfr_u.xfrstat = XFR_READ_ERR;
|
result.xfr_u.xfrstat = XFR_READ_ERR;
|
||||||
return(&result);
|
return(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Start sending the file. */
|
/* Start sending the file. */
|
||||||
|
|
||||||
svc_sendreply(rqstp->rq_xprt, xdr_my_xfr, (char *)&result);
|
svc_sendreply(rqstp->rq_xprt, (xdrproc_t)xdr_my_xfr, &result);
|
||||||
|
|
||||||
close(fp);
|
close(fp);
|
||||||
|
|
||||||
|
@ -133,11 +133,12 @@ main(int argc, char *argv[])
|
|||||||
* The following (undocumented) hack resets the internal state
|
* The following (undocumented) hack resets the internal state
|
||||||
* of the client handle.
|
* of the client handle.
|
||||||
*/
|
*/
|
||||||
clnt_control(cl, CLSET_TIMEOUT, (caddr_t)&NO_DEFAULT);
|
clnt_control(cl, CLSET_TIMEOUT, &NO_DEFAULT);
|
||||||
|
|
||||||
|
|
||||||
/* Clear server statistics */
|
/* Clear server statistics */
|
||||||
if (clnt_call(cl, SPRAYPROC_CLEAR, xdr_void, NULL, xdr_void, NULL, TIMEOUT) != RPC_SUCCESS)
|
if (clnt_call(cl, SPRAYPROC_CLEAR, (xdrproc_t)xdr_void, NULL,
|
||||||
|
(xdrproc_t)xdr_void, NULL, TIMEOUT) != RPC_SUCCESS)
|
||||||
errx(1, "%s", clnt_sperror(cl, NULL));
|
errx(1, "%s", clnt_sperror(cl, NULL));
|
||||||
|
|
||||||
|
|
||||||
@ -147,7 +148,8 @@ main(int argc, char *argv[])
|
|||||||
fflush (stdout);
|
fflush (stdout);
|
||||||
|
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
clnt_call(cl, SPRAYPROC_SPRAY, xdr_sprayarr, &host_array, xdr_void, NULL, ONE_WAY);
|
clnt_call(cl, SPRAYPROC_SPRAY, (xdrproc_t)xdr_sprayarr,
|
||||||
|
&host_array, (xdrproc_t)xdr_void, NULL, ONE_WAY);
|
||||||
|
|
||||||
if (delay) {
|
if (delay) {
|
||||||
usleep(delay);
|
usleep(delay);
|
||||||
@ -156,7 +158,8 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
|
|
||||||
/* Collect statistics from server */
|
/* Collect statistics from server */
|
||||||
if (clnt_call(cl, SPRAYPROC_GET, xdr_void, NULL, xdr_spraycumul, &host_stats, TIMEOUT) != RPC_SUCCESS)
|
if (clnt_call(cl, SPRAYPROC_GET, (xdrproc_t)xdr_void, NULL,
|
||||||
|
(xdrproc_t)xdr_spraycumul, &host_stats, TIMEOUT) != RPC_SUCCESS)
|
||||||
errx(1, "%s", clnt_sperror(cl, NULL));
|
errx(1, "%s", clnt_sperror(cl, NULL));
|
||||||
|
|
||||||
xmit_time = host_stats.clock.sec +
|
xmit_time = host_stats.clock.sec +
|
||||||
|
@ -332,9 +332,9 @@ main(int argc, char *argv[])
|
|||||||
char in = 0;
|
char in = 0;
|
||||||
char *out = NULL;
|
char *out = NULL;
|
||||||
int stat;
|
int stat;
|
||||||
if ((stat = callrpc("localhost",YPPROG,YPVERS,YPPROC_CLEAR,
|
if ((stat = callrpc("localhost", YPPROG,YPVERS, YPPROC_CLEAR,
|
||||||
xdr_void, (void *)&in,
|
(xdrproc_t)xdr_void, &in,
|
||||||
xdr_void, (void *)out)) != RPC_SUCCESS) {
|
(xdrproc_t)xdr_void, out)) != RPC_SUCCESS) {
|
||||||
warnx("failed to send 'clear' to local ypserv: %s",
|
warnx("failed to send 'clear' to local ypserv: %s",
|
||||||
clnt_sperrno((enum clnt_stat) stat));
|
clnt_sperrno((enum clnt_stat) stat));
|
||||||
}
|
}
|
||||||
|
@ -147,8 +147,10 @@ __pmap_getport(struct sockaddr_in *address, u_long program, u_long version,
|
|||||||
parms.pm_vers = version;
|
parms.pm_vers = version;
|
||||||
parms.pm_prot = protocol;
|
parms.pm_prot = protocol;
|
||||||
parms.pm_port = 0; /* not needed or used */
|
parms.pm_port = 0; /* not needed or used */
|
||||||
if (CLNT_CALL(client, PMAPPROC_GETPORT, xdr_pmap, &parms,
|
if (CLNT_CALL(client, PMAPPROC_GETPORT,
|
||||||
xdr_u_short, &port, tottimeout) != RPC_SUCCESS){
|
(xdrproc_t)xdr_pmap, &parms,
|
||||||
|
(xdrproc_t)xdr_u_short, &port,
|
||||||
|
tottimeout) != RPC_SUCCESS){
|
||||||
rpc_createerr.cf_stat = RPC_PMAPFAILURE;
|
rpc_createerr.cf_stat = RPC_PMAPFAILURE;
|
||||||
clnt_geterr(client, &rpc_createerr.cf_error);
|
clnt_geterr(client, &rpc_createerr.cf_error);
|
||||||
} else if (port == 0) {
|
} else if (port == 0) {
|
||||||
|
@ -160,8 +160,8 @@ ypbindproc_null_2_yp(SVCXPRT *transp, void *argp, CLIENT *clnt)
|
|||||||
{
|
{
|
||||||
static char res;
|
static char res;
|
||||||
|
|
||||||
bzero((char *)&res, sizeof(res));
|
bzero(&res, sizeof(res));
|
||||||
return (void *)&res;
|
return &res;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ypbind_resp *
|
struct ypbind_resp *
|
||||||
@ -171,7 +171,7 @@ ypbindproc_domain_2_yp(SVCXPRT *transp, domainname *argp, CLIENT *clnt)
|
|||||||
struct _dom_binding *ypdb;
|
struct _dom_binding *ypdb;
|
||||||
char path[MAXPATHLEN];
|
char path[MAXPATHLEN];
|
||||||
|
|
||||||
bzero((char *)&res, sizeof res);
|
bzero(&res, sizeof res);
|
||||||
res.ypbind_status = YPBIND_FAIL_VAL;
|
res.ypbind_status = YPBIND_FAIL_VAL;
|
||||||
res.ypbind_resp_u.ypbind_error = YPBIND_ERR_NOSERV;
|
res.ypbind_resp_u.ypbind_error = YPBIND_ERR_NOSERV;
|
||||||
|
|
||||||
@ -204,7 +204,7 @@ rejecting.", *argp);
|
|||||||
res.ypbind_resp_u.ypbind_error = YPBIND_ERR_RESC;
|
res.ypbind_resp_u.ypbind_error = YPBIND_ERR_RESC;
|
||||||
return (&res);
|
return (&res);
|
||||||
}
|
}
|
||||||
bzero((char *)ypdb, sizeof *ypdb);
|
bzero(ypdb, sizeof *ypdb);
|
||||||
strncpy(ypdb->dom_domain, *argp, sizeof ypdb->dom_domain);
|
strncpy(ypdb->dom_domain, *argp, sizeof ypdb->dom_domain);
|
||||||
ypdb->dom_vers = YPVERS;
|
ypdb->dom_vers = YPVERS;
|
||||||
ypdb->dom_alive = 0;
|
ypdb->dom_alive = 0;
|
||||||
@ -272,7 +272,7 @@ rejecting.", argp->ypsetdom_domain);
|
|||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
bzero((char *)&bindsin, sizeof bindsin);
|
bzero(&bindsin, sizeof bindsin);
|
||||||
bindsin.sin_family = AF_INET;
|
bindsin.sin_family = AF_INET;
|
||||||
bindsin.sin_addr.s_addr = *(u_int32_t *)argp->ypsetdom_binding.ypbind_binding_addr;
|
bindsin.sin_addr.s_addr = *(u_int32_t *)argp->ypsetdom_binding.ypbind_binding_addr;
|
||||||
bindsin.sin_port = *(u_short *)argp->ypsetdom_binding.ypbind_binding_port;
|
bindsin.sin_port = *(u_short *)argp->ypsetdom_binding.ypbind_binding_port;
|
||||||
@ -281,7 +281,7 @@ rejecting.", argp->ypsetdom_domain);
|
|||||||
return((void *) &result);
|
return((void *) &result);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
void
|
||||||
ypbindprog_2(struct svc_req *rqstp, register SVCXPRT *transp)
|
ypbindprog_2(struct svc_req *rqstp, register SVCXPRT *transp)
|
||||||
{
|
{
|
||||||
union {
|
union {
|
||||||
@ -329,13 +329,14 @@ ypbindprog_2(struct svc_req *rqstp, register SVCXPRT *transp)
|
|||||||
svcerr_noproc(transp);
|
svcerr_noproc(transp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
bzero((char *)&argument, sizeof(argument));
|
bzero(&argument, sizeof(argument));
|
||||||
if (!svc_getargs(transp, xdr_argument, (caddr_t)&argument)) {
|
if (!svc_getargs(transp, (xdrproc_t)xdr_argument, &argument)) {
|
||||||
svcerr_decode(transp);
|
svcerr_decode(transp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result = (*local)(transp, &argument, rqstp);
|
result = (*local)(transp, &argument, rqstp);
|
||||||
if (result != NULL && !svc_sendreply(transp, xdr_result, result)) {
|
if (result != NULL &&
|
||||||
|
!svc_sendreply(transp, (xdrproc_t)xdr_result, result)) {
|
||||||
svcerr_systemerr(transp);
|
svcerr_systemerr(transp);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -449,7 +450,7 @@ main(int argc, char *argv[])
|
|||||||
ypbindlist = (struct _dom_binding *)malloc(sizeof *ypbindlist);
|
ypbindlist = (struct _dom_binding *)malloc(sizeof *ypbindlist);
|
||||||
if (ypbindlist == NULL)
|
if (ypbindlist == NULL)
|
||||||
errx(1, "malloc");
|
errx(1, "malloc");
|
||||||
bzero((char *)ypbindlist, sizeof *ypbindlist);
|
bzero(ypbindlist, sizeof *ypbindlist);
|
||||||
strncpy(ypbindlist->dom_domain, domain_name, sizeof ypbindlist->dom_domain);
|
strncpy(ypbindlist->dom_domain, domain_name, sizeof ypbindlist->dom_domain);
|
||||||
ypbindlist->dom_vers = YPVERS;
|
ypbindlist->dom_vers = YPVERS;
|
||||||
ypbindlist->dom_alive = 0;
|
ypbindlist->dom_alive = 0;
|
||||||
@ -540,7 +541,7 @@ handle_children(struct _dom_binding *ypdb)
|
|||||||
FD_CLR(READFD, &svc_fdset);
|
FD_CLR(READFD, &svc_fdset);
|
||||||
READFD = WRITEFD = -1;
|
READFD = WRITEFD = -1;
|
||||||
if (d > 0 && a > 0)
|
if (d > 0 && a > 0)
|
||||||
rpc_received((char *)&buf, &addr, 0);
|
rpc_received(buf, &addr, 0);
|
||||||
else {
|
else {
|
||||||
for (y = ypbindlist; y; y = y->dom_pnext) {
|
for (y = ypbindlist; y; y = y->dom_pnext) {
|
||||||
if (y == ypdb)
|
if (y == ypdb)
|
||||||
@ -615,7 +616,7 @@ bool_t *out;
|
|||||||
struct sockaddr_in *addr;
|
struct sockaddr_in *addr;
|
||||||
{
|
{
|
||||||
if (retries >= MAX_RETRIES) {
|
if (retries >= MAX_RETRIES) {
|
||||||
bzero((char *)addr, sizeof(struct sockaddr_in));
|
bzero(addr, sizeof(struct sockaddr_in));
|
||||||
if (tell_parent(broad_domain->dom_domain, addr))
|
if (tell_parent(broad_domain->dom_domain, addr))
|
||||||
syslog(LOG_WARNING, "lost connection to parent");
|
syslog(LOG_WARNING, "lost connection to parent");
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
@ -704,15 +705,15 @@ broadcast(struct _dom_binding *ypdb)
|
|||||||
i = __yp_ping(restricted_addrs, yp_restricted,
|
i = __yp_ping(restricted_addrs, yp_restricted,
|
||||||
ypdb->dom_domain, &port);
|
ypdb->dom_domain, &port);
|
||||||
if (i == -1) {
|
if (i == -1) {
|
||||||
bzero((char *)&ypdb->dom_server_addr,
|
bzero(&ypdb->dom_server_addr,
|
||||||
sizeof(struct sockaddr_in));
|
sizeof(struct sockaddr_in));
|
||||||
if (tell_parent(ypdb->dom_domain,
|
if (tell_parent(ypdb->dom_domain,
|
||||||
&ypdb->dom_server_addr))
|
&ypdb->dom_server_addr))
|
||||||
syslog(LOG_WARNING, "lost connection to parent");
|
syslog(LOG_WARNING, "lost connection to parent");
|
||||||
} else {
|
} else {
|
||||||
bzero((char *)&sin, sizeof(struct sockaddr_in));
|
bzero(&sin, sizeof(struct sockaddr_in));
|
||||||
bcopy((char *)&restricted_addrs[i],
|
bcopy(&restricted_addrs[i],
|
||||||
(char *)&sin.sin_addr, sizeof(struct in_addr));
|
&sin.sin_addr, sizeof(struct in_addr));
|
||||||
sin.sin_family = AF_INET;
|
sin.sin_family = AF_INET;
|
||||||
sin.sin_port = port;
|
sin.sin_port = port;
|
||||||
if (tell_parent(broad_domain->dom_domain, &sin))
|
if (tell_parent(broad_domain->dom_domain, &sin))
|
||||||
@ -727,15 +728,16 @@ broadcast(struct _dom_binding *ypdb)
|
|||||||
{
|
{
|
||||||
char *ptr;
|
char *ptr;
|
||||||
|
|
||||||
ptr = (char *)&ypdb->dom_domain;
|
ptr = ypdb->dom_domain;
|
||||||
stat = clnt_broadcast(YPPROG, YPVERS, YPPROC_DOMAIN_NONACK,
|
stat = clnt_broadcast(YPPROG, YPVERS, YPPROC_DOMAIN_NONACK,
|
||||||
xdr_domainname, (char *)&ptr, xdr_bool, (char *)&out,
|
(xdrproc_t)xdr_domainname, &ptr,
|
||||||
|
(xdrproc_t)xdr_bool, &out,
|
||||||
(resultproc_t)broadcast_result);
|
(resultproc_t)broadcast_result);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stat != RPC_SUCCESS) {
|
if (stat != RPC_SUCCESS) {
|
||||||
bzero((char *)&ypdb->dom_server_addr,
|
bzero(&ypdb->dom_server_addr,
|
||||||
sizeof(struct sockaddr_in));
|
sizeof(struct sockaddr_in));
|
||||||
if (tell_parent(ypdb->dom_domain, &ypdb->dom_server_addr))
|
if (tell_parent(ypdb->dom_domain, &ypdb->dom_server_addr))
|
||||||
syslog(LOG_WARNING, "lost connection to parent");
|
syslog(LOG_WARNING, "lost connection to parent");
|
||||||
}
|
}
|
||||||
@ -785,11 +787,12 @@ ping(struct _dom_binding *ypdb)
|
|||||||
{
|
{
|
||||||
char *ptr;
|
char *ptr;
|
||||||
|
|
||||||
ptr = (char *)&ypdb->dom_domain;
|
ptr = ypdb->dom_domain;
|
||||||
|
|
||||||
if ((stat = clnt_call(client_handle, YPPROC_DOMAIN,
|
stat = clnt_call(client_handle, YPPROC_DOMAIN,
|
||||||
xdr_domainname, (char *)&ptr, xdr_bool, (char *)&out,
|
(xdrproc_t)xdr_domainname, &ptr,
|
||||||
timeout)) != RPC_SUCCESS || out == FALSE) {
|
(xdrproc_t)xdr_bool, &out, timeout);
|
||||||
|
if (stat != RPC_SUCCESS || out == FALSE) {
|
||||||
ypdb->dom_alive = 0;
|
ypdb->dom_alive = 0;
|
||||||
ypdb->dom_vers = -1;
|
ypdb->dom_vers = -1;
|
||||||
clnt_destroy(client_handle);
|
clnt_destroy(client_handle);
|
||||||
@ -877,7 +880,7 @@ rpc_received(char *dom, struct sockaddr_in *raddrp, int force)
|
|||||||
syslog(LOG_WARNING, "malloc: %m");
|
syslog(LOG_WARNING, "malloc: %m");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
bzero((char *)ypdb, sizeof *ypdb);
|
bzero(ypdb, sizeof *ypdb);
|
||||||
strncpy(ypdb->dom_domain, dom, sizeof ypdb->dom_domain);
|
strncpy(ypdb->dom_domain, dom, sizeof ypdb->dom_domain);
|
||||||
ypdb->dom_lockfd = -1;
|
ypdb->dom_lockfd = -1;
|
||||||
ypdb->dom_default = 0;
|
ypdb->dom_default = 0;
|
||||||
@ -890,7 +893,7 @@ rpc_received(char *dom, struct sockaddr_in *raddrp, int force)
|
|||||||
syslog(LOG_WARNING, "NIS server [%s] for domain \"%s\" OK",
|
syslog(LOG_WARNING, "NIS server [%s] for domain \"%s\" OK",
|
||||||
inet_ntoa(raddrp->sin_addr), ypdb->dom_domain);
|
inet_ntoa(raddrp->sin_addr), ypdb->dom_domain);
|
||||||
|
|
||||||
bcopy((char *)raddrp, (char *)&ypdb->dom_server_addr,
|
bcopy(raddrp, &ypdb->dom_server_addr,
|
||||||
sizeof ypdb->dom_server_addr);
|
sizeof ypdb->dom_server_addr);
|
||||||
|
|
||||||
ypdb->dom_vers = YPVERS;
|
ypdb->dom_vers = YPVERS;
|
||||||
@ -923,9 +926,9 @@ rpc_received(char *dom, struct sockaddr_in *raddrp, int force)
|
|||||||
*/
|
*/
|
||||||
ypdb->dom_lockfd = fd;
|
ypdb->dom_lockfd = fd;
|
||||||
|
|
||||||
iov[0].iov_base = (caddr_t)&(udptransp->xp_port);
|
iov[0].iov_base = (char *)&(udptransp->xp_port);
|
||||||
iov[0].iov_len = sizeof udptransp->xp_port;
|
iov[0].iov_len = sizeof udptransp->xp_port;
|
||||||
iov[1].iov_base = (caddr_t)&ybr;
|
iov[1].iov_base = (char *)&ybr;
|
||||||
iov[1].iov_len = sizeof ybr;
|
iov[1].iov_len = sizeof ybr;
|
||||||
|
|
||||||
bzero(&ybr, sizeof ybr);
|
bzero(&ybr, sizeof ybr);
|
||||||
@ -951,8 +954,7 @@ verify(struct in_addr addr)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < RESTRICTED_SERVERS; i++)
|
for (i = 0; i < RESTRICTED_SERVERS; i++)
|
||||||
if (!bcmp((char *)&addr, (char *)&restricted_addrs[i],
|
if (!bcmp(&addr, &restricted_addrs[i], sizeof(struct in_addr)))
|
||||||
sizeof(struct in_addr)))
|
|
||||||
return(0);
|
return(0);
|
||||||
|
|
||||||
return(1);
|
return(1);
|
||||||
@ -978,9 +980,9 @@ yp_restricted_mode(char *args)
|
|||||||
while ((s = strsep(&args, ",")) != NULL && i < RESTRICTED_SERVERS) {
|
while ((s = strsep(&args, ",")) != NULL && i < RESTRICTED_SERVERS) {
|
||||||
if ((h = gethostbyname(s)) == NULL)
|
if ((h = gethostbyname(s)) == NULL)
|
||||||
return;
|
return;
|
||||||
bcopy ((char *)h->h_addr_list[0], (char *)&restricted_addrs[i],
|
bcopy (h->h_addr_list[0], &restricted_addrs[i],
|
||||||
sizeof(struct in_addr));
|
sizeof(struct in_addr));
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ypset and ypsetme not allowed with restricted mode */
|
/* ypset and ypsetme not allowed with restricted mode */
|
||||||
|
@ -508,7 +508,7 @@ yppush_foreach(int status, char *key, int keylen, char *val, int vallen,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Cleared for takeoff: set everything in motion. */
|
/* Cleared for takeoff: set everything in motion. */
|
||||||
if (yp_push(&server, yppush_mapname, yppush_transid))
|
if (yp_push(server, yppush_mapname, yppush_transid))
|
||||||
return(yp_errno);
|
return(yp_errno);
|
||||||
|
|
||||||
/* Bump the job counter and transaction ID. */
|
/* Bump the job counter and transaction ID. */
|
||||||
|
@ -318,7 +318,7 @@ yp_cache_db(DB *dbp, char *name, int size)
|
|||||||
* the same database comes in later.
|
* the same database comes in later.
|
||||||
*/
|
*/
|
||||||
static DB *
|
static DB *
|
||||||
yp_find_db(char *name, char *key, int size)
|
yp_find_db(const char *name, const char *key, int size)
|
||||||
{
|
{
|
||||||
register struct circleq_entry *qptr;
|
register struct circleq_entry *qptr;
|
||||||
|
|
||||||
@ -364,11 +364,11 @@ yp_open_db_cache(const char *domain, const char *map, const char *key,
|
|||||||
strcat(buf, "/");
|
strcat(buf, "/");
|
||||||
strcat(buf, map);
|
strcat(buf, map);
|
||||||
|
|
||||||
if ((dbp = yp_find_db((char *)&buf, key, size)) != NULL) {
|
if ((dbp = yp_find_db(buf, key, size)) != NULL) {
|
||||||
return(dbp);
|
return(dbp);
|
||||||
} else {
|
} else {
|
||||||
if ((dbp = yp_open_db(domain, map)) != NULL) {
|
if ((dbp = yp_open_db(domain, map)) != NULL) {
|
||||||
if (yp_cache_db(dbp, (char *)&buf, size)) {
|
if (yp_cache_db(dbp, buf, size)) {
|
||||||
(void)(dbp->close)(dbp);
|
(void)(dbp->close)(dbp);
|
||||||
yp_errno = YP_YPERR;
|
yp_errno = YP_YPERR;
|
||||||
return(NULL);
|
return(NULL);
|
||||||
@ -506,8 +506,8 @@ yp_get_record(const char *domain, const char *map,
|
|||||||
TAILQ_FIRST(&qhead)->dbptr->size = 0;
|
TAILQ_FIRST(&qhead)->dbptr->size = 0;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
bcopy((char *)data->data, (char *)&buf, data->size);
|
bcopy(data->data, &buf, data->size);
|
||||||
data->data = (void *)&buf;
|
data->data = &buf;
|
||||||
(void)(dbp->close)(dbp);
|
(void)(dbp->close)(dbp);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -558,8 +558,8 @@ yp_first_record(const DB *dbp, DBT *key, DBT *data, int allow)
|
|||||||
TAILQ_FIRST(&qhead)->dbptr->size = key->size;
|
TAILQ_FIRST(&qhead)->dbptr->size = key->size;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
bcopy((char *)data->data, (char *)&buf, data->size);
|
bcopy(data->data, &buf, data->size);
|
||||||
data->data = (void *)&buf;
|
data->data = &buf;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return(YP_TRUE);
|
return(YP_TRUE);
|
||||||
@ -599,7 +599,7 @@ yp_next_record(const DB *dbp, DBT *key, DBT *data, int all, int allow)
|
|||||||
#endif
|
#endif
|
||||||
(dbp->seq)(dbp,&lkey,&ldata,R_FIRST);
|
(dbp->seq)(dbp,&lkey,&ldata,R_FIRST);
|
||||||
while (key->size != lkey.size ||
|
while (key->size != lkey.size ||
|
||||||
strncmp((char *)key->data, lkey.data,
|
strncmp(key->data, lkey.data,
|
||||||
(int)key->size))
|
(int)key->size))
|
||||||
if ((dbp->seq)(dbp,&lkey,&ldata,R_NEXT)) {
|
if ((dbp->seq)(dbp,&lkey,&ldata,R_NEXT)) {
|
||||||
#ifdef DB_CACHE
|
#ifdef DB_CACHE
|
||||||
@ -639,11 +639,11 @@ yp_next_record(const DB *dbp, DBT *key, DBT *data, int all, int allow)
|
|||||||
TAILQ_FIRST(&qhead)->dbptr->size = key->size;
|
TAILQ_FIRST(&qhead)->dbptr->size = key->size;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
bcopy((char *)key->data, (char *)&keybuf, key->size);
|
bcopy(key->data, &keybuf, key->size);
|
||||||
lkey.data = (void *)&keybuf;
|
lkey.data = &keybuf;
|
||||||
lkey.size = key->size;
|
lkey.size = key->size;
|
||||||
bcopy((char *)data->data, (char *)&datbuf, data->size);
|
bcopy(data->data, &datbuf, data->size);
|
||||||
data->data = (void *)&datbuf;
|
data->data = &datbuf;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return(YP_TRUE);
|
return(YP_TRUE);
|
||||||
|
@ -285,7 +285,7 @@ ypxfr_callback(ypxfrstat rval, struct sockaddr_in *addr, unsigned int transid,
|
|||||||
|
|
||||||
/* Turn the timeout off -- we don't want to block. */
|
/* Turn the timeout off -- we don't want to block. */
|
||||||
timeout.tv_sec = 0;
|
timeout.tv_sec = 0;
|
||||||
if (clnt_control(clnt, CLSET_TIMEOUT, (char *)&timeout) == FALSE)
|
if (clnt_control(clnt, CLSET_TIMEOUT, &timeout) == FALSE)
|
||||||
yp_error("failed to set timeout on ypproc_xfr callback");
|
yp_error("failed to set timeout on ypproc_xfr callback");
|
||||||
|
|
||||||
if (yppushproc_xfrresp_1(&ypxfr_resp, clnt) == NULL) {
|
if (yppushproc_xfrresp_1(&ypxfr_resp, clnt) == NULL) {
|
||||||
@ -303,7 +303,7 @@ ypxfr_callback(ypxfrstat rval, struct sockaddr_in *addr, unsigned int transid,
|
|||||||
#define YPXFR_RETURN(CODE) \
|
#define YPXFR_RETURN(CODE) \
|
||||||
/* Order is important: send regular RPC reply, then callback */ \
|
/* Order is important: send regular RPC reply, then callback */ \
|
||||||
result.xfrstat = CODE; \
|
result.xfrstat = CODE; \
|
||||||
svc_sendreply(rqstp->rq_xprt, xdr_ypresp_xfr, (char *)&result); \
|
svc_sendreply(rqstp->rq_xprt, (xdrproc_t)xdr_ypresp_xfr, &result); \
|
||||||
ypxfr_callback(CODE,rqhost,argp->transid, \
|
ypxfr_callback(CODE,rqhost,argp->transid, \
|
||||||
argp->prog,argp->port); \
|
argp->prog,argp->port); \
|
||||||
return(NULL);
|
return(NULL);
|
||||||
@ -378,7 +378,7 @@ ypproc_xfr_2_svc(ypreq_xfr *argp, struct svc_req *rqstp)
|
|||||||
"-p", yp_dir, "-C", t,
|
"-p", yp_dir, "-C", t,
|
||||||
g, inet_ntoa(rqhost->sin_addr),
|
g, inet_ntoa(rqhost->sin_addr),
|
||||||
p, argp->map_parms.map,
|
p, argp->map_parms.map,
|
||||||
(char *)NULL);
|
NULL);
|
||||||
} else {
|
} else {
|
||||||
execl(ypxfr_command, "ypxfr",
|
execl(ypxfr_command, "ypxfr",
|
||||||
"-d", argp->map_parms.domain,
|
"-d", argp->map_parms.domain,
|
||||||
@ -386,7 +386,7 @@ ypproc_xfr_2_svc(ypreq_xfr *argp, struct svc_req *rqstp)
|
|||||||
"-C", t,
|
"-C", t,
|
||||||
g, inet_ntoa(rqhost->sin_addr),
|
g, inet_ntoa(rqhost->sin_addr),
|
||||||
p, argp->map_parms.map,
|
p, argp->map_parms.map,
|
||||||
(char *)NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
yp_error("ypxfr execl(%s): %s", ypxfr_command, strerror(errno));
|
yp_error("ypxfr execl(%s): %s", ypxfr_command, strerror(errno));
|
||||||
YPXFR_RETURN(YPXFR_XFRERR)
|
YPXFR_RETURN(YPXFR_XFRERR)
|
||||||
@ -550,7 +550,7 @@ ypproc_all_2_svc(ypreq_nokey *argp, struct svc_req *rqstp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Kick off the actual data transfer. */
|
/* Kick off the actual data transfer. */
|
||||||
svc_sendreply(rqstp->rq_xprt, xdr_my_ypresp_all, (char *)&result);
|
svc_sendreply(rqstp->rq_xprt, (xdrproc_t)xdr_my_ypresp_all, &result);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Proper fix for PR #10970: exit here so that we don't risk
|
* Proper fix for PR #10970: exit here so that we don't risk
|
||||||
@ -598,10 +598,9 @@ ypproc_master_2_svc(ypreq_nokey *argp, struct svc_req *rqstp)
|
|||||||
*/
|
*/
|
||||||
result.stat = yp_getbykey(&key, &val);
|
result.stat = yp_getbykey(&key, &val);
|
||||||
if (result.stat == YP_TRUE) {
|
if (result.stat == YP_TRUE) {
|
||||||
bcopy((char *)val.valdat_val, (char *)&ypvalbuf,
|
bcopy(val.valdat_val, &ypvalbuf, val.valdat_len);
|
||||||
val.valdat_len);
|
|
||||||
ypvalbuf[val.valdat_len] = '\0';
|
ypvalbuf[val.valdat_len] = '\0';
|
||||||
result.peer = (char *)&ypvalbuf;
|
result.peer = ypvalbuf;
|
||||||
} else
|
} else
|
||||||
result.peer = "";
|
result.peer = "";
|
||||||
|
|
||||||
@ -646,7 +645,7 @@ ypproc_order_2_svc(ypreq_nokey *argp, struct svc_req *rqstp)
|
|||||||
result.stat = yp_getbykey(&key, &val);
|
result.stat = yp_getbykey(&key, &val);
|
||||||
|
|
||||||
if (result.stat == YP_TRUE)
|
if (result.stat == YP_TRUE)
|
||||||
result.ordernum = atoi((char *)val.valdat_val);
|
result.ordernum = atoi(val.valdat_val);
|
||||||
else
|
else
|
||||||
result.ordernum = 0;
|
result.ordernum = 0;
|
||||||
|
|
||||||
@ -698,7 +697,7 @@ yp_maplist_create(const char *domain)
|
|||||||
yp_maplist_free(yp_maplist);
|
yp_maplist_free(yp_maplist);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
if ((cur->map = (char *)strdup(dirp->d_name)) == NULL) {
|
if ((cur->map = strdup(dirp->d_name)) == NULL) {
|
||||||
yp_error("strdup() failed: %s",strerror(errno));
|
yp_error("strdup() failed: %s",strerror(errno));
|
||||||
closedir(dird);
|
closedir(dird);
|
||||||
yp_maplist_free(yp_maplist);
|
yp_maplist_free(yp_maplist);
|
||||||
@ -818,8 +817,7 @@ ypoldproc_match_1_svc(yprequest *argp, struct svc_req *rqstp)
|
|||||||
if (v2_result == NULL)
|
if (v2_result == NULL)
|
||||||
return(NULL);
|
return(NULL);
|
||||||
|
|
||||||
bcopy((char *)v2_result,
|
bcopy(v2_result, &result.ypresponse_u.yp_resp_valtype,
|
||||||
(char *)&result.ypresponse_u.yp_resp_valtype,
|
|
||||||
sizeof(ypresp_val));
|
sizeof(ypresp_val));
|
||||||
|
|
||||||
return (&result);
|
return (&result);
|
||||||
@ -850,8 +848,7 @@ ypoldproc_first_1_svc(yprequest *argp, struct svc_req *rqstp)
|
|||||||
if (v2_result == NULL)
|
if (v2_result == NULL)
|
||||||
return(NULL);
|
return(NULL);
|
||||||
|
|
||||||
bcopy((char *)v2_result,
|
bcopy(v2_result, &result.ypresponse_u.yp_resp_key_valtype,
|
||||||
(char *)&result.ypresponse_u.yp_resp_key_valtype,
|
|
||||||
sizeof(ypresp_key_val));
|
sizeof(ypresp_key_val));
|
||||||
|
|
||||||
return (&result);
|
return (&result);
|
||||||
@ -881,8 +878,7 @@ ypoldproc_next_1_svc(yprequest *argp, struct svc_req *rqstp)
|
|||||||
if (v2_result == NULL)
|
if (v2_result == NULL)
|
||||||
return(NULL);
|
return(NULL);
|
||||||
|
|
||||||
bcopy((char *)v2_result,
|
bcopy(v2_result, &result.ypresponse_u.yp_resp_key_valtype,
|
||||||
(char *)&result.ypresponse_u.yp_resp_key_valtype,
|
|
||||||
sizeof(ypresp_key_val));
|
sizeof(ypresp_key_val));
|
||||||
|
|
||||||
return (&result);
|
return (&result);
|
||||||
|
@ -100,7 +100,8 @@ bind_tohost(struct sockaddr_in *sin, char *dom, char *server)
|
|||||||
client->cl_auth = authunix_create_default();
|
client->cl_auth = authunix_create_default();
|
||||||
|
|
||||||
r = clnt_call(client, YPBINDPROC_SETDOM,
|
r = clnt_call(client, YPBINDPROC_SETDOM,
|
||||||
xdr_ypbind_setdom, &ypsd, xdr_void, NULL, tv);
|
(xdrproc_t)xdr_ypbind_setdom, &ypsd,
|
||||||
|
(xdrproc_t)xdr_void, NULL, tv);
|
||||||
if (r) {
|
if (r) {
|
||||||
warnx("sorry, cannot ypset for domain %s on host", dom);
|
warnx("sorry, cannot ypset for domain %s on host", dom);
|
||||||
clnt_destroy(client);
|
clnt_destroy(client);
|
||||||
|
Loading…
Reference in New Issue
Block a user