1 --- util-linux-2.13-pre6/mount/Makefile.am.nonfs 2006-09-20 12:45:50.000000000 +0200
2 +++ util-linux-2.13-pre6/mount/Makefile.am 2006-09-20 12:46:51.000000000 +0200
4 include $(top_srcdir)/config/include-Makefile.am
6 -AM_CPPFLAGS += -DHAVE_NFS
8 bin_PROGRAMS = mount umount
9 sbin_PROGRAMS = losetup swapon
10 -man_MANS = fstab.5 nfs.5 mount.8 swapoff.8 swapon.8 umount.8 losetup.8
11 +man_MANS = fstab.5 mount.8 swapoff.8 swapon.8 umount.8 losetup.8
13 mount_SOURCES = mount.c fstab.c sundries.c xmalloc.c realpath.c mntent.c \
14 get_label_uuid.c mount_by_label.c mount_blkid.c mount_guess_fstype.c \
15 getusername.c cryptsetup.c \
16 - nfsmount.c nfsmount_xdr.c nfsmount_clnt.c \
19 mount_LDADD = $(top_srcdir)/lib/libenv.a $(top_srcdir)/lib/libsetproctitle.a
20 --- util-linux-2.13-pre6/mount/sundries.c.nonfs 2006-09-20 12:53:09.000000000 +0200
21 +++ util-linux-2.13-pre6/mount/sundries.c 2006-09-20 12:53:13.000000000 +0200
26 -#include "nfsmount.h"
30 --- util-linux-2.13-pre6/mount/umount.c.nonfs 2006-09-20 12:51:11.000000000 +0200
31 +++ util-linux-2.13-pre6/mount/umount.c 2006-09-20 12:52:26.000000000 +0200
36 -#include <sys/socket.h>
37 -#include <sys/time.h>
40 -#include <rpc/pmap_clnt.h>
41 -#include <rpc/pmap_prot.h>
42 -#include "nfsmount.h"
43 -#include <arpa/inet.h>
45 #if defined(MNT_FORCE) && !defined(__sparc__) && !defined(__arm__)
46 /* Interesting ... it seems libc knows about MNT_FORCE and presumably
47 about umount2 as well -- need not do anything */
52 -static int xdr_dir(XDR *xdrsp, char *dirp)
54 - return (xdr_string(xdrsp, &dirp, MNTPATHLEN));
58 -nfs_umount_rpc_call(const char *spec, const char *opts)
60 - register CLIENT *clp;
61 - struct sockaddr_in saddr;
62 - struct timeval pertry, try;
63 - enum clnt_stat clnt_stat;
65 - int so = RPC_ANYSOCK;
66 - struct hostent *hostp;
71 - if (spec == NULL || (p = strchr(spec,':')) == NULL)
73 - hostname = xstrndup(spec, p-spec);
74 - dirname = xstrdup(p+1);
76 - printf(_("host: %s, directory: %s\n"), hostname, dirname);
79 - if (opts && (p = strstr(opts, "addr="))) {
85 - while (*q && *q != ',') q++;
86 - hostname = xstrndup(p,q-p);
89 - if (opts && (p = strstr(opts, "mountport=")) && isdigit(*(p+10)))
92 - if (hostname[0] >= '0' && hostname[0] <= '9')
93 - saddr.sin_addr.s_addr = inet_addr(hostname);
95 - if ((hostp = gethostbyname(hostname)) == NULL) {
96 - fprintf(stderr, _("umount: can't get address for %s\n"),
100 - if (hostp->h_length > sizeof(struct in_addr)) {
101 - fprintf(stderr, _("umount: got bad hostp->h_length\n"));
102 - hostp->h_length = sizeof(struct in_addr);
104 - memcpy(&saddr.sin_addr, hostp->h_addr, hostp->h_length);
107 - saddr.sin_family = AF_INET;
108 - saddr.sin_port = htons(port);
110 - pertry.tv_usec = 0;
111 - if (opts && (p = strstr(opts, "tcp"))) {
112 - /* possibly: make sure option is not "notcp"
113 - possibly: try udp if tcp fails */
114 - if ((clp = clnttcp_create(&saddr, MOUNTPROG, MOUNTVERS,
115 - &so, 0, 0)) == NULL) {
116 - clnt_pcreateerror("Cannot MOUNTPROG RPC (tcp)");
120 - if ((clp = clntudp_create(&saddr, MOUNTPROG, MOUNTVERS,
121 - pertry, &so)) == NULL) {
122 - clnt_pcreateerror("Cannot MOUNTPROG RPC");
126 - clp->cl_auth = authunix_create_default();
129 - clnt_stat = clnt_call(clp, MOUNTPROC_UMNT,
130 - (xdrproc_t) xdr_dir, dirname,
131 - (xdrproc_t) xdr_void, (caddr_t) 0,
134 - if (clnt_stat != RPC_SUCCESS) {
135 - clnt_perror(clp, "Bad UMNT RPC");
138 - auth_destroy(clp->cl_auth);
144 /* complain about a failed umount */
145 static void complain(int err, const char *dev) {
148 if (check_special_umountprog(spec, node, type, &status))
151 - /* Ignore any RPC errors, so that you can umount the filesystem
152 - if the server is down. */
153 - if (strcasecmp(type, "nfs") == 0)
154 - nfs_umount_rpc_call(spec, opts);
156 umnt_err = umnt_err2 = 0;
158 res = umount2 (node, MNT_DETACH);
159 --- util-linux-2.13-pre6/mount/mount.c.nonfs 2006-09-20 12:48:48.000000000 +0200
160 +++ util-linux-2.13-pre6/mount/mount.c 2006-09-20 12:48:33.000000000 +0200
166 - * Also nfs requires a separate program, but it is built in.
168 - if (!fake && types && streq (types, "nfs")) {
170 - mnt_err = nfsmount (spec, node, &flags, &extra_opts, &mount_opts,
171 - &nfs_mount_version, bg);
178 block_signals (SIG_BLOCK);
181 @@ -1018,15 +1005,6 @@
183 block_signals (SIG_UNBLOCK);
185 - if (mnt_err && types && streq (types, "nfs")) {
186 - if (nfs_mount_version == 4 && mnt_err != EBUSY && mnt_err != ENOENT) {
188 - printf(_("mount: failed with nfs mount version 4, trying 3..\n"));
189 - nfs_mount_version = 3;
194 /* Mount failed, complain, but don't die. */