From: Chuck Lever <chuck.lever@oracle.com>
To: "Andrew J. Schorr"
<ajschorr-zz2rRYioAk8nkiaMHba4zfZ8FUJU4vz8@public.gmane.org>
Cc: Steve Dickson <SteveD@redhat.com>,
linux-nfs@vger.kernel.org,
libtirpc-devel-pyega4qmqnRoyOMFzWx49A@public.gmane.org
Subject: Re: proposed patch to rpcbind to provide finer-grained security controls than offered by the -i option
Date: Fri, 10 Dec 2010 17:18:55 -0500 [thread overview]
Message-ID: <93E231AF-626B-43CF-8BC3-65B5DF007DB0@oracle.com> (raw)
In-Reply-To: <20101210215758.GA15059-RxCcQp2DQEZ/AkJ0XP51flIRPycPq0EMEZnpZpl6OOE@public.gmane.org>
On Dec 10, 2010, at 4:57 PM, Andrew J. Schorr wrote:
> Adding CC libtirpc-devel-pyega4qmqnRoyOMFzWx49A@public.gmane.org:
>
> On Fri, Dec 10, 2010 at 12:14:47PM -0500, Chuck Lever wrote:
>> The libtirpc legacy API should be the same as the glibc RPC API. If you spot any truly non-ABI compatible changes, or have any other related questions, please let us know. (we should probably cc libtirpc-devel-pyega4qmqnRoyOMFzWx49A@public.gmane.org).
>>
>
> I have not inspected closely yet, but did notice that the XDR structure
> has changed. In /usr/include/rpc/xdr.h, there is this:
>
> struct XDR
> {
> enum xdr_op x_op; /* operation; fast additional param */
> struct xdr_ops
> {
> bool_t (*x_getlong) (XDR *__xdrs, long *__lp);
> /* get a long from underlying stream */
> bool_t (*x_putlong) (XDR *__xdrs, __const long *__lp);
> /* put a long to " */
> bool_t (*x_getbytes) (XDR *__xdrs, caddr_t __addr, u_int __len);
> /* get some bytes from " */
> bool_t (*x_putbytes) (XDR *__xdrs, __const char *__addr, u_int __len);
> /* put some bytes to " */
> u_int (*x_getpostn) (__const XDR *__xdrs);
> /* returns bytes off from beginning */
> bool_t (*x_setpostn) (XDR *__xdrs, u_int __pos);
> /* lets you reposition the stream */
> int32_t *(*x_inline) (XDR *__xdrs, u_int __len);
> /* buf quick ptr to buffered data */
> void (*x_destroy) (XDR *__xdrs);
> /* free privates of this xdr_stream */
> bool_t (*x_getint32) (XDR *__xdrs, int32_t *__ip);
> /* get a int from underlying stream */
> bool_t (*x_putint32) (XDR *__xdrs, __const int32_t *__ip);
> /* put a int to " */
> }
> *x_ops;
> caddr_t x_public; /* users' data */
> caddr_t x_private; /* pointer to private data */
> caddr_t x_base; /* private used for position info */
> u_int x_handy; /* extra private word */
> };
>
> Whereas the new tirpc/rpc/xdr.h has this:
>
> typedef struct __rpc_xdr {
> enum xdr_op x_op; /* operation; fast additional param */
> const struct xdr_ops {
> /* get a long from underlying stream */
> bool_t (*x_getlong)(struct __rpc_xdr *, long *);
> /* put a long to " */
> bool_t (*x_putlong)(struct __rpc_xdr *, const long *);
> /* get some bytes from " */
> bool_t (*x_getbytes)(struct __rpc_xdr *, char *, u_int);
> /* put some bytes to " */
> bool_t (*x_putbytes)(struct __rpc_xdr *, const char *, u_int);
> /* returns bytes off from beginning */
> u_int (*x_getpostn)(struct __rpc_xdr *);
> /* lets you reposition the stream */
> bool_t (*x_setpostn)(struct __rpc_xdr *, u_int);
> /* buf quick ptr to buffered data */
> int32_t *(*x_inline)(struct __rpc_xdr *, u_int);
> /* free privates of this xdr_stream */
> void (*x_destroy)(struct __rpc_xdr *);
> bool_t (*x_control)(struct __rpc_xdr *, int, void *);
> } *x_ops;
> char * x_public; /* users' data */
> void * x_private; /* pointer to private data */
> char * x_base; /* private used for position info */
> u_int x_handy; /* extra private word */
> } XDR;
>
>
> As you can see, the structure has changed (some methods added and others
> removed). As a result, my code to implement a new XDR type no longer compiles,
> and will require porting (which presumably will not be major).
>
> So I claim that tirpc is not fully ABI compatible with the legacy RPC
> implementation.
Thanks for the report. We are aware of a handful of other minor instances, so it is true that there is not full ABI compatibility. For most RPC applications of sufficient complexity, the differences are not significant. At a guess, the use of RPCL and rpcgen to construct your XDR type might be helpful for avoiding this problem.
The XDR struct is not part of the published RPC API, is it? See Sun doc 816-1435.
--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
next prev parent reply other threads:[~2010-12-10 22:19 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-09 20:49 proposed patch to rpcbind to provide finer-grained security controls than offered by the -i option Andrew J. Schorr
2010-12-09 21:41 ` Chuck Lever
2010-12-10 0:07 ` Steve Dickson
2010-12-10 2:38 ` Andrew J. Schorr
2010-12-10 13:52 ` Steve Dickson
2010-12-10 15:31 ` Chuck Lever
2010-12-10 15:37 ` Andrew J. Schorr
2010-12-10 16:39 ` Chuck Lever
2010-12-10 15:55 ` Steve Dickson
2010-12-10 17:01 ` Chuck Lever
2010-12-10 17:07 ` Steve Dickson
[not found] ` <4D025E60.8030204-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2010-12-10 17:09 ` Chuck Lever
2010-12-10 17:10 ` Andrew J. Schorr
2010-12-10 17:14 ` Chuck Lever
2010-12-10 21:57 ` Andrew J. Schorr
[not found] ` <20101210215758.GA15059-RxCcQp2DQEZ/AkJ0XP51flIRPycPq0EMEZnpZpl6OOE@public.gmane.org>
2010-12-10 22:18 ` Chuck Lever [this message]
2010-12-10 22:22 ` Chuck Lever
2010-12-10 22:30 ` Andrew J. Schorr
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=93E231AF-626B-43CF-8BC3-65B5DF007DB0@oracle.com \
--to=chuck.lever@oracle.com \
--cc=SteveD@redhat.com \
--cc=ajschorr-zz2rRYioAk8nkiaMHba4zfZ8FUJU4vz8@public.gmane.org \
--cc=libtirpc-devel-pyega4qmqnRoyOMFzWx49A@public.gmane.org \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox