This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [PATCH] nis/rpcsvc/yp.h: fix ypproc_first_2 declaration
- From: GOTO Masanori <gotom at debian dot or dot jp>
- To: Ulrich Drepper <drepper at redhat dot com>
- Cc: GOTO Masanori <gotom at debian dot or dot jp>, libc-alpha at sources dot redhat dot com
- Date: Tue, 25 Mar 2003 19:28:16 +0900
- Subject: Re: [PATCH] nis/rpcsvc/yp.h: fix ypproc_first_2 declaration
- References: <80adfnl6i9.wl@oris.opensource.jp><3E7F6AF5.4020003@redhat.com>
At Mon, 24 Mar 2003 12:30:45 -0800,
Ulrich Drepper wrote:
> GOTO Masanori wrote:
>
> > This bug was derived from original Sun's .x code. Solaris 8 and YP
> > server for linux 1.3.11 are already fixed. In addition I don't touch
> > to fix yp.x because /usr/include/rpcsvc/yp.x in Solaris 8 is not
> > touched...
>
> References?
For example:
linux ypserve-1.3.12:
yp.h:
#define YPPROC_FIRST ((u_long)4)
extern ypresp_key_val * ypproc_first_2(ypreq_nokey *, CLIENT *);
extern ypresp_key_val * ypproc_first_2_svc(ypreq_nokey *, struct svc_req *);
FreeBSD 4.5:
/usr/include/rpcsvc/yp.x:
#ifdef STUPID_SUN_BUG /* should be ypreq_nokey */
YPPROC_FIRST(ypreq_key) = 4;
#else
YPPROC_FIRST(ypreq_nokey) = 4;
#endif
/usr/include/rpcsvc/yp.h:
#define YPPROC_FIRST ((unsigned long)(4))
extern ypresp_key_val * ypproc_first_2(ypreq_nokey *, CLIENT *);
extern ypresp_key_val * ypproc_first_2_svc(ypreq_nokey *, struct svc_req *);
NetBSD latest cvs:
source /usr.sbin/ypserv/ypserv/ypserv_proc.c
ypproc_first_2_svc(void *argp, struct svc_req *rqstp)
{
...
struct ypreq_nokey *k = argp;
Solaris 8:
/usr/include/rpcsvc/yp_prot.h:
* YPPROC_FIRST (struct ypreq_nokey) returns (struct ypresp_key_val).
* Returns the first key-value pair from a named domain and map.
#define YPFIRST_REQTYPE YPREQ_NOKEY
#define ypfirst_req_domain yp_reqbody.yp_req_nokeytype.domain
#define ypfirst_req_map yp_reqbody.yp_req_nokeytype.map
> And in the same paragraph you say the .x file is fixed and
> not changed. I can verify the "not changed" part. Where does all this
> come from?
I didn't say like "solaris' .x file is changed". Look at Solaris 8
/usr/include/rpcsvc/yp.x:
ypresp_key_val
YPPROC_FIRST(ypreq_key) = 4;
They don't change their .x definition, but their yp_prot.h declares
ypfirst_reqtype as ypreq_nokey. I think they didn't change their .x
file, but fixed their .h file. This is another "STUPID_SUN_BUG".
BTW, glibc nis/ypclnt.c line 408 has following code:
result = do_ypcall (indomain, YPPROC_FIRST, (xdrproc_t) xdr_ypreq_nokey,
(caddr_t) & req, (xdrproc_t) xdr_ypresp_key_val,
(caddr_t) & resp);
Look at third argument. Xargs are handled as xdr_ypreq_nokey. This
is the reason why we need this patch. I've attached new patch which
also includes fix for .x.
Regards,
-- gotom
2003-03-25 GOTO Masanori <gotom at debian dot or dot jp>
* nis/rpcsvc/yp.h: Fix ypproc_first_2{_svc} argument from ypreq_key
to ypreq_nokey.
* nis/rpcsvc/yp.x: likewise.
--- nis/rpcsvc/yp.h 2001-01-01 01:55:53.000000000 +0900
+++ nis/rpcsvc/yp.h.new 2003-03-23 00:55:41.000000000 +0900
@@ -253,8 +253,8 @@
extern ypresp_val *ypproc_match_2 (ypreq_key *, CLIENT *);
extern ypresp_val *ypproc_match_2_svc (ypreq_key *, struct svc_req *);
#define YPPROC_FIRST 4
-extern ypresp_key_val *ypproc_first_2 (ypreq_key *, CLIENT *);
-extern ypresp_key_val *ypproc_first_2_svc (ypreq_key *, struct svc_req *);
+extern ypresp_key_val *ypproc_first_2 (ypreq_nokey *, CLIENT *);
+extern ypresp_key_val *ypproc_first_2_svc (ypreq_nokey *, struct svc_req *);
#define YPPROC_NEXT 5
extern ypresp_key_val *ypproc_next_2 (ypreq_key *, CLIENT *);
extern ypresp_key_val *ypproc_next_2_svc (ypreq_key *, struct svc_req *);
--- nis/rpcsvc/yp.x 1997-02-04 11:00:32.000000000 +0900
+++ nis/rpcsvc/yp.x.new 2003-03-25 19:24:25.000000000 +0900
@@ -241,8 +241,19 @@
ypresp_val
YPPROC_MATCH(ypreq_key) = 3;
+#ifdef STUPID_SUN_BUG
+ /* This is the form as distributed by Sun. But even
+ the Sun NIS servers expect the values in the other
+ order. So their implementation somehow must change
+ the order internally. We don't want to follow this
+ bad example since the user should be able to use
+ rpcgen on this file. */
ypresp_key_val
YPPROC_FIRST(ypreq_key) = 4;
+#else
+ ypresp_key_val
+ YPPROC_FIRST(ypreq_nokey) = 4;
+#endif
ypresp_key_val
YPPROC_NEXT(ypreq_key) = 5;