diff options
Diffstat (limited to 'nis')
-rw-r--r-- | nis/Versions | 7 | ||||
-rw-r--r-- | nis/yp_xdr.c | 45 |
2 files changed, 50 insertions, 2 deletions
diff --git a/nis/Versions b/nis/Versions index d26cba7..fff3726 100644 --- a/nis/Versions +++ b/nis/Versions @@ -48,12 +48,15 @@ libnsl { # This functions are needed by the NIS+ tools and rpc.nisd, # they should never be used in a normal user program ! - __free_fdresult; __nis_default_access; __nis_default_group; - __nis_default_owner; __nis_default_ttl; __nis_finddirectory; + __free_fdresult; __nis_default_access; __nis_default_group; + __nis_default_owner; __nis_default_ttl; __nis_finddirectory; __nis_hash; __nisbind_connect; __nisbind_create; __nisbind_destroy; __nisbind_next; readColdStartFile; writeColdStartFile; } + GLIBC_2.2 { + xdr_ypall; + } } libnss_compat { diff --git a/nis/yp_xdr.c b/nis/yp_xdr.c index f189169..f962c4d 100644 --- a/nis/yp_xdr.c +++ b/nis/yp_xdr.c @@ -28,6 +28,7 @@ */ #include <rpcsvc/yp.h> +#include <rpcsvc/ypclnt.h> bool_t xdr_ypstat (XDR *xdrs, ypstat *objp) @@ -298,3 +299,47 @@ xdr_ypbind_setdom (XDR *xdrs, ypbind_setdom *objp) return FALSE; return TRUE; } + +bool_t +xdr_ypall(XDR *xdrs, struct ypall_callback *incallback) +{ + struct ypresp_key_val out; + char key[YPMAXRECORD], val[YPMAXRECORD]; + + /* + * Set up key/val struct to be used during the transaction. + */ + memset(&out, 0, sizeof out); + out.key.keydat_val = key; + out.key.keydat_len = sizeof(key); + out.val.valdat_val = val; + out.val.valdat_len = sizeof(val); + + for (;;) { + bool_t more, status; + + /* Values pending? */ + if (!xdr_bool(xdrs, &more)) + return FALSE; /* can't tell! */ + if (!more) + return TRUE; /* no more */ + + /* Transfer key/value pair. */ + status = xdr_ypresp_key_val(xdrs, &out); + + /* + * If we succeeded, call the callback function. + * The callback will return TRUE when it wants + * no more values. If we fail, indicate the + * error. + */ + if (status) { + if ((*incallback->foreach)(out.stat, + (char *)out.key.keydat_val, out.key.keydat_len, + (char *)out.val.valdat_val, out.val.valdat_len, + incallback->data)) + return TRUE; + } else + return FALSE; + } +} |