summaryrefslogtreecommitdiff
path: root/lib/librpcsvc/rnusers.x
diff options
context:
space:
mode:
authorThorsten Lockert <tholo@cvs.openbsd.org>1996-09-22 07:59:08 +0000
committerThorsten Lockert <tholo@cvs.openbsd.org>1996-09-22 07:59:08 +0000
commit9860ef65b3fc88d01c474368e4d212af6c28669f (patch)
treee0503cd82191f13502d1a52124c16b1d82f1fa45 /lib/librpcsvc/rnusers.x
parente7d20d5fb38eb2d769d5c204709a08fc419ffd93 (diff)
Make this work properly; we have to let the XDR routines allocate and free
memory for us.
Diffstat (limited to 'lib/librpcsvc/rnusers.x')
-rw-r--r--lib/librpcsvc/rnusers.x29
1 files changed, 15 insertions, 14 deletions
diff --git a/lib/librpcsvc/rnusers.x b/lib/librpcsvc/rnusers.x
index 30a6d3a3028..e985aa6fd85 100644
--- a/lib/librpcsvc/rnusers.x
+++ b/lib/librpcsvc/rnusers.x
@@ -35,7 +35,7 @@
%#ifndef lint
%/*static char sccsid[] = "from: @(#)rnusers.x 1.2 87/09/20 Copyr 1987 Sun Micro";*/
%/*static char sccsid[] = "from: @(#)rnusers.x 2.1 88/08/01 4.0 RPCSRC";*/
-%static char rcsid[] = "$Id: rnusers.x,v 1.1 1995/10/18 08:43:10 deraadt Exp $";
+%static char rcsid[] = "$Id: rnusers.x,v 1.2 1996/09/22 07:59:07 tholo Exp $";
%#endif /* not lint */
#endif
@@ -54,10 +54,15 @@
% * This is the structure used in version 2 of the rusersd RPC service.
% * It corresponds to the utmp structure for BSD sytems.
% */
+%
+%#define RUSERS_MAXUSERLEN 8
+%#define RUSERS_MAXLINELEN 8
+%#define RUSERS_MAXHOSTLEN 16
+%
%struct ru_utmp {
-% char ut_line[8]; /* tty name */
-% char ut_name[8]; /* user id */
-% char ut_host[16]; /* host name, if remote */
+% char *ut_line; /* tty name */
+% char *ut_name; /* user id */
+% char *ut_host; /* host name, if remote */
% long ut_time; /* time on */
%};
%typedef struct ru_utmp rutmp;
@@ -104,22 +109,18 @@
% XDR *xdrs;
% struct ru_utmp *objp;
%{
-% char *ptr;
% int size;
%
-% ptr = objp->ut_line;
-% size = sizeof(objp->ut_line);
-% if (!xdr_bytes(xdrs, &ptr, &size, size)) {
+% size = RUSERS_MAXLINELEN;
+% if (!xdr_bytes(xdrs, &objp->ut_line, &size, RUSERS_MAXLINELEN)) {
% return (FALSE);
% }
-% ptr = objp->ut_name;
-% size = sizeof(objp->ut_line);
-% if (!xdr_bytes(xdrs, &ptr, &size, size)) {
+% size = RUSERS_MAXUSERLEN;
+% if (!xdr_bytes(xdrs, &objp->ut_name, &size, RUSERS_MAXUSERLEN)) {
% return (FALSE);
% }
-% ptr = objp->ut_host;
-% size = sizeof(objp->ut_host);
-% if (!xdr_bytes(xdrs, &ptr, &size, size)) {
+% size = RUSERS_MAXHOSTLEN;
+% if (!xdr_bytes(xdrs, &objp->ut_host, &size, RUSERS_MAXHOSTLEN)) {
% return (FALSE);
% }
% if (!xdr_long(xdrs, &objp->ut_time)) {