Deleted Added
full compact
rpc.umntall.c (87576) rpc.umntall.c (114119)
1/*
2 * Copyright (c) 1999 Martin Blapp
3 * 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

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

22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 */
27
28#ifndef lint
29static const char rcsid[] =
1/*
2 * Copyright (c) 1999 Martin Blapp
3 * 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

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

22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 */
27
28#ifndef lint
29static const char rcsid[] =
30 "$FreeBSD: head/usr.sbin/rpc.umntall/rpc.umntall.c 87576 2001-12-09 20:18:36Z iedowse $";
30 "$FreeBSD: head/usr.sbin/rpc.umntall/rpc.umntall.c 114119 2003-04-27 07:09:33Z imp $";
31#endif /* not lint */
32
33#include <sys/param.h>
34#include <sys/ucred.h>
35#include <sys/mount.h>
36
37#include <rpc/rpc.h>
38#include <nfs/rpcv2.h>

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

79 path = optarg;
80 break;
81 case 'v':
82 verbose = 1;
83 break;
84 case '?':
85 usage();
86 default:
31#endif /* not lint */
32
33#include <sys/param.h>
34#include <sys/ucred.h>
35#include <sys/mount.h>
36
37#include <rpc/rpc.h>
38#include <nfs/rpcv2.h>

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

79 path = optarg;
80 break;
81 case 'v':
82 verbose = 1;
83 break;
84 case '?':
85 usage();
86 default:
87 break;
87 }
88 argc -= optind;
89 argv += optind;
90
91 /* Default expiretime is one day */
92 if (expire == 0)
93 expire = 86400;
94 time(&now);

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

176 clp = clnt_create(hostname, RPCPROG_MNT, RPCMNT_VER1, "udp");
177 if (clp == NULL) {
178 warnx("%s: %s", hostname, clnt_spcreateerror("RPCPROG_MNT"));
179 return (0);
180 }
181 clp->cl_auth = authunix_create_default();
182 try.tv_sec = 3;
183 try.tv_usec = 0;
88 }
89 argc -= optind;
90 argv += optind;
91
92 /* Default expiretime is one day */
93 if (expire == 0)
94 expire = 86400;
95 time(&now);

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

177 clp = clnt_create(hostname, RPCPROG_MNT, RPCMNT_VER1, "udp");
178 if (clp == NULL) {
179 warnx("%s: %s", hostname, clnt_spcreateerror("RPCPROG_MNT"));
180 return (0);
181 }
182 clp->cl_auth = authunix_create_default();
183 try.tv_sec = 3;
184 try.tv_usec = 0;
184 clnt_stat = clnt_call(clp, RPCMNT_UMNTALL, xdr_void, (caddr_t)0,
185 xdr_void, (caddr_t)0, try);
185 clnt_stat = clnt_call(clp, RPCMNT_UMNTALL, (xdrproc_t)xdr_void,
186 (caddr_t)0, (xdrproc_t)xdr_void, (caddr_t)0, try);
186 if (clnt_stat != RPC_SUCCESS)
187 warnx("%s: %s", hostname, clnt_sperror(clp, "RPCMNT_UMNTALL"));
188 auth_destroy(clp->cl_auth);
189 clnt_destroy(clp);
190 return (clnt_stat == RPC_SUCCESS);
191}
192
193/*

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

202 clp = clnt_create(hostname, RPCPROG_MNT, RPCMNT_VER1, "udp");
203 if (clp == NULL) {
204 warnx("%s: %s", hostname, clnt_spcreateerror("RPCPROG_MNT"));
205 return (0);
206 }
207 clp->cl_auth = authsys_create_default();
208 try.tv_sec = 3;
209 try.tv_usec = 0;
187 if (clnt_stat != RPC_SUCCESS)
188 warnx("%s: %s", hostname, clnt_sperror(clp, "RPCMNT_UMNTALL"));
189 auth_destroy(clp->cl_auth);
190 clnt_destroy(clp);
191 return (clnt_stat == RPC_SUCCESS);
192}
193
194/*

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

203 clp = clnt_create(hostname, RPCPROG_MNT, RPCMNT_VER1, "udp");
204 if (clp == NULL) {
205 warnx("%s: %s", hostname, clnt_spcreateerror("RPCPROG_MNT"));
206 return (0);
207 }
208 clp->cl_auth = authsys_create_default();
209 try.tv_sec = 3;
210 try.tv_usec = 0;
210 clnt_stat = clnt_call(clp, RPCMNT_UMOUNT, xdr_dir, dirp,
211 xdr_void, (caddr_t)0, try);
211 clnt_stat = clnt_call(clp, RPCMNT_UMOUNT, (xdrproc_t)xdr_dir, dirp,
212 (xdrproc_t)xdr_void, (caddr_t)0, try);
212 if (clnt_stat != RPC_SUCCESS)
213 warnx("%s: %s", hostname, clnt_sperror(clp, "RPCMNT_UMOUNT"));
214 auth_destroy(clp->cl_auth);
215 clnt_destroy(clp);
216 return (clnt_stat == RPC_SUCCESS);
217}
218
219/*

--- 43 unchanged lines hidden ---
213 if (clnt_stat != RPC_SUCCESS)
214 warnx("%s: %s", hostname, clnt_sperror(clp, "RPCMNT_UMOUNT"));
215 auth_destroy(clp->cl_auth);
216 clnt_destroy(clp);
217 return (clnt_stat == RPC_SUCCESS);
218}
219
220/*

--- 43 unchanged lines hidden ---