Deleted Added
full compact
yp_update.c (84220) yp_update.c (90297)
1/*
2 * Copyright (c) 1995, 1996
3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 23 unchanged lines hidden (view full) ---

32 * ypupdate client-side library function.
33 *
34 * Written by Bill Paul <wpaul@ctr.columbia.edu>
35 * Center for Telecommunications Research
36 * Columbia University, New York City
37 */
38
39#include <sys/cdefs.h>
1/*
2 * Copyright (c) 1995, 1996
3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 23 unchanged lines hidden (view full) ---

32 * ypupdate client-side library function.
33 *
34 * Written by Bill Paul <wpaul@ctr.columbia.edu>
35 * Center for Telecommunications Research
36 * Columbia University, New York City
37 */
38
39#include <sys/cdefs.h>
40__FBSDID("$FreeBSD: head/lib/librpcsvc/yp_update.c 84220 2001-09-30 22:15:15Z dillon $");
40__FBSDID("$FreeBSD: head/lib/librpcsvc/yp_update.c 90297 2002-02-06 13:30:31Z des $");
41
42#include <stdlib.h>
43#include <rpc/rpc.h>
44#include <rpcsvc/yp_prot.h>
45#include <rpcsvc/ypclnt.h>
46#include <rpcsvc/ypupdate_prot.h>
47#include <rpc/key_prot.h>
48

--- 33 unchanged lines hidden (view full) ---

82 if (getrpcport(master, YPU_PROG, YPU_VERS, ypop))
83 return(YPERR_DOMAIN);
84
85 /* Get a handle. */
86 if ((clnt = clnt_create(master, YPU_PROG, YPU_VERS, "tcp")) == NULL)
87 return(YPERR_RPC);
88
89 /*
41
42#include <stdlib.h>
43#include <rpc/rpc.h>
44#include <rpcsvc/yp_prot.h>
45#include <rpcsvc/ypclnt.h>
46#include <rpcsvc/ypupdate_prot.h>
47#include <rpc/key_prot.h>
48

--- 33 unchanged lines hidden (view full) ---

82 if (getrpcport(master, YPU_PROG, YPU_VERS, ypop))
83 return(YPERR_DOMAIN);
84
85 /* Get a handle. */
86 if ((clnt = clnt_create(master, YPU_PROG, YPU_VERS, "tcp")) == NULL)
87 return(YPERR_RPC);
88
89 /*
90 * Assemble netname of server.
90 * Assemble netname of server.
91 * NOTE: It's difficult to discern from the documentation, but
92 * when you make a Secure RPC call, the netname you pass should
93 * be the netname of the guy on the other side, not your own
94 * netname. This is how the client side knows what public key
95 * to use for the initial exchange. Passing your own netname
96 * only works if the server on the other side is running under
97 * your UID.
98 */

--- 20 unchanged lines hidden (view full) ---

119 * Make the call. Note that we use clnt_call() here rather than
120 * the rpcgen-erated client stubs. We could use those stubs, but
121 * then we'd have to do some gymnastics to get at the error
122 * information to figure out what error code to send back to the
123 * caller. With clnt_call(), we get the error status returned to
124 * us right away, and we only have to exert a small amount of
125 * extra effort.
126 */
91 * NOTE: It's difficult to discern from the documentation, but
92 * when you make a Secure RPC call, the netname you pass should
93 * be the netname of the guy on the other side, not your own
94 * netname. This is how the client side knows what public key
95 * to use for the initial exchange. Passing your own netname
96 * only works if the server on the other side is running under
97 * your UID.
98 */

--- 20 unchanged lines hidden (view full) ---

119 * Make the call. Note that we use clnt_call() here rather than
120 * the rpcgen-erated client stubs. We could use those stubs, but
121 * then we'd have to do some gymnastics to get at the error
122 * information to figure out what error code to send back to the
123 * caller. With clnt_call(), we get the error status returned to
124 * us right away, and we only have to exert a small amount of
125 * extra effort.
126 */
127 switch(ypop) {
127 switch (ypop) {
128 case YPOP_CHANGE:
129 upargs.mapname = map;
130 upargs.key.yp_buf_len = keylen;
131 upargs.key.yp_buf_val = key;
132 upargs.datum.yp_buf_len = datalen;
133 upargs.datum.yp_buf_val = data;
134
135 if ((rval = clnt_call(clnt, YPU_CHANGE, xdr_ypupdate_args,

--- 66 unchanged lines hidden ---
128 case YPOP_CHANGE:
129 upargs.mapname = map;
130 upargs.key.yp_buf_len = keylen;
131 upargs.key.yp_buf_val = key;
132 upargs.datum.yp_buf_len = datalen;
133 upargs.datum.yp_buf_val = data;
134
135 if ((rval = clnt_call(clnt, YPU_CHANGE, xdr_ypupdate_args,

--- 66 unchanged lines hidden ---