summaryrefslogtreecommitdiffstats
path: root/usr.bin/rpcgen
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2001-03-19 12:50:13 +0000
committeralfred <alfred@FreeBSD.org>2001-03-19 12:50:13 +0000
commitf67e4a8fc7fc95c74bd6c09d3453200de47faea5 (patch)
tree98b613188d263fdcef5f2d020e5e8c374db1f5b6 /usr.bin/rpcgen
parent6f24d923a7fa9d1679753d77cc982ec72c22a197 (diff)
downloadFreeBSD-src-f67e4a8fc7fc95c74bd6c09d3453200de47faea5.zip
FreeBSD-src-f67e4a8fc7fc95c74bd6c09d3453200de47faea5.tar.gz
Bring in a hybrid of SunSoft's transport-independent RPC (TI-RPC) and
associated changes that had to happen to make this possible as well as bugs fixed along the way. Bring in required TLI library routines to support this. Since we don't support TLI we've essentially copied what NetBSD has done, adding a thin layer to emulate direct the TLI calls into BSD socket calls. This is mostly from Sun's tirpc release that was made in 1994, however some fixes were backported from the 1999 release (supposedly only made available after this porting effort was underway). The submitter has agreed to continue on and bring us up to the 1999 release. Several key features are introduced with this update: Client calls are thread safe. (1999 code has server side thread safe) Updated, a more modern interface. Many userland updates were done to bring the code up to par with the recent RPC API. There is an update to the pthreads library, a function pthread_main_np() was added to emulate a function of Sun's threads library. While we're at it, bring in NetBSD's lockd, it's been far too long of a wait. New rpcbind(8) replaces portmap(8) (supporting communication over an authenticated Unix-domain socket, and by default only allowing set and unset requests over that channel). It's much more secure than the old portmapper. Umount(8), mountd(8), mount_nfs(8), nfsd(8) have also been upgraded to support TI-RPC and to support IPV6. Umount(8) is also fixed to unmount pathnames longer than 80 chars, which are currently truncated by the Kernel statfs structure. Submitted by: Martin Blapp <mb@imp.ch> Manpage review: ru Secure RPC implemented by: wpaul
Diffstat (limited to 'usr.bin/rpcgen')
-rw-r--r--usr.bin/rpcgen/rpc_main.c13
-rw-r--r--usr.bin/rpcgen/rpc_parse.c10
-rw-r--r--usr.bin/rpcgen/rpc_svcout.c4
-rw-r--r--usr.bin/rpcgen/rpcgen.114
4 files changed, 18 insertions, 23 deletions
diff --git a/usr.bin/rpcgen/rpc_main.c b/usr.bin/rpcgen/rpc_main.c
index 5e2ebf7..2674b3a 100644
--- a/usr.bin/rpcgen/rpc_main.c
+++ b/usr.bin/rpcgen/rpc_main.c
@@ -152,11 +152,7 @@ int newstyle; /* newstyle of passing arguments (by value) */
int Cflag = 0; /* ANSI C syntax */
int CCflag = 0; /* C++ files */
static int allfiles; /* generate all files */
-#if defined(__FreeBSD__) || defined(__NetBSD__)
-int tirpcflag = 0; /* generating code for tirpc, by default */
-#else
int tirpcflag = 1; /* generating code for tirpc, by default */
-#endif
xdrfunc *xdrfunc_head = NULL; /* xdr function list */
xdrfunc *xdrfunc_tail = NULL; /* xdr function list */
pid_t childpid;
@@ -692,9 +688,10 @@ s_output(argc, argv, infile, define, extend, outfile, nomain, netflag)
f_print(fout, "#include <memory.h>\n");
#if defined(__FreeBSD__) || defined(__NetBSD__)
+#else
if (tirpcflag)
-#endif
f_print(fout, "#include <stropts.h>\n");
+#endif
if (inetdflag || !tirpcflag) {
f_print(fout, "#include <sys/socket.h>\n");
f_print(fout, "#include <netinet/in.h>\n");
@@ -1173,11 +1170,7 @@ parseargs(argc, argv, cmd)
* generating backward compatible
* code
*/
-#if defined(__FreeBSD__) || defined(__NetBSD__)
- tirpcflag = 1;
-#else
tirpcflag = 0;
-#endif
break;
case 'I':
@@ -1273,9 +1266,7 @@ parseargs(argc, argv, cmd)
}
} else { /* 4.1 mode */
pmflag = 0; /* set pmflag only in tirpcmode */
-#if !defined(__FreeBSD__) && !defined(__NetBSD__)
inetdflag = 1; /* inetdflag is TRUE by default */
-#endif
if (cmd->nflag) { /* netid needs TIRPC */
warnx("cannot use netid flag without TIRPC");
return (0);
diff --git a/usr.bin/rpcgen/rpc_parse.c b/usr.bin/rpcgen/rpc_parse.c
index 1d952cc..a4a44c8 100644
--- a/usr.bin/rpcgen/rpc_parse.c
+++ b/usr.bin/rpcgen/rpc_parse.c
@@ -1,3 +1,4 @@
+/* $FreeBSD$ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
@@ -593,7 +594,11 @@ get_type(prefixp, typep, dkind)
(void) peekscan(TOK_INT, &tok);
break;
case TOK_HYPER:
+#ifdef __FreeBSD__
*typep = "int64_t";
+#else
+ *typep = "longlong_t";
+#endif
(void) peekscan(TOK_INT, &tok);
break;
@@ -642,7 +647,12 @@ unsigned_dec(typep)
break;
case TOK_HYPER:
get_token(&tok);
+#ifdef __FreeBSD__
*typep = "u_int64_t";
+#else
+ *typep = "longlong_t";
+#endif
+
(void) peekscan(TOK_INT, &tok);
break;
case TOK_INT:
diff --git a/usr.bin/rpcgen/rpc_svcout.c b/usr.bin/rpcgen/rpc_svcout.c
index 62b2ab1..86ff5a2 100644
--- a/usr.bin/rpcgen/rpc_svcout.c
+++ b/usr.bin/rpcgen/rpc_svcout.c
@@ -1,4 +1,6 @@
/*
+ * $FreeBSD$
+ *
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
* media and as a part of the software program in whole or part. Users
@@ -635,7 +637,7 @@ printif(proc, transp, prefix, arg)
char *prefix;
char *arg;
{
- f_print(fout, "\tif (!svc_%s(%s, xdr_%s, %s%s)) {\n",
+ f_print(fout, "\tif (!svc_%s(%s, xdr_%s, (char *)%s%s)) {\n",
proc, transp, arg, prefix, arg);
}
diff --git a/usr.bin/rpcgen/rpcgen.1 b/usr.bin/rpcgen/rpcgen.1
index d8ecd96..c00dda4 100644
--- a/usr.bin/rpcgen/rpcgen.1
+++ b/usr.bin/rpcgen/rpcgen.1
@@ -233,7 +233,7 @@ If this routine does not exist in the
library, it must be provided.
Providing an undefined data type
allows customization of
-.Xr XDR
+.Xr xdr 3
routines.
.Sh OPTIONS
The following options are available:
@@ -246,15 +246,6 @@ Generate transport specific
.Tn RPC
code for older versions
of the operating system.
-.Pp
-Note: in
-.Fx ,
-this compatibility flag is turned on by
-default since
-.Fx
-supports only the older
-.Tn ONC RPC
-library.
.It Fl c
Compile into
.Tn XDR
@@ -510,9 +501,10 @@ use:
.Sh SEE ALSO
.Xr cc 1 ,
.Xr rpc 3 ,
+.Xr rpc_svc_calls 3 ,
.Xr syslog 3 ,
+.Xr xdr 3 ,
.Xr inetd 8
-.\" .BR rpc_svc_calls (3)
.Rs
.%T The rpcgen chapter in the NETP manual
.Re
OpenPOWER on IntegriCloud