Fix cc -Wall, fix rcsid warnings, add missing prototypes,
change prototypes to be the same as in the original sun tirpc code. Remove ()P macro in a file where the mayority had ()P already removed. Add them if the mayority use ()P macros. Submitted by: mbr Requested by: bde
This commit is contained in:
parent
934cac67ea
commit
09dc767ffd
@ -267,7 +267,7 @@ extern AUTH *authdes_seccreate (const char *, const u_int, const char *,
|
|||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
extern bool_t xdr_opaque_auth __P((XDR *, struct opaque_auth *));
|
extern bool_t xdr_opaque_auth (XDR *, struct opaque_auth *);
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
||||||
#define authsys_create(c,i1,i2,i3,ip) authunix_create((c),(i1),(i2),(i3),(ip))
|
#define authsys_create(c,i1,i2,i3,ip) authunix_create((c),(i1),(i2),(i3),(ip))
|
||||||
@ -298,6 +298,15 @@ extern int key_setsecret(const char *);
|
|||||||
extern int key_secretkey_is_set(void);
|
extern int key_secretkey_is_set(void);
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Publickey routines.
|
||||||
|
*/
|
||||||
|
__BEGIN_DECLS
|
||||||
|
extern int getpublickey (const char *, char *);
|
||||||
|
extern int getpublicandprivatekey (char *, char *);
|
||||||
|
extern int getsecretkey (char *, char *, char *);
|
||||||
|
__END_DECLS
|
||||||
|
|
||||||
#ifdef KERBEROS
|
#ifdef KERBEROS
|
||||||
/*
|
/*
|
||||||
* Kerberos style authentication
|
* Kerberos style authentication
|
||||||
@ -334,9 +343,9 @@ __END_DECLS
|
|||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
struct svc_req;
|
struct svc_req;
|
||||||
struct rpc_msg;
|
struct rpc_msg;
|
||||||
enum auth_stat _svcauth_null __P((struct svc_req *, struct rpc_msg *));
|
enum auth_stat _svcauth_null (struct svc_req *, struct rpc_msg *);
|
||||||
enum auth_stat _svcauth_short __P((struct svc_req *, struct rpc_msg *));
|
enum auth_stat _svcauth_short (struct svc_req *, struct rpc_msg *);
|
||||||
enum auth_stat _svcauth_unix __P((struct svc_req *, struct rpc_msg *));
|
enum auth_stat _svcauth_unix (struct svc_req *, struct rpc_msg *);
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
||||||
#define AUTH_NONE 0 /* no authentication */
|
#define AUTH_NONE 0 /* no authentication */
|
||||||
|
@ -59,6 +59,7 @@
|
|||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
extern u_int __rpc_get_a_size __P((int));
|
extern u_int __rpc_get_a_size __P((int));
|
||||||
extern int __rpc_dtbsize __P((void));
|
extern int __rpc_dtbsize __P((void));
|
||||||
|
extern int _rpc_dtablesize __P((void));
|
||||||
extern struct netconfig * __rpcgettp __P((int));
|
extern struct netconfig * __rpcgettp __P((int));
|
||||||
extern int __rpc_get_default_domain __P((char **));
|
extern int __rpc_get_default_domain __P((char **));
|
||||||
|
|
||||||
|
@ -91,6 +91,9 @@
|
|||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <arpa/nameser.h>
|
#include <arpa/nameser.h>
|
||||||
|
#include <rpc/rpc.h>
|
||||||
|
#include <rpcsvc/yp_prot.h>
|
||||||
|
#include <rpcsvc/ypclnt.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <resolv.h>
|
#include <resolv.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -245,6 +248,7 @@ static int _files_getaddrinfo __P((void *, void *, va_list));
|
|||||||
#ifdef YP
|
#ifdef YP
|
||||||
static struct addrinfo *_yphostent __P((char *, const struct addrinfo *));
|
static struct addrinfo *_yphostent __P((char *, const struct addrinfo *));
|
||||||
static int _yp_getaddrinfo __P((void *, void *, va_list));
|
static int _yp_getaddrinfo __P((void *, void *, va_list));
|
||||||
|
extern int _yp_check __P(char **));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int res_queryN __P((const char *, struct res_target *));
|
static int res_queryN __P((const char *, struct res_target *));
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#pragma ident "@(#)auth_time.c 1.4 92/11/10 SMI"
|
/* #pragma ident "@(#)auth_time.c 1.4 92/11/10 SMI" */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* auth_time.c
|
* auth_time.c
|
||||||
@ -26,9 +26,6 @@
|
|||||||
* and returned. The SIGALRM processing is modified only if
|
* and returned. The SIGALRM processing is modified only if
|
||||||
* needed to deal with TCP connections.
|
* needed to deal with TCP connections.
|
||||||
*
|
*
|
||||||
* NOTE: This code has had the crap beaten out it in order to convert
|
|
||||||
* it from TI-RPC back to TD-RPC for use on FreeBSD.
|
|
||||||
*
|
|
||||||
* $FreeBSD$
|
* $FreeBSD$
|
||||||
*/
|
*/
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
|
@ -269,13 +269,14 @@ rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp,
|
|||||||
size_t fdlistno = 0;
|
size_t fdlistno = 0;
|
||||||
struct r_rpcb_rmtcallargs barg; /* Remote arguments */
|
struct r_rpcb_rmtcallargs barg; /* Remote arguments */
|
||||||
struct r_rpcb_rmtcallres bres; /* Remote results */
|
struct r_rpcb_rmtcallres bres; /* Remote results */
|
||||||
size_t outlen, outlen_pmap;
|
size_t outlen;
|
||||||
struct netconfig *nconf;
|
struct netconfig *nconf;
|
||||||
int msec;
|
int msec;
|
||||||
int pollretval;
|
int pollretval;
|
||||||
int fds_found;
|
int fds_found;
|
||||||
|
|
||||||
#ifdef PORTMAP
|
#ifdef PORTMAP
|
||||||
|
size_t outlen_pmap = 0;
|
||||||
u_long port; /* Remote port number */
|
u_long port; /* Remote port number */
|
||||||
int pmap_flag = 0; /* UDP exists ? */
|
int pmap_flag = 0; /* UDP exists ? */
|
||||||
char *outbuf_pmap = NULL;
|
char *outbuf_pmap = NULL;
|
||||||
|
@ -311,7 +311,6 @@ clnt_dg_call(cl, proc, xargs, argsp, xresults, resultsp, utimeout)
|
|||||||
struct timeval retransmit_time;
|
struct timeval retransmit_time;
|
||||||
struct timeval startime, curtime;
|
struct timeval startime, curtime;
|
||||||
int firsttimeout = 1;
|
int firsttimeout = 1;
|
||||||
int dtbsize = __rpc_dtbsize();
|
|
||||||
struct sockaddr *sa;
|
struct sockaddr *sa;
|
||||||
sigset_t mask;
|
sigset_t mask;
|
||||||
sigset_t newmask;
|
sigset_t newmask;
|
||||||
@ -320,6 +319,7 @@ clnt_dg_call(cl, proc, xargs, argsp, xresults, resultsp, utimeout)
|
|||||||
int rpc_lock_value;
|
int rpc_lock_value;
|
||||||
u_int32_t xid;
|
u_int32_t xid;
|
||||||
|
|
||||||
|
outlen = 0;
|
||||||
sigfillset(&newmask);
|
sigfillset(&newmask);
|
||||||
thr_sigsetmask(SIG_SETMASK, &newmask, &mask);
|
thr_sigsetmask(SIG_SETMASK, &newmask, &mask);
|
||||||
mutex_lock(&clnt_fd_lock);
|
mutex_lock(&clnt_fd_lock);
|
||||||
|
@ -42,7 +42,7 @@ static const char rcsid[] = "$FreeBSD$";
|
|||||||
|
|
||||||
static int common_crypt __P(( char *, char *, register unsigned, unsigned, struct desparams * ));
|
static int common_crypt __P(( char *, char *, register unsigned, unsigned, struct desparams * ));
|
||||||
int (*__des_crypt_LOCAL)() = 0;
|
int (*__des_crypt_LOCAL)() = 0;
|
||||||
extern _des_crypt_call __P(( char *, int, struct desparams * ));
|
extern int _des_crypt_call __P((char *, int, struct desparams *));
|
||||||
/*
|
/*
|
||||||
* Copy 8 bytes
|
* Copy 8 bytes
|
||||||
*/
|
*/
|
||||||
|
@ -168,7 +168,7 @@ getpublicandprivatekey(key, ret)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int getpublickey(netname, publickey)
|
int getpublickey(netname, publickey)
|
||||||
char *netname;
|
const char *netname;
|
||||||
char *publickey;
|
char *publickey;
|
||||||
{
|
{
|
||||||
if (__getpublickey_LOCAL != NULL)
|
if (__getpublickey_LOCAL != NULL)
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
#ident "@(#)key_call.c 1.25 94/04/24 SMI"
|
#ident "@(#)key_call.c 1.25 94/04/24 SMI"
|
||||||
|
|
||||||
#ifndef lint
|
#if defined(LIBC_SCCS) && !defined(lint)
|
||||||
static char rcsid[] =
|
static char rcsid[] =
|
||||||
"$FreeBSD$";
|
"$FreeBSD$";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
@ -379,8 +379,7 @@ int vers;
|
|||||||
endnetconfig(localhandle);
|
endnetconfig(localhandle);
|
||||||
return ((CLIENT *) NULL);
|
return ((CLIENT *) NULL);
|
||||||
}
|
}
|
||||||
|
while ((nconf = getnetconfig(localhandle)) != NULL) {
|
||||||
while (nconf = getnetconfig(localhandle)) {
|
|
||||||
if (strcmp(nconf->nc_protofmly, NC_LOOPBACK) == 0) {
|
if (strcmp(nconf->nc_protofmly, NC_LOOPBACK) == 0) {
|
||||||
/*
|
/*
|
||||||
* We use COTS_ORD here so that the caller can
|
* We use COTS_ORD here so that the caller can
|
||||||
|
@ -106,6 +106,8 @@ xdr_cryptkeyres(register XDR *xdrs, cryptkeyres *objp)
|
|||||||
if (!xdr_des_block(xdrs, &objp->cryptkeyres_u.deskey))
|
if (!xdr_des_block(xdrs, &objp->cryptkeyres_u.deskey))
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
}
|
}
|
||||||
@ -135,6 +137,8 @@ xdr_getcredres(register XDR *xdrs, getcredres *objp)
|
|||||||
if (!xdr_unixcred(xdrs, &objp->getcredres_u.cred))
|
if (!xdr_unixcred(xdrs, &objp->getcredres_u.cred))
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
}
|
}
|
||||||
@ -163,6 +167,8 @@ xdr_key_netstres(register XDR *xdrs, key_netstres *objp)
|
|||||||
if (!xdr_key_netstarg(xdrs, &objp->key_netstres_u.knet))
|
if (!xdr_key_netstarg(xdrs, &objp->key_netstres_u.knet))
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,7 @@ user2netname(netname, uid, domain)
|
|||||||
char *dfltdom;
|
char *dfltdom;
|
||||||
|
|
||||||
if (domain == NULL) {
|
if (domain == NULL) {
|
||||||
if (_rpc_get_default_domain(&dfltdom) != 0) {
|
if (__rpc_get_default_domain(&dfltdom) != 0) {
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
domain = dfltdom;
|
domain = dfltdom;
|
||||||
@ -135,7 +135,7 @@ host2netname(netname, host, domain)
|
|||||||
char hostname[MAXHOSTNAMELEN+1];
|
char hostname[MAXHOSTNAMELEN+1];
|
||||||
|
|
||||||
if (domain == NULL) {
|
if (domain == NULL) {
|
||||||
if (_rpc_get_default_domain(&dfltdom) != 0) {
|
if (__rpc_get_default_domain(&dfltdom) != 0) {
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
domain = dfltdom;
|
domain = dfltdom;
|
||||||
|
@ -126,7 +126,7 @@ netname2user(netname, uidp, gidp, gidlenp, gidlist)
|
|||||||
(void) strncpy(val, val1, 1024);
|
(void) strncpy(val, val1, 1024);
|
||||||
val[vallen] = 0;
|
val[vallen] = 0;
|
||||||
|
|
||||||
err = _rpc_get_default_domain(&domain); /* change to rpc */
|
err = __rpc_get_default_domain(&domain); /* change to rpc */
|
||||||
if (err)
|
if (err)
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
@ -227,7 +227,7 @@ netname2host(netname, hostname, hostlen)
|
|||||||
(void) strncpy(hostname, val, vallen);
|
(void) strncpy(hostname, val, vallen);
|
||||||
hostname[vallen] = 0;
|
hostname[vallen] = 0;
|
||||||
|
|
||||||
err = _rpc_get_default_domain(&domain); /* change to rpc */
|
err = __rpc_get_default_domain(&domain); /* change to rpc */
|
||||||
if (err)
|
if (err)
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
|
@ -646,6 +646,8 @@ __rpc_uaddr2taddr_af(int af, const char *uaddr)
|
|||||||
#endif
|
#endif
|
||||||
struct sockaddr_un *sun;
|
struct sockaddr_un *sun;
|
||||||
|
|
||||||
|
port = 0;
|
||||||
|
sin = NULL;
|
||||||
addrstr = strdup(uaddr);
|
addrstr = strdup(uaddr);
|
||||||
if (addrstr == NULL)
|
if (addrstr == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -463,13 +463,13 @@ clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz)
|
|||||||
u_int recvsz;
|
u_int recvsz;
|
||||||
{
|
{
|
||||||
struct netbuf *svcaddr;
|
struct netbuf *svcaddr;
|
||||||
void *localhandle;
|
|
||||||
struct netconfig *nconf;
|
struct netconfig *nconf;
|
||||||
CLIENT *cl;
|
CLIENT *cl;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
nconf = NULL;
|
|
||||||
cl = NULL;
|
cl = NULL;
|
||||||
|
nconf = NULL;
|
||||||
|
svcaddr = NULL;
|
||||||
if ((raddr->sun_len == 0) ||
|
if ((raddr->sun_len == 0) ||
|
||||||
((svcaddr = malloc(sizeof(struct netbuf))) == NULL ) ||
|
((svcaddr = malloc(sizeof(struct netbuf))) == NULL ) ||
|
||||||
((svcaddr->buf = malloc(sizeof(struct sockaddr_un))) == NULL)) {
|
((svcaddr->buf = malloc(sizeof(struct sockaddr_un))) == NULL)) {
|
||||||
|
@ -116,6 +116,7 @@ xdr_rpcblist_ptr(xdrs, rp)
|
|||||||
rpcblist_ptr next;
|
rpcblist_ptr next;
|
||||||
rpcblist_ptr next_copy;
|
rpcblist_ptr next_copy;
|
||||||
|
|
||||||
|
next = NULL;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
more_elements = (bool_t)(*rp != NULL);
|
more_elements = (bool_t)(*rp != NULL);
|
||||||
if (! xdr_bool(xdrs, &more_elements)) {
|
if (! xdr_bool(xdrs, &more_elements)) {
|
||||||
@ -204,6 +205,7 @@ xdr_rpcb_entry_list_ptr(xdrs, rp)
|
|||||||
rpcb_entry_list_ptr next;
|
rpcb_entry_list_ptr next;
|
||||||
rpcb_entry_list_ptr next_copy;
|
rpcb_entry_list_ptr next_copy;
|
||||||
|
|
||||||
|
next = NULL;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
more_elements = (bool_t)(*rp != NULL);
|
more_elements = (bool_t)(*rp != NULL);
|
||||||
if (! xdr_bool(xdrs, &more_elements)) {
|
if (! xdr_bool(xdrs, &more_elements)) {
|
||||||
|
@ -71,7 +71,7 @@ get_default_domain()
|
|||||||
* get rejected elsewhere in the NIS client package.
|
* get rejected elsewhere in the NIS client package.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
_rpc_get_default_domain(domain)
|
__rpc_get_default_domain(domain)
|
||||||
char **domain;
|
char **domain;
|
||||||
{
|
{
|
||||||
if ((*domain = get_default_domain()) != 0)
|
if ((*domain = get_default_domain()) != 0)
|
||||||
|
@ -69,6 +69,8 @@
|
|||||||
static const char rcsid[] = "$FreeBSD$";
|
static const char rcsid[] = "$FreeBSD$";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern int key_decryptsession_pk(const char *, netobj *, des_block *);
|
||||||
|
|
||||||
#define debug(msg) printf("svcauth_des: %s\n", msg)
|
#define debug(msg) printf("svcauth_des: %s\n", msg)
|
||||||
|
|
||||||
#define USEC_PER_SEC ((u_long) 1000000L)
|
#define USEC_PER_SEC ((u_long) 1000000L)
|
||||||
|
@ -133,7 +133,9 @@ rpc_reg(prognum, versnum, procnum, progname, inproc, outproc, nettype)
|
|||||||
|
|
||||||
madenow = FALSE;
|
madenow = FALSE;
|
||||||
svcxprt = NULL;
|
svcxprt = NULL;
|
||||||
for (pl = proglst; pl; pl = pl->p_nxt)
|
recvsz = 0;
|
||||||
|
xdrbuf = netid = NULL;
|
||||||
|
for (pl = proglst; pl; pl = pl->p_nxt) {
|
||||||
if (strcmp(pl->p_netid, nconf->nc_netid) == 0) {
|
if (strcmp(pl->p_netid, nconf->nc_netid) == 0) {
|
||||||
svcxprt = pl->p_transp;
|
svcxprt = pl->p_transp;
|
||||||
xdrbuf = pl->p_xdrbuf;
|
xdrbuf = pl->p_xdrbuf;
|
||||||
@ -141,6 +143,7 @@ rpc_reg(prognum, versnum, procnum, progname, inproc, outproc, nettype)
|
|||||||
netid = pl->p_netid;
|
netid = pl->p_netid;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (svcxprt == NULL) {
|
if (svcxprt == NULL) {
|
||||||
struct __rpc_sockinfo si;
|
struct __rpc_sockinfo si;
|
||||||
|
@ -129,7 +129,6 @@ svc_vc_create(fd, sendsize, recvsize)
|
|||||||
struct __rpc_sockinfo si;
|
struct __rpc_sockinfo si;
|
||||||
struct sockaddr_storage sslocal;
|
struct sockaddr_storage sslocal;
|
||||||
socklen_t slen;
|
socklen_t slen;
|
||||||
int one = 1;
|
|
||||||
|
|
||||||
r = mem_alloc(sizeof(*r));
|
r = mem_alloc(sizeof(*r));
|
||||||
if (r == NULL) {
|
if (r == NULL) {
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LINT
|
#if defined(LIBC_SCCS) && !defined(lint)
|
||||||
static char *rcsid = "$FreeBSD$";
|
static char *rcsid = "$FreeBSD$";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LINT
|
#if defined(LIBC_SCCS) && !defined(lint)
|
||||||
static char *rcsid = "$FreeBSD$";
|
static char *rcsid = "$FreeBSD$";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user