summaryrefslogtreecommitdiffstats
path: root/lib/libc/xdr
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>2008-08-06 14:02:05 +0000
committerdfr <dfr@FreeBSD.org>2008-08-06 14:02:05 +0000
commitea3d7030c0c6118b636ea8909a5583b94d819e3a (patch)
treea928d209076dec713f636439ec8dc5be13863460 /lib/libc/xdr
parent627a3ab3ef939e027409fe287f7e3c401c373003 (diff)
downloadFreeBSD-src-ea3d7030c0c6118b636ea8909a5583b94d819e3a.zip
FreeBSD-src-ea3d7030c0c6118b636ea8909a5583b94d819e3a.tar.gz
Add an implementation of the RPCSEC_GSS authentication protocol for RPC. This
is based on an old implementation from the University of Michigan with lots of changes and fixes by me and the addition of a Solaris-compatible API. Sponsored by: Isilon Systems Reviewed by: alfred
Diffstat (limited to 'lib/libc/xdr')
-rw-r--r--lib/libc/xdr/xdr_rec.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/lib/libc/xdr/xdr_rec.c b/lib/libc/xdr/xdr_rec.c
index 34238ed..dc4aa18 100644
--- a/lib/libc/xdr/xdr_rec.c
+++ b/lib/libc/xdr/xdr_rec.c
@@ -338,21 +338,22 @@ xdrrec_getpos(xdrs)
off_t pos;
pos = lseek((int)(u_long)rstrm->tcp_handle, (off_t)0, 1);
- if (pos != -1)
- switch (xdrs->x_op) {
+ if (pos == -1)
+ pos = 0;
+ switch (xdrs->x_op) {
- case XDR_ENCODE:
- pos += rstrm->out_finger - rstrm->out_base;
- break;
+ case XDR_ENCODE:
+ pos += rstrm->out_finger - rstrm->out_base;
+ break;
- case XDR_DECODE:
- pos -= rstrm->in_boundry - rstrm->in_finger;
- break;
+ case XDR_DECODE:
+ pos -= rstrm->in_boundry - rstrm->in_finger;
+ break;
- default:
- pos = (off_t) -1;
- break;
- }
+ default:
+ pos = (off_t) -1;
+ break;
+ }
return ((u_int) pos);
}
OpenPOWER on IntegriCloud