- Upgraded to the latest upstream version (nfs-utils-1.1.0)

This commit is contained in:
Steve Dickson 2007-07-30 10:10:07 +00:00
parent f543a222e2
commit cafae3aae5
32 changed files with 270 additions and 2224 deletions

View File

@ -9,3 +9,4 @@ nfs-utils-1.0.9.tar.bz2
nfs-utils-1.0.10.tar.bz2
nfs-utils-1.0.11.tar.bz2
nfs-utils-1.0.12.tar.bz2
nfs-utils-1.1.0.tar.bz2

View File

@ -1,35 +0,0 @@
Signed-off-by: Karel Zak <kzak@redhat.com>
--- nfs-utils-1.0.10/utils/mount/mount.c.kzak 2007-02-09 12:26:16.000000000 +0100
+++ nfs-utils-1.0.10/utils/mount/mount.c 2007-02-09 12:27:59.000000000 +0100
@@ -494,20 +494,21 @@
&extra_opts, &mount_opts, 0);
}
}
- if (fake)
- return 0;
if (mnt_err)
exit(EX_FAIL);
- mnt_err = do_mount_syscall(spec, mount_point,
- nfs_mount_vers == 4 ? "nfs4" : "nfs", flags, mount_opts);
+ if (!fake) {
+ mnt_err = do_mount_syscall(spec, mount_point,
+ nfs_mount_vers == 4 ? "nfs4" : "nfs",
+ flags, mount_opts);
- if(mnt_err) {
- mount_error(mount_point);
- exit(EX_FAIL);
+ if (mnt_err) {
+ mount_error(mount_point);
+ exit(EX_FAIL);
+ }
}
- if(!nomtab) {
+ if (!nomtab) {
add_mtab(spec, mount_point, nfs_mount_vers == 4 ? "nfs4" : "nfs",
flags, extra_opts, 0, 0);
}

View File

@ -1,45 +0,0 @@
--- nfs-utils-1.0.10/utils/mount/nfsmount.c.orig 2006-11-14 19:47:45.000000000 -0500
+++ nfs-utils-1.0.10/utils/mount/nfsmount.c 2006-11-14 20:18:01.000000000 -0500
@@ -822,8 +822,7 @@ nfsmnt_check_compat(const struct pmap *n
int
nfsmount(const char *spec, const char *node, int *flags,
- char **extra_opts, char **mount_opts, int *nfs_mount_vers,
- int running_bg)
+ char **extra_opts, char **mount_opts, int running_bg)
{
static char *prev_bg_host;
char hostdir[1024];
@@ -854,9 +853,7 @@ nfsmount(const char *spec, const char *n
/* The version to try is either specified or 0
In case it is 0 we tell the caller what we tried */
- if (!*nfs_mount_vers)
- *nfs_mount_vers = find_kernel_nfs_mount_version();
- nfs_mount_version = *nfs_mount_vers;
+ nfs_mount_version = find_kernel_nfs_mount_version();
retval = EX_FAIL;
fsock = -1;
--- nfs-utils-1.0.10/utils/mount/mount.c.orig 2006-11-14 19:47:45.000000000 -0500
+++ nfs-utils-1.0.10/utils/mount/mount.c 2006-11-14 20:10:18.000000000 -0500
@@ -491,7 +491,7 @@ int main(int argc, char *argv[])
else {
if (!strcmp(progname, "mount.nfs")) {
mnt_err = nfsmount(spec, mount_point, &flags,
- &extra_opts, &mount_opts, &nfs_mount_vers, 0);
+ &extra_opts, &mount_opts, 0);
}
}
if (fake)
--- nfs-utils-1.0.10/utils/mount/nfs_mount.h.orig 2006-11-14 19:47:45.000000000 -0500
+++ nfs-utils-1.0.10/utils/mount/nfs_mount.h 2006-11-14 20:09:01.000000000 -0500
@@ -79,7 +79,7 @@ struct nfs_mount_data {
#define AUTH_GSS_SPKMP 390011
#endif
-int nfsmount(const char *, const char *, int *, char **, char **, int *, int);
+int nfsmount(const char *, const char *, int *, char **, char **, int);
void mount_errors(char *, int, int);
int contains(const char *, const char *);
char *get_value(const char *, const char *);

View File

@ -1,45 +0,0 @@
--- nfs-utils-1.0.10/utils/mount/nfs_mount.h.orig 2007-05-15 09:54:09.293871000 -0400
+++ nfs-utils-1.0.10/utils/mount/nfs_mount.h 2007-05-15 09:55:02.842057000 -0400
@@ -63,6 +63,7 @@ struct nfs_mount_data {
#define NFS_MOUNT_BROKEN_SUID 0x0400 /* 4 */
#define NFS_MOUNT_NOACL 0x0800 /* 4 */
#define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 */
+#define NFS_MOUNT_NORDIRPLUS 0x4000 /* 5 */
/* security pseudoflavors */
--- nfs-utils-1.0.10/utils/mount/nfsmount.c.orig 2007-05-15 09:54:09.331833000 -0400
+++ nfs-utils-1.0.10/utils/mount/nfsmount.c 2007-05-15 09:55:02.852057000 -0400
@@ -762,6 +762,10 @@ parse_options(char *old_opts, struct nfs
data->flags &= ~NFS_MOUNT_NOACL;
if (!val)
data->flags |= NFS_MOUNT_NOACL;
+ } else if (!strcmp(opt, "rdirplus")) {
+ data->flags &= ~NFS_MOUNT_NORDIRPLUS;
+ if (!val)
+ data->flags |= NFS_MOUNT_NORDIRPLUS;
#endif
} else {
bad_option:
@@ -947,6 +951,7 @@ nfsmount(const char *spec, const char *n
#endif
#if NFS_MOUNT_VERSION >= 5
printf("sec = %u ", data.pseudoflavor);
+ printf("readdirplus = %d ", (data.flags & NFS_MOUNT_NORDIRPLUS) != 0);
#endif
printf("\n");
#endif
--- nfs-utils-1.0.10/utils/mount/nfs.man.orig 2007-05-15 09:54:09.210933000 -0400
+++ nfs-utils-1.0.10/utils/mount/nfs.man 2007-05-15 09:55:02.860057000 -0400
@@ -272,6 +272,11 @@ default UDP protocol. Many NFS servers
.I udp
Mount the NFS filesystem using the UDP protocol. This
is the default.
+.TP 1.5i
+.I nordirplus
+Disables NFSv3 READDIRPLUS RPCs. Use this options when
+mounting servers that don't support or have broken
+READDIRPLUS implementations.
.P
All of the non-value options have corresponding nooption forms.
For example, nointr means don't allow file operations to be

View File

@ -1,11 +0,0 @@
--- nfs-utils-1.0.9/support/nfs/conn.c.noconnect
+++ nfs-utils-1.0.9/support/nfs/conn.c
@@ -98,7 +98,7 @@ int get_socket(struct sockaddr_in *saddr
return RPC_ANYSOCK;
}
}
- if (type == SOCK_STREAM || type == SOCK_DGRAM) {
+ if (type == SOCK_STREAM) {
cc = connect(so, (struct sockaddr *)saddr, namelen);
if (cc < 0) {
rpc_createerr.cf_stat = RPC_SYSTEMERROR;

View File

@ -1,76 +0,0 @@
--- nfs-utils-1.0.10/utils/mount/nfsumount.c.orig 2006-12-07 10:25:41.000000000 -0500
+++ nfs-utils-1.0.10/utils/mount/nfsumount.c 2006-12-11 15:00:29.000000000 -0500
@@ -333,7 +333,7 @@ void umount_usage()
int nfsumount(int argc, char *argv[])
{
- int c, ret;
+ int c, ret, v4=0;
char *spec;
struct mntentchn *mc;
@@ -371,39 +371,33 @@ int nfsumount(int argc, char *argv[])
mc = getmntdirbackward(spec, NULL);
if (!mc)
mc = getmntdevbackward(spec, NULL);
- if (!mc && verbose)
- printf(_("Could not find %s in mtab\n"), spec);
-
- if(mc) {
- if(contains(mc->m.mnt_opts, "user") && getuid() != 0) {
- struct passwd *pw = getpwuid(getuid());
- if(!pw || strcmp(pw->pw_name, get_value(mc->m.mnt_opts, "user="))) {
- fprintf(stderr, "%s: permission denied to unmount %s\n",
- progname, spec);
- exit(1);
- }
- } else {
- if(!contains(mc->m.mnt_opts, "users") && getuid() != 0) {
- fprintf(stderr, "%s: only root can unmount %s from %s\n",
- progname, mc->m.mnt_fsname, mc->m.mnt_dir);
- exit(1);
- }
- }
-
- ret = 0;
- if(!force && !lazy)
- ret = _nfsumount(mc->m.mnt_fsname, mc->m.mnt_opts);
- if(!ret)
- ret = add_mtab2(mc->m.mnt_fsname, mc->m.mnt_dir,
- mc->m.mnt_type, mc->m.mnt_opts, mc);
+ if (mc == NULL) {
+ fprintf(stderr, "%s: Unable to find '%s' in mount table\n",
+ progname, spec);
+ exit(1);
}
- else {
- ret = 0;
- if(!force && !lazy)
- ret = _nfsumount(spec, NULL);
- if(!ret)
- ret = add_mtab2(spec, spec, spec, spec, NULL);
+ if(contains(mc->m.mnt_opts, "user") && getuid() != 0) {
+ struct passwd *pw = getpwuid(getuid());
+ if(!pw || strcmp(pw->pw_name, get_value(mc->m.mnt_opts, "user="))) {
+ fprintf(stderr, "%s: permission denied to unmount %s\n",
+ progname, spec);
+ exit(1);
+ }
+ } else {
+ if(!contains(mc->m.mnt_opts, "users") && getuid() != 0) {
+ fprintf(stderr, "%s: only root can unmount %s from %s\n",
+ progname, mc->m.mnt_fsname, mc->m.mnt_dir);
+ exit(1);
+ }
}
+ v4 = contains(mc->m.mnt_type, "nfs4");
+
+ ret = 0;
+ if(!force && !lazy && !v4)
+ ret = _nfsumount(mc->m.mnt_fsname, mc->m.mnt_opts);
+ if(!ret)
+ ret = add_mtab2(mc->m.mnt_fsname, mc->m.mnt_dir,
+ mc->m.mnt_type, mc->m.mnt_opts, mc);
return(ret);
}

View File

@ -1,83 +0,0 @@
--- nfs-utils-1.0.12/support/nfs/exports.c.orig 2007-02-26 23:55:40.000000000 -0500
+++ nfs-utils-1.0.12/support/nfs/exports.c 2007-03-09 12:25:37.000000000 -0500
@@ -32,7 +32,8 @@
#include "xio.h"
#define EXPORT_DEFAULT_FLAGS \
- (NFSEXP_READONLY|NFSEXP_ROOTSQUASH|NFSEXP_GATHERED_WRITES)
+ (NFSEXP_READONLY|NFSEXP_ROOTSQUASH|NFSEXP_GATHERED_WRITES|\
+ NFSEXP_NOSUBTREECHECK)
int export_errno;
@@ -45,7 +46,7 @@ static int *squids = NULL, nsquids = 0,
static int getexport(char *exp, int len);
static int getpath(char *path, int len);
-static int parseopts(char *cp, struct exportent *ep, int warn, int *had_subtree_opt_ptr);
+static int parseopts(char *cp, struct exportent *ep);
static int parsesquash(char *list, int **idp, int *lenp, char **ep);
static int parsenum(char **cpp);
static int parsemaptype(char *type);
@@ -122,7 +123,7 @@ getexportent(int fromkernel, int fromexp
/* Check for default options */
if (exp[0] == '-') {
- if (parseopts(exp + 1, &def_ee, 0, &has_default_subtree_opts) < 0)
+ if (parseopts(exp + 1, &def_ee) < 0)
return NULL;
has_default_opts = 1;
@@ -166,7 +167,7 @@ getexportent(int fromkernel, int fromexp
strncpy(ee.e_hostname, hostname, sizeof (ee.e_hostname) - 1);
ee.e_hostname[sizeof (ee.e_hostname) - 1] = '\0';
- if (parseopts(opt, &ee, fromexports && !has_default_subtree_opts, NULL) < 0)
+ if (parseopts(opt, &ee) < 0)
return NULL;
/* resolve symlinks */
@@ -343,7 +344,7 @@ mkexportent(char *hname, char *path, cha
ee.e_path[sizeof (ee.e_path) - 1] = '\0';
strncpy (ee.m_path, ee.e_path, sizeof (ee.m_path) - 1);
ee.m_path [sizeof (ee.m_path) - 1] = '\0';
- if (parseopts(options, &ee, 0, NULL) < 0)
+ if (parseopts(options, &ee) < 0)
return NULL;
return &ee;
}
@@ -351,7 +352,7 @@ mkexportent(char *hname, char *path, cha
int
updateexportent(struct exportent *eep, char *options)
{
- if (parseopts(options, eep, 0, NULL) < 0)
+ if (parseopts(options, eep) < 0)
return 0;
return 1;
}
@@ -371,7 +372,7 @@ static int valid_uuid(char *uuid)
* Parse option string pointed to by cp and set mount options accordingly.
*/
static int
-parseopts(char *cp, struct exportent *ep, int warn, int *had_subtree_opt_ptr)
+parseopts(char *cp, struct exportent *ep)
{
int had_subtree_opt = 0;
char *flname = efname?efname:"command line";
@@ -539,16 +540,6 @@ bad_option:
ep->e_nsqgids = nsqgids;
out:
- if (warn && !had_subtree_opt)
- xlog(L_WARNING, "%s [%d]: Neither 'subtree_check' or 'no_subtree_check' specified for export \"%s:%s\".\n"
- " Assuming default behaviour ('subtree_check').\n"
- " NOTE: this default will change with nfs-utils version 1.1.0\n",
-
- flname, flline,
- ep->e_hostname, ep->e_path);
- if (had_subtree_opt_ptr)
- *had_subtree_opt_ptr = had_subtree_opt;
-
return 1;
}

View File

@ -1,132 +0,0 @@
commit ec08843916d07c28045398e5b17e7347a8fa0135
Author: Steve Dickson <steved@redhat.com>
Date: Fri May 11 12:13:06 2007 -0400
nfs-utils: have mountd hold open etab file to force inode number to change
This patch changes mountd to hold the etab file open so that when it's
changed by exportfs, the inode number should change. We then change
auth_reload to reload the file based on whether st_ino is different
from the last time it was checked. It also changes auth_reload to
maintain a static counter value and return it instead of a timestamp
and fixes up get_exportlist accordingly. Finally, it adds some
comments to xtab_write to warn people about editing the etab in place.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
diff --git a/support/export/xtab.c b/support/export/xtab.c
index 0ddb251..292087b 100644
--- a/support/export/xtab.c
+++ b/support/export/xtab.c
@@ -80,6 +80,12 @@ xtab_export_read(void)
return xtab_read(_PATH_ETAB, 1);
}
+/*
+ * mountd now keeps an open fd for the etab at all times to make sure that the
+ * inode number changes when the xtab_export_write is done. If you change the
+ * routine below such that the files are edited in place, then you'll need to
+ * fix the auth_reload logic as well...
+ */
static int
xtab_write(char *xtab, char *xtabtmp, int is_export)
{
diff --git a/utils/mountd/auth.c b/utils/mountd/auth.c
index 183c9ea..f7fe23d 100644
--- a/utils/mountd/auth.c
+++ b/utils/mountd/auth.c
@@ -14,6 +14,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <errno.h>
+#include <unistd.h>
#include "misc.h"
#include "nfslib.h"
#include "exportfs.h"
@@ -46,24 +47,34 @@ auth_init(char *exports)
xtab_mount_write();
}
-time_t
+unsigned int
auth_reload()
{
struct stat stb;
- static time_t last_modified = 0;
-
- if (stat(_PATH_ETAB, &stb) < 0)
+ static ino_t last_inode;
+ static int last_fd;
+ static unsigned int counter;
+ int fd;
+
+ if ((fd = open(_PATH_ETAB, O_RDONLY)) < 0) {
+ xlog(L_FATAL, "couldn't open %s", _PATH_ETAB);
+ } else if (fstat(fd, &stb) < 0) {
xlog(L_FATAL, "couldn't stat %s", _PATH_ETAB);
- if (stb.st_mtime == last_modified)
- return last_modified;
- last_modified = stb.st_mtime;
+ } else if (stb.st_ino == last_inode) {
+ close(fd);
+ return counter;
+ } else {
+ close(last_fd);
+ last_fd = fd;
+ last_inode = stb.st_ino;
+ }
export_freeall();
memset(&my_client, 0, sizeof(my_client));
- // export_read(export_file);
xtab_export_read();
+ ++counter;
- return last_modified;
+ return counter;
}
static nfs_export *
diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c
index fc9a73c..09cab84 100644
--- a/utils/mountd/mountd.c
+++ b/utils/mountd/mountd.c
@@ -465,18 +465,18 @@ static exports
get_exportlist(void)
{
static exports elist = NULL;
- static time_t etime = 0;
- time_t atime;
struct exportnode *e, *ne;
struct groupnode *g, *ng, *c, **cp;
nfs_export *exp;
int i;
+ static unsigned int ecounter;
+ unsigned int acounter;
- atime = auth_reload();
- if (elist && atime == etime)
+ acounter = auth_reload();
+ if (elist && acounter == ecounter)
return elist;
- etime = atime;
+ ecounter = acounter;
for (e = elist; e != NULL; e = ne) {
ne = e->ex_next;
diff --git a/utils/mountd/mountd.h b/utils/mountd/mountd.h
index b539278..31bacb5 100644
--- a/utils/mountd/mountd.h
+++ b/utils/mountd/mountd.h
@@ -40,7 +40,7 @@ bool_t mount_mnt_3_svc(struct svc_req *, dirpath *, mountres3 *);
void mount_dispatch(struct svc_req *, SVCXPRT *);
void auth_init(char *export_file);
-time_t auth_reload(void);
+unsigned int auth_reload(void);
nfs_export * auth_authenticate(char *what, struct sockaddr_in *sin,
char *path);
void auth_export(nfs_export *exp);

View File

@ -1,43 +0,0 @@
commit 28343730efd6f99efff197bf1efd4b975e874ce4
Author: Steve Dickson <steved@redhat.com>
Date: Wed May 9 14:59:52 2007 -0400
The man updated to the "mountd adds gibberish to rmtab" patch
Signed-off-by: Steve Dickson <steved@redhat.com>
diff --git a/utils/mountd/mountd.man b/utils/mountd/mountd.man
index f8646d4..4276663 100644
--- a/utils/mountd/mountd.man
+++ b/utils/mountd/mountd.man
@@ -125,6 +125,13 @@ If this option is not specified the default of
.BR /var/lib/nfs
is used.
.TP
+.BI "\-r," "" " \-\-reverse\-lookup"
+mountd tracks IP addresses in the rmtab, and when a DUMP request is made (by
+someone running showmount -a, for instance), it returns IP addresses instead
+of hostnames by default. This option causes mountd to do a reverse
+lookup on each IP address and return that hostname instead. Enabling this can
+have a substantial negative effect on performance in some situations.
+.TP
.BR "\-t N" " or " "\-\-num\-threads=N"
This option specifies the number of worker threads that rpc.mountd
spawns. The default is 1 thread, which is probably enough. More
diff --git a/utils/showmount/showmount.man b/utils/showmount/showmount.man
index 5162ba4..a2f510f 100644
--- a/utils/showmount/showmount.man
+++ b/utils/showmount/showmount.man
@@ -25,8 +25,10 @@ appear as though it were processed through ``sort \-u''.
.SH OPTIONS
.TP
.BR \-a " or " \-\-all
-List both the client hostname and mounted directory in
-host:dir format.
+List both the client hostname or IP address and mounted directory in
+host:dir format. This info should not be considered reliable. See the notes
+on rmtab in
+.BR rpc.mountd (8).
.TP
.BR \-d " or " \-\-directories
List only the directories mounted by some client.

View File

@ -1,6 +1,6 @@
--- ./utils/statd/statd.h.orig 2002-09-01 22:31:23.000000000 -0400
+++ ./utils/statd/statd.h 2003-07-21 10:45:54.000000000 -0400
@@ -13,10 +13,11 @@
--- nfs-utils-1.1.0/utils/statd/statd.h.orig 2007-05-10 23:40:57.000000000 -0400
+++ nfs-utils-1.1.0/utils/statd/statd.h 2007-07-14 05:55:57.000000000 -0400
@@ -16,10 +16,11 @@
/*
* Paths and filenames.
*/
@ -14,19 +14,19 @@
#endif
#define DEFAULT_SM_DIR DEFAULT_DIR_BASE "sm"
--- ./utils/statd/statd.man.orig 2002-09-16 15:23:03.000000000 -0400
+++ ./utils/statd/statd.man 2003-06-02 15:01:41.000000000 -0400
@@ -23,7 +23,7 @@ reboots.
--- nfs-utils-1.1.0/utils/statd/statd.man.orig 2007-05-10 23:40:57.000000000 -0400
+++ nfs-utils-1.1.0/utils/statd/statd.man 2007-07-14 05:57:20.000000000 -0400
@@ -24,7 +24,7 @@ reboots.
For each NFS client or server machine to be monitored,
.B rpc.statd
creates a file in
-.BR /var/lib/nfs/sm .
+.BR /var/lib/nfs/statd/sm .
When starting, it iterates through these files and notifies the
peer
.B rpc.statd
@@ -136,11 +136,11 @@ and
manual pages.
When starting, it normally runs
.B sm-notify
to iterate through these files and notify the
@@ -176,11 +176,11 @@ and send notifications to clients. This
of an NFS export from another server.
.SH FILES
-.BR /var/lib/nfs/state

View File

@ -1,9 +0,0 @@
--- nfs-utils-1.0.6/utils/idmapd/idmapd.conf.orig 2004-11-03 12:49:06.363552000 -0500
+++ nfs-utils-1.0.6/utils/idmapd/idmapd.conf 2004-11-03 12:49:40.573380000 -0500
@@ -8,3 +8,6 @@
Nobody-User = nobody
Nobody-Group = nobody
+
+[Translation]
+Method = nsswitch

View File

@ -1,28 +0,0 @@
--- nfs-utils-1.0.8/utils/statd/statd.c.orig 2005-12-19 23:12:47.000000000 -0500
+++ nfs-utils-1.0.8/utils/statd/statd.c 2006-06-30 10:03:38.000000000 -0400
@@ -231,7 +231,7 @@ int main (int argc, char **argv)
extern char *optarg;
int pid;
int arg;
- int port = 0, out_port = 0;
+ int port = 0, out_port = 0, doonce = 0;
struct rlimit rlim;
int pipefds[2] = { -1, -1};
@@ -440,7 +440,6 @@ int main (int argc, char **argv)
create_pidfile();
atexit(truncate_pidfile);
- drop_privs();
for (;;) {
if (!(run_mode & MODE_NOTIFY_ONLY)) {
@@ -469,6 +468,8 @@ int main (int argc, char **argv)
if (!(run_mode & MODE_NOTIFY_ONLY)) {
rpc_init("statd", SM_PROG, SM_VERS, sm_prog_1, port);
}
+ if (doonce++ < 1)
+ drop_privs();
/*
* Handle incoming requests: SM_NOTIFY socket requests, as

View File

@ -1,33 +0,0 @@
--- nfs-utils-1.0.9/aclocal/kerberos5.m4.orig 2006-07-07 20:04:32.000000000 -0400
+++ nfs-utils-1.0.9/aclocal/kerberos5.m4 2006-09-11 14:38:39.000000000 -0400
@@ -36,6 +36,8 @@
AC_DEFINE_UNQUOTED(KRB5_VERSION, $K5VERS, [Define this as the Kerberos version number])
if test -f $dir/include/gssapi/gssapi_krb5.h -a \
\( -f $dir/lib/libgssapi_krb5.a -o \
+ -f $dir/lib64/libgssapi_krb5.a -o \
+ -f $dir/lib64/libgssapi_krb5.so -o \
-f $dir/lib/libgssapi_krb5.so \) ; then
AC_DEFINE(HAVE_KRB5, 1, [Define this if you have MIT Kerberos libraries])
KRBDIR="$dir"
--- nfs-utils-1.0.9/Makefile.am.orig 2006-07-07 20:04:32.000000000 -0400
+++ nfs-utils-1.0.9/Makefile.am 2006-09-11 14:38:39.000000000 -0400
@@ -47,7 +47,6 @@
mkdir -p $(DESTDIR)$(statedir)/sm $(DESTDIR)$(statedir)/sm.bak
touch $(DESTDIR)$(statedir)/state
chmod go-rwx $(DESTDIR)$(statedir)/sm $(DESTDIR)$(statedir)/sm.bak $(DESTDIR)$(statedir)/state
- chown $(statduser) $(DESTDIR)$(statedir)/sm $(DESTDIR)$(statedir)/sm.bak $(DESTDIR)$(statedir)/state
uninstall-hook:
rm $(DESTDIR)$(statedir)/xtab
--- nfs-utils-1.0.9/configure.in.orig 2006-07-07 20:04:32.000000000 -0400
+++ nfs-utils-1.0.9/configure.in 2006-09-11 14:38:39.000000000 -0400
@@ -117,6 +117,9 @@
# Check whether user wants TCP wrappers support
AC_TCP_WRAPPERS
+# Arrange for large-file support
+AC_SYS_LARGEFILE
+
AC_CONFIG_SRCDIR([support/include/config.h.in])
AC_CONFIG_HEADERS([support/include/config.h])

View File

@ -1,58 +0,0 @@
--- nfs-utils-1.0.9/utils/mount/nfsumount.c.orig 2006-07-28 11:12:32.000000000 -0400
+++ nfs-utils-1.0.9/utils/mount/nfsumount.c 2006-07-28 11:14:41.000000000 -0400
@@ -100,9 +100,9 @@ int nfs_call_umount(clnt_addr_t *mnt_ser
}
mnt_closeclnt(clnt, msock);
if (res == RPC_SUCCESS)
- return 1;
+ return 0;
out_bad:
- return 0;
+ return 1;
}
u_int get_mntproto(const char *);
@@ -251,9 +251,6 @@ int add_mtab2(const char *spec, const ch
return 1;
}
-/*
- * Returns 1 if everything went well, else 0.
- */
int _nfsumount(const char *spec, const char *opts)
{
char *hostname;
@@ -309,8 +306,8 @@ int _nfsumount(const char *spec, const c
goto out_bad;
return nfs_call_umount(&mnt_server, &dirname);
out_bad:
- fprintf(stderr, "%s: %s: not found or not mounted\n", progname, spec);
- return 0;
+ fprintf(stderr, "%s: %s: not found / mounted or server not reachable\n", progname, spec);
+ return 1;
}
static struct option umount_longopts[] =
@@ -393,14 +390,18 @@ int nfsumount(int argc, char *argv[])
}
}
- ret = _nfsumount(mc->m.mnt_fsname, mc->m.mnt_opts);
- if(ret)
+ ret = 0;
+ if(!force && !lazy)
+ ret = _nfsumount(mc->m.mnt_fsname, mc->m.mnt_opts);
+ if(!ret)
ret = add_mtab2(mc->m.mnt_fsname, mc->m.mnt_dir,
mc->m.mnt_type, mc->m.mnt_opts, mc);
}
else {
- ret = _nfsumount(spec, NULL);
- if(ret)
+ ret = 0;
+ if(!force && !lazy)
+ ret = _nfsumount(spec, NULL);
+ if(!ret)
ret = add_mtab2(spec, spec, spec, spec, NULL);
}

View File

@ -1,495 +0,0 @@
--- /dev/null 2006-10-11 11:03:58.566320005 -0400
+++ nfs-utils-1.0.9/utils/mount/nfs.man 2006-10-16 08:31:02.204578000 -0400
@@ -0,0 +1,456 @@
+.\" nfs.5 "Rick Sladkey" <jrs@world.std.com>
+.\" Wed Feb 8 12:52:42 1995, faith@cs.unc.edu: updates for Ross Biro's
+.\" patches. "
+.TH NFS 5 "20 November 1993" "Linux 0.99" "Linux Programmer's Manual"
+.SH NAME
+nfs \- nfs and nfs4 fstab format and options
+.SH SYNOPSIS
+.B /etc/fstab
+.SH DESCRIPTION
+The
+.I fstab
+file contains information about which filesystems
+to mount where and with what options.
+For NFS mounts, it contains the server name and
+exported server directory to mount from,
+the local directory that is the mount point,
+and the NFS specific options that control
+the way the filesystem is mounted.
+.P
+Three different versions of the NFS protocol are
+supported by the Linux NFS client:
+NFS version 2, NFS version 3, and NFS version 4.
+To mount via NFS version 2, use the
+.BR nfs
+file system type and specify
+.BR nfsvers=2 .
+Version 2 is the default protocol version for the
+.BR nfs
+file system type when
+.BR nfsvers=
+is not specified on the mount command.
+To mount via NFS version 3, use the
+.BR nfs
+file system type and specify
+.BR nfsvers=3 .
+To mount via NFS version 4, use the
+.BR nfs4
+file system type.
+The
+.BR nfsvers=
+keyword is not supported for the
+.BR nfs4
+file system type.
+.P
+These file system types share similar mount options;
+the differences are listed below.
+.P
+Here is an example from an \fI/etc/fstab\fP file for an NFSv2 mount
+over UDP.
+.sp
+.nf
+.ta 2.5i +0.75i +0.75i +1.0i
+server:/usr/local/pub /pub nfs rsize=32768,wsize=32768,timeo=14,intr
+.fi
+.P
+Here is an example for an NFSv4 mount over TCP using Kerberos
+5 mutual authentication.
+.sp
+.nf
+.ta 2.5i +0.75i +0.75i +1.0i
+server:/usr/local/pub /pub nfs4 proto=tcp,sec=krb5,hard,intr
+.fi
+.DT
+.SS Options for the nfs file system type
+.TP 1.5i
+.I rsize=n
+The number of bytes NFS uses when reading files from an NFS server.
+The rsize is negotiated between the server and client to determine
+the largest block size that both can support.
+The value specified by this option is the maximum size that could
+be used; however, the actual size used may be smaller.
+Note: Setting this size to a value less than the largest supported
+block size will adversely affect performance.
+.TP 1.5i
+.I wsize=n
+The number of bytes NFS uses when writing files to an NFS server.
+The wsize is negotiated between the server and client to determine
+the largest block size that both can support.
+The value specified by this option is the maximum size that could
+be used; however, the actual size used may be smaller.
+Note: Setting this size to a value less than the largest supported
+block size will adversely affect performance.
+.TP 1.5i
+.I timeo=n
+The value in tenths of a second before sending the
+first retransmission after an RPC timeout.
+The default value is 7 tenths of a second. After the first timeout,
+the timeout is doubled after each successive timeout until a maximum
+timeout of 60 seconds is reached or the enough retransmissions
+have occured to cause a major timeout. Then, if the filesystem
+is hard mounted, each new timeout cascade restarts at twice the
+initial value of the previous cascade, again doubling at each
+retransmission. The maximum timeout is always 60 seconds.
+Better overall performance may be achieved by increasing the
+timeout when mounting on a busy network, to a slow server, or through
+several routers or gateways.
+.TP 1.5i
+.I retrans=n
+The number of minor timeouts and retransmissions that must occur before
+a major timeout occurs. The default is 3 timeouts. When a major timeout
+occurs, the file operation is either aborted or a "server not responding"
+message is printed on the console.
+.TP 1.5i
+.I acregmin=n
+The minimum time in seconds that attributes of a regular file should
+be cached before requesting fresh information from a server.
+The default is 3 seconds.
+.TP 1.5i
+.I acregmax=n
+The maximum time in seconds that attributes of a regular file can
+be cached before requesting fresh information from a server.
+The default is 60 seconds.
+.TP 1.5i
+.I acdirmin=n
+The minimum time in seconds that attributes of a directory should
+be cached before requesting fresh information from a server.
+The default is 30 seconds.
+.TP 1.5i
+.I acdirmax=n
+The maximum time in seconds that attributes of a directory can
+be cached before requesting fresh information from a server.
+The default is 60 seconds.
+.TP 1.5i
+.I actimeo=n
+Using actimeo sets all of
+.I acregmin,
+.I acregmax,
+.I acdirmin,
+and
+.I acdirmax
+to the same value.
+There is no default value.
+.TP 1.5i
+.I retry=n
+The number of minutes to retry an NFS mount operation
+in the foreground or background before giving up.
+The default value for forground mounts is 2 minutes.
+The default value for background mounts is 10000 minutes,
+which is roughly one week.
+.TP 1.5i
+.I namlen=n
+When an NFS server does not support version two of the
+RPC mount protocol, this option can be used to specify
+the maximum length of a filename that is supported on
+the remote filesystem. This is used to support the
+POSIX pathconf functions. The default is 255 characters.
+.TP 1.5i
+.I port=n
+The numeric value of the port to connect to the NFS server on.
+If the port number is 0 (the default) then query the
+remote host's portmapper for the port number to use.
+If the remote host's NFS daemon is not registered with
+its portmapper, the standard NFS port number 2049 is
+used instead.
+.TP 1.5i
+.I mountport=n
+The numeric value of the
+.B mountd
+port.
+.TP 1.5i
+.I mounthost=name
+The name of the host running
+.B mountd .
+.TP 1.5i
+.I mountprog=n
+Use an alternate RPC program number to contact the
+mount daemon on the remote host. This option is useful
+for hosts that can run multiple NFS servers.
+The default value is 100005 which is the standard RPC
+mount daemon program number.
+.TP 1.5i
+.I mountvers=n
+Use an alternate RPC version number to contact the
+mount daemon on the remote host. This option is useful
+for hosts that can run multiple NFS servers.
+The default value depends on which kernel you are using.
+.TP 1.5i
+.I nfsprog=n
+Use an alternate RPC program number to contact the
+NFS daemon on the remote host. This option is useful
+for hosts that can run multiple NFS servers.
+The default value is 100003 which is the standard RPC
+NFS daemon program number.
+.TP 1.5i
+.I nfsvers=n
+Use an alternate RPC version number to contact the
+NFS daemon on the remote host. This option is useful
+for hosts that can run multiple NFS servers.
+The default value depends on which kernel you are using.
+.TP 1.5i
+.I vers=n
+vers is an alternative to nfsvers and is compatible with
+many other operating systems.
+.TP 1.5i
+.I nolock
+Disable NFS locking. Do not start lockd.
+This has to be used with some old NFS servers
+that don't support locking.
+.TP 1.5i
+.I bg
+If the first NFS mount attempt times out, retry the mount
+in the background.
+After a mount operation is backgrounded, all subsequent mounts
+on the same NFS server will be backgrounded immediately, without
+first attempting the mount.
+A missing mount point is treated as a timeout,
+to allow for nested NFS mounts.
+.TP 1.5i
+.I fg
+If the first NFS mount attempt times out, retry the mount
+in the foreground.
+This is the complement of the
+.I bg
+option, and also the default behavior.
+.TP 1.5i
+.I soft
+If an NFS file operation has a major timeout then report an I/O error to
+the calling program.
+The default is to continue retrying NFS file operations indefinitely.
+.TP 1.5i
+.I hard
+If an NFS file operation has a major timeout then report
+"server not responding" on the console and continue retrying indefinitely.
+This is the default.
+.TP 1.5i
+.I intr
+If an NFS file operation has a major timeout and it is hard mounted,
+then allow signals to interupt the file operation and cause it to
+return EINTR to the calling program. The default is to not
+allow file operations to be interrupted.
+.TP 1.5i
+.I posix
+Mount the NFS filesystem using POSIX semantics. This allows
+an NFS filesystem to properly support the POSIX pathconf
+command by querying the mount server for the maximum length
+of a filename. To do this, the remote host must support version
+two of the RPC mount protocol. Many NFS servers support only
+version one.
+.TP 1.5i
+.I nocto
+Suppress the retrieval of new attributes when creating a file.
+.TP 1.5i
+.I noac
+Disable all forms of attribute caching entirely. This extracts a
+significant performance penalty but it allows two different NFS clients
+to get reasonable results when both clients are actively
+writing to a common export on the server.
+.TP 1.5i
+.I noacl
+Disables Access Control List (ACL) processing.
+.TP 1.5i
+.I sec=mode
+Set the security flavor for this mount to "mode".
+The default setting is \f3sec=sys\f1, which uses local
+unix uids and gids to authenticate NFS operations (AUTH_SYS).
+Other currently supported settings are:
+\f3sec=krb5\f1, which uses Kerberos V5 instead of local unix uids
+and gids to authenticate users;
+\f3sec=krb5i\f1, which uses Kerberos V5 for user authentication
+and performs integrity checking of NFS operations using secure
+checksums to prevent data tampering; and
+\f3sec=krb5p\f1, which uses Kerberos V5 for user authentication
+and integrity checking, and encrypts NFS traffic to prevent
+traffic sniffing (this is the most secure setting).
+Note that there is a performance penalty when using integrity
+or privacy.
+.TP 1.5i
+.I tcp
+Mount the NFS filesystem using the TCP protocol instead of the
+default UDP protocol. Many NFS servers only support UDP.
+.TP 1.5i
+.I udp
+Mount the NFS filesystem using the UDP protocol. This
+is the default.
+.P
+All of the non-value options have corresponding nooption forms.
+For example, nointr means don't allow file operations to be
+interrupted.
+.SS Options for the nfs4 file system type
+.TP 1.5i
+.I rsize=n
+The number of bytes nfs4 uses when reading files from the server.
+The rsize is negotiated between the server and client to determine
+the largest block size that both can support.
+The value specified by this option is the maximum size that could
+be used; however, the actual size used may be smaller.
+Note: Setting this size to a value less than the largest supported
+block size will adversely affect performance.
+.TP 1.5i
+.I wsize=n
+The number of bytes nfs4 uses when writing files to the server.
+The wsize is negotiated between the server and client to determine
+the largest block size that both can support.
+The value specified by this option is the maximum size that could
+be used; however, the actual size used may be smaller.
+Note: Setting this size to a value less than the largest supported
+block size will adversely affect performance.
+.TP 1.5i
+.I timeo=n
+The value in tenths of a second before sending the
+first retransmission after an RPC timeout.
+The default value depends on whether
+.IR proto=udp
+or
+.IR proto=tcp
+is in effect (see below).
+The default value for UDP is 7 tenths of a second.
+The default value for TCP is 60 seconds.
+After the first timeout,
+the timeout is doubled after each successive timeout until a maximum
+timeout of 60 seconds is reached or the enough retransmissions
+have occured to cause a major timeout. Then, if the filesystem
+is hard mounted, each new timeout cascade restarts at twice the
+initial value of the previous cascade, again doubling at each
+retransmission. The maximum timeout is always 60 seconds.
+.TP 1.5i
+.I retrans=n
+The number of minor timeouts and retransmissions that must occur before
+a major timeout occurs. The default is 5 timeouts for
+.IR proto=udp
+and 2 timeouts for
+.IR proto=tcp .
+When a major timeout
+occurs, the file operation is either aborted or a "server not responding"
+message is printed on the console.
+.TP 1.5i
+.I acregmin=n
+The minimum time in seconds that attributes of a regular file should
+be cached before requesting fresh information from a server.
+The default is 3 seconds.
+.TP 1.5i
+.I acregmax=n
+The maximum time in seconds that attributes of a regular file can
+be cached before requesting fresh information from a server.
+The default is 60 seconds.
+.TP 1.5i
+.I acdirmin=n
+The minimum time in seconds that attributes of a directory should
+be cached before requesting fresh information from a server.
+The default is 30 seconds.
+.TP 1.5i
+.I acdirmax=n
+The maximum time in seconds that attributes of a directory can
+be cached before requesting fresh information from a server.
+The default is 60 seconds.
+.TP 1.5i
+.I actimeo=n
+Using actimeo sets all of
+.I acregmin,
+.I acregmax,
+.I acdirmin,
+and
+.I acdirmax
+to the same value.
+There is no default value.
+.TP 1.5i
+.I retry=n
+The number of minutes to retry an NFS mount operation
+in the foreground or background before giving up.
+The default value for forground mounts is 2 minutes.
+The default value for background mounts is 10000 minutes,
+which is roughly one week.
+.TP 1.5i
+.I port=n
+The numeric value of the port to connect to the NFS server on.
+If the port number is 0 (the default) then query the
+remote host's portmapper for the port number to use.
+If the remote host's NFS daemon is not registered with
+its portmapper, the standard NFS port number 2049 is
+used instead.
+.TP 1.5i
+.I proto=n
+Mount the NFS filesystem using a specific network protocol
+instead of the default UDP protocol.
+Many NFS version 4 servers only support TCP.
+Valid protocol types are
+.IR udp
+and
+.IR tcp .
+.TP 1.5i
+.I clientaddr=n
+On a multi-homed client, this
+causes the client to use a specific callback address when
+communicating with an NFS version 4 server.
+This option is currently ignored.
+.TP 1.5i
+.I sec=mode
+Same as \f3sec=mode\f1 for the nfs filesystem type (see above).
+.TP 1.5i
+.I bg
+If an NFS mount attempt times out, retry the mount
+in the background.
+After a mount operation is backgrounded, all subsequent mounts
+on the same NFS server will be backgrounded immediately, without
+first attempting the mount.
+A missing mount point is treated as a timeout,
+to allow for nested NFS mounts.
+.TP 1.5i
+.I fg
+If the first NFS mount attempt times out, retry the mount
+in the foreground.
+This is the complement of the
+.I bg
+option, and also the default behavior.
+.TP 1.5i
+.I soft
+If an NFS file operation has a major timeout then report an I/O error to
+the calling program.
+The default is to continue retrying NFS file operations indefinitely.
+.TP 1.5i
+.I hard
+If an NFS file operation has a major timeout then report
+"server not responding" on the console and continue retrying indefinitely.
+This is the default.
+.TP 1.5i
+.I intr
+If an NFS file operation has a major timeout and it is hard mounted,
+then allow signals to interupt the file operation and cause it to
+return EINTR to the calling program. The default is to not
+allow file operations to be interrupted.
+.TP 1.5i
+.I nocto
+Suppress the retrieval of new attributes when creating a file.
+.TP 1.5i
+.I noac
+Disable attribute caching, and force synchronous writes.
+This extracts a
+server performance penalty but it allows two different NFS clients
+to get reasonable good results when both clients are actively
+writing to common filesystem on the server.
+.P
+All of the non-value options have corresponding nooption forms.
+For example, nointr means don't allow file operations to be
+interrupted.
+.SH FILES
+.I /etc/fstab
+.SH "SEE ALSO"
+.BR fstab "(5), " mount "(8), " umount "(8), " exports (5)
+.SH AUTHOR
+"Rick Sladkey" <jrs@world.std.com>
+.SH BUGS
+The posix, and nocto options are parsed by mount
+but currently are silently ignored.
+.P
+The tcp and namlen options are implemented but are not currently
+supported by the Linux kernel.
+.P
+The umount command should notify the server
+when an NFS filesystem is unmounted.
+.P
+Checking files on NFS filesystem referenced by file descriptors (i.e. the
+.BR fcntl
+and
+.BR ioctl
+families of functions) may lead to inconsistent result due to the lack of
+consistency check in kernel even if noac is used.
--- nfs-utils-1.0.9/utils/mount/Makefile.am.orig 2006-10-16 08:29:34.790243000 -0400
+++ nfs-utils-1.0.9/utils/mount/Makefile.am 2006-10-16 08:30:32.594308000 -0400
@@ -1,9 +1,10 @@
## Process this file with automake to produce Makefile.in
man8_MANS = mount.nfs.man umount.nfs.man
+man5_MANS = nfs.man
sbin_PROGRAMS = mount.nfs
-EXTRA_DIST = nfsmount.x $(man8_MANS)
+EXTRA_DIST = nfsmount.x $(man8_MANS) $(man5_MANS)
mount_nfs_SOURCES = mount.c nfsmount.c nfs4mount.c nfsumount.c \
mount_constants.h nfs4_mount.h nfs_mount4.h
@@ -29,6 +30,11 @@ install-man-links:
inst=`echo $$m | sed -e 's/man$$/8/'`; \
rm -f $$inst ; \
done)
+ (cd $(DESTDIR)$(man5dir) && \
+ for m in $(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS); do \
+ inst=`echo $$m | sed -e 's/man$$/5/'`; \
+ rm -f $$inst ; \
+ done)
uninstall-man-links:
(cd $(DESTDIR)$(man8dir) && \
@@ -36,4 +42,9 @@ uninstall-man-links:
inst=`echo $$m | sed -e 's/man$$/8/'`; \
rm -f $$inst ; \
done)
+ (cd $(DESTDIR)$(man5dir) && \
+ for m in $(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS); do \
+ inst=`echo $$m | sed -e 's/man$$/5/'`; \
+ rm -f $$inst ; \
+ done)

View File

@ -1,447 +0,0 @@
--- nfs-utils-1.0.9/support/include/fstab.h.orig 2006-07-07 20:04:32.000000000 -0400
+++ nfs-utils-1.0.9/support/include/fstab.h 2006-07-28 11:07:24.000000000 -0400
@@ -3,6 +3,10 @@
#include "nfs_mntent.h"
+#ifndef _PATH_FSTAB
+#define _PATH_FSTAB "/etc/fstab"
+#endif
+
int mtab_is_writable(void);
int mtab_does_not_exist(void);
@@ -16,6 +20,10 @@ struct mntentchn *getmntoptfile (const c
struct mntentchn *getmntdirbackward (const char *dir, struct mntentchn *mc);
struct mntentchn *getmntdevbackward (const char *dev, struct mntentchn *mc);
+struct mntentchn *fstab_head (void);
+struct mntentchn *getfsfile (const char *file);
+struct mntentchn *getfsspec (const char *spec);
+
void lock_mtab (void);
void unlock_mtab (void);
void update_mtab (const char *special, nfs_mntent_t *with);
--- nfs-utils-1.0.9/support/include/nfs_mntent.h.orig 2006-07-07 20:04:32.000000000 -0400
+++ nfs-utils-1.0.9/support/include/nfs_mntent.h 2006-07-28 11:07:24.000000000 -0400
@@ -7,10 +7,10 @@
#define _NFS_MNTENT_H
typedef struct nfs_mntent_s {
- const char *mnt_fsname;
- const char *mnt_dir;
- const char *mnt_type;
- const char *mnt_opts;
+ char *mnt_fsname;
+ char *mnt_dir;
+ char *mnt_type;
+ char *mnt_opts;
int mnt_freq;
int mnt_passno;
} nfs_mntent_t;
--- nfs-utils-1.0.9/support/nfs/fstab.c.orig 2006-07-07 20:04:32.000000000 -0400
+++ nfs-utils-1.0.9/support/nfs/fstab.c 2006-07-28 11:07:24.000000000 -0400
@@ -78,10 +78,10 @@ mtab_is_writable() {
/* Contents of mtab and fstab ---------------------------------*/
-struct mntentchn mounttable;
-static int got_mtab = 0;
+struct mntentchn mounttable, fstab;
+static int got_mtab = 0, got_fstab = 0;
-static void read_mounttable(void);
+static void read_mounttable(void), read_fstab(void);
struct mntentchn *
mtab_head() {
@@ -96,6 +96,13 @@ my_free(const void *s) {
free((void *) s);
}
+struct mntentchn *
+fstab_head() {
+ if (!got_fstab)
+ read_fstab();
+ return &fstab;
+}
+
static void
discard_mntentchn(struct mntentchn *mc0) {
struct mntentchn *mc, *mc1;
@@ -167,6 +174,26 @@ read_mounttable() {
read_mntentchn(mfp, fnam, mc);
}
+static void
+read_fstab() {
+ mntFILE *mfp = NULL;
+ const char *fnam;
+ struct mntentchn *mc = &fstab;
+
+ got_fstab = 1;
+ mc->nxt = mc->prev = NULL;
+
+ fnam = _PATH_FSTAB;
+ mfp = nfs_setmntent (fnam, "r");
+ if (mfp == NULL || mfp->mntent_fp == NULL) {
+ int errsv = errno;
+ error(_("warning: can't open %s: %s"),
+ _PATH_FSTAB, strerror (errsv));
+ return;
+ }
+ read_mntentchn(mfp, fnam, mc);
+}
+
/*
* Given the directory name NAME, and the place MCPREV we found it last time,
* try to find more occurrences.
@@ -201,6 +228,30 @@ getmntdevbackward (const char *name, str
return NULL;
}
+/* Find the dir FILE in fstab. */
+struct mntentchn *
+getfsfile (const char *file) {
+ struct mntentchn *mc, *mc0;
+
+ mc0 = fstab_head();
+ for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt)
+ if (streq(mc->m.mnt_dir, file))
+ return mc;
+ return NULL;
+}
+
+/* Find the device SPEC in fstab. */
+struct mntentchn *
+getfsspec (const char *spec) {
+ struct mntentchn *mc, *mc0;
+
+ mc0 = fstab_head();
+ for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt)
+ if (streq(mc->m.mnt_fsname, spec))
+ return mc;
+ return NULL;
+}
+
/* Updating mtab ----------------------------------------------*/
/* Flag for already existing lock file. */
--- nfs-utils-1.0.9/utils/mount/Makefile.am.orig 2006-07-07 20:04:32.000000000 -0400
+++ nfs-utils-1.0.9/utils/mount/Makefile.am 2006-07-28 11:09:31.000000000 -0400
@@ -14,9 +14,10 @@ MAINTAINERCLEANFILES = Makefile.in
install-exec-hook:
(cd $(DESTDIR)$(sbindir) && \
- ln -sf $(sbin_PROGRAMS) mount.nfs4 && \
- ln -sf $(sbin_PROGRAMS) umount.nfs && \
- ln -sf $(sbin_PROGRAMS) umount.nfs4)
+ chmod +s $(sbin_PROGRAMS) && \
+ cp -p $(sbin_PROGRAMS) $(DESTDIR)$(sbindir)/mount.nfs4 && \
+ cp -p $(sbin_PROGRAMS) $(DESTDIR)$(sbindir)/umount.nfs && \
+ cp -p $(sbin_PROGRAMS) $(DESTDIR)$(sbindir)/umount.nfs4)
uninstall-hook:
(cd $(DESTDIR)$(sbindir) && \
rm -f mount.nfs4 umount.nfs umount.nfs4)
--- nfs-utils-1.0.9/utils/mount/mount.c.orig 2006-07-07 20:04:32.000000000 -0400
+++ nfs-utils-1.0.9/utils/mount/mount.c 2006-07-28 11:07:24.000000000 -0400
@@ -28,6 +28,7 @@
#include <sys/mount.h>
#include <getopt.h>
#include <mntent.h>
+#include <pwd.h>
#include "fstab.h"
#include "xcommon.h"
@@ -74,6 +75,12 @@ struct opt_map {
int mask; /* flag mask value */
};
+/* Custom mount options for our own purposes. */
+/* Maybe these should now be freed for kernel use again */
+#define MS_DUMMY 0x00000000
+#define MS_USERS 0x40000000
+#define MS_USER 0x20000000
+
static const struct opt_map opt_map[] = {
{ "defaults", 0, 0, 0 }, /* default options */
{ "ro", 1, 0, MS_RDONLY }, /* read-only */
@@ -90,6 +97,18 @@ static const struct opt_map opt_map[] =
{ "remount", 0, 0, MS_REMOUNT}, /* Alter flags of mounted FS */
{ "bind", 0, 0, MS_BIND }, /* Remount part of tree elsewhere */
{ "rbind", 0, 0, MS_BIND|MS_REC }, /* Idem, plus mounted subtrees */
+ { "auto", 0, 0, MS_DUMMY }, /* Can be mounted using -a */
+ { "noauto", 0, 0, MS_DUMMY }, /* Can only be mounted explicitly */
+ { "users", 0, 0, MS_USERS }, /* Allow ordinary user to mount */
+ { "nousers", 0, 1, MS_USERS }, /* Forbid ordinary user to mount */
+ { "user", 0, 0, MS_USER }, /* Allow ordinary user to mount */
+ { "nouser", 0, 1, MS_USER }, /* Forbid ordinary user to mount */
+ { "owner", 0, 0, MS_DUMMY }, /* Let the owner of the device mount */
+ { "noowner", 0, 0, MS_DUMMY }, /* Device owner has no special privs */
+ { "group", 0, 0, MS_DUMMY }, /* Let the group of the device mount */
+ { "nogroup", 0, 0, MS_DUMMY }, /* Device group has no special privs */
+ { "_netdev", 0, 0, MS_DUMMY}, /* Device requires network */
+ { "comment", 0, 0, MS_DUMMY}, /* fstab comment only (kudzu,_netdev)*/
/* add new options here */
#ifdef MS_NOSUB
@@ -104,6 +123,7 @@ static const struct opt_map opt_map[] =
{ "mand", 0, 0, MS_MANDLOCK }, /* Allow mandatory locks on this FS */
{ "nomand", 0, 1, MS_MANDLOCK }, /* Forbid mandatory locks on this FS */
#endif
+ { "loop", 1, 0, MS_DUMMY }, /* use a loop device */
#ifdef MS_NOATIME
{ "atime", 0, 1, MS_NOATIME }, /* Update access time */
{ "noatime", 0, 0, MS_NOATIME }, /* Do not update access time */
@@ -121,6 +141,12 @@ static char * fix_opts_string (int flags
char *new_opts;
new_opts = xstrdup((flags & MS_RDONLY) ? "ro" : "rw");
+ if (flags & MS_USER) {
+ struct passwd *pw = getpwuid(getuid());
+ if(pw)
+ new_opts = xstrconcat3(new_opts, ",user=", pw->pw_name);
+ }
+
for (om = opt_map; om->opt != NULL; om++) {
if (om->skip)
continue;
@@ -132,9 +158,20 @@ static char * fix_opts_string (int flags
if (extra_opts && *extra_opts) {
new_opts = xstrconcat3(new_opts, ",", extra_opts);
}
+
return new_opts;
}
+void copy_mntent(struct mntent *ment, nfs_mntent_t *nment)
+{
+ /* Not sure why nfs_mntent_t should exist */
+ strcpy(nment->mnt_fsname, ment->mnt_fsname);
+ strcpy(nment->mnt_dir, ment->mnt_dir);
+ strcpy(nment->mnt_type, ment->mnt_type);
+ strcpy(nment->mnt_opts, ment->mnt_opts);
+ nment->mnt_freq = ment->mnt_freq;
+ nment->mnt_passno = ment->mnt_passno;
+}
int add_mtab(char *fsname, char *mount_point, char *fstype, int flags, char *opts, int freq, int passno)
{
@@ -146,8 +183,16 @@ int add_mtab(char *fsname, char *mount_p
ment.mnt_dir = mount_point;
ment.mnt_type = fstype;
ment.mnt_opts = fix_opts_string(flags, opts);
- ment.mnt_freq = 0;
- ment.mnt_passno= 0;
+ ment.mnt_freq = freq;
+ ment.mnt_passno= passno;
+
+ if(flags & MS_REMOUNT) {
+ nfs_mntent_t nment;
+
+ copy_mntent(&ment, &nment);
+ update_mtab(nment.mnt_dir, &nment);
+ return 0;
+ }
if ((fd = open(MOUNTED"~", O_RDWR|O_CREAT|O_EXCL, 0600)) == -1) {
fprintf(stderr, "Can't get "MOUNTED"~ lock file");
@@ -242,20 +287,56 @@ static void parse_opts (const char *opti
}
+/*
+ * Look for an option in a comma-separated list
+ */
+int
+contains(const char *list, const char *s) {
+ int n = strlen(s);
+
+ while (*list) {
+ if (strncmp(list, s, n) == 0 &&
+ (list[n] == 0 || list[n] == ','))
+ return 1;
+ while (*list && *list++ != ',') ;
+ }
+ return 0;
+}
+
+/*
+ * If list contains "user=peter" and we ask for "user=", return "peter"
+ */
+char *
+get_value(const char *list, const char *s) {
+ const char *t;
+ int n = strlen(s);
+
+ while (*list) {
+ if (strncmp(list, s, n) == 0) {
+ s = t = list+n;
+ while (*s && *s != ',')
+ s++;
+ return xstrndup(t, s-t);
+ }
+ while (*list && *list++ != ',') ;
+ }
+ return 0;
+}
+
static void mount_error(char *node)
{
switch(errno) {
case ENOTDIR:
- printf("%s: mount point %s is not a directory\n", progname, node);
+ fprintf(stderr, "%s: mount point %s is not a directory\n", progname, node);
break;
case EBUSY:
- printf("%s: %s is already mounted or busy\n", progname, node);
+ fprintf(stderr, "%s: %s is already mounted or busy\n", progname, node);
break;
case ENOENT:
- printf("%s: mount point %s does not exist\n", progname, node);
+ fprintf(stderr, "%s: mount point %s does not exist\n", progname, node);
break;
default:
- printf("%s: %s\n", progname, strerror(errno));
+ fprintf(stderr, "%s: %s\n", progname, strerror(errno));
}
}
@@ -264,16 +345,13 @@ int main(int argc, char *argv[])
int c, flags = 0, nfs_mount_vers = 0, mnt_err = 1, fake = 0;
char *spec, *mount_point, *extra_opts = NULL;
char *mount_opts = NULL, *p;
+ struct mntentchn *mc;
+ uid_t uid = getuid();
progname = argv[0];
if ((p = strrchr(progname, '/')) != NULL)
progname = p+1;
- if (getuid() != 0) {
- printf("%s: only root can do that.\n", progname);
- exit(1);
- }
-
if(!strncmp(progname, "umount", strlen("umount"))) {
if(argc < 2) {
umount_usage();
@@ -355,9 +433,33 @@ int main(int argc, char *argv[])
spec = argv[1];
mount_point = canonicalize(argv[2]);
-
+
parse_opts(mount_opts, &flags, &extra_opts);
+ if (uid != 0 && !(flags & MS_USERS) && !(flags & MS_USER)) {
+ fprintf(stderr, "%s: permission denied\n", progname);
+ exit(1);
+ }
+
+ if ((flags & MS_USER || flags & MS_USERS) && uid != 0) {
+ /* check if fstab has entry, and further see if the user or users option is given */
+ if ((mc = getfsspec(spec)) == NULL &&
+ (mc = getfsfile(spec)) == NULL) {
+ fprintf(stderr, "%s: permission denied - invalid option\n", progname);
+ exit(1);
+ }
+ else {
+ if((flags & MS_USER) && !contains(mc->m.mnt_opts, "user")) {
+ fprintf(stderr, "%s: permission denied - invalid option\n", progname);
+ exit(1);
+ }
+ if((flags & MS_USERS) && !contains(mc->m.mnt_opts, "users")) {
+ fprintf(stderr, "%s: permission denied - invalid option\n", progname);
+ exit(1);
+ }
+ }
+ }
+
if (!strcmp(progname, "mount.nfs4") || nfs_mount_vers == 4) {
nfs_mount_vers = 4;
mnt_err = nfs4mount(spec, mount_point, &flags, &extra_opts, &mount_opts, 0);
@@ -370,16 +472,19 @@ int main(int argc, char *argv[])
}
if (!mnt_err && !fake) {
- mnt_err = do_mount_syscall(spec, mount_point, nfs_mount_vers == 4 ? "nfs4" : "nfs", flags, mount_opts);
+ if(!(flags & MS_REMOUNT)) {
+ mnt_err = do_mount_syscall(spec, mount_point,
+ nfs_mount_vers == 4 ? "nfs4" : "nfs", flags, mount_opts);
- if(mnt_err) {
- mount_error(mount_point);
- exit(-1);
+ if(mnt_err) {
+ mount_error(mount_point);
+ exit(-1);
+ }
}
-
- if(!nomtab)
+ if(!nomtab) {
add_mtab(spec, mount_point, nfs_mount_vers == 4 ? "nfs4" : "nfs",
flags, extra_opts, 0, 0);
+ }
}
return 0;
--- nfs-utils-1.0.9/utils/mount/nfs_mount.h.orig 2006-07-07 20:04:32.000000000 -0400
+++ nfs-utils-1.0.9/utils/mount/nfs_mount.h 2006-07-28 11:07:24.000000000 -0400
@@ -80,5 +80,7 @@ struct nfs_mount_data {
int nfsmount(const char *, const char *, int *, char **, char **, int *, int);
void mount_errors(char *, int, int);
+int contains(const char *, const char *);
+char *get_value(const char *, const char *);
#endif /* _NFS_MOUNT_H */
--- nfs-utils-1.0.9/utils/mount/nfsumount.c.orig 2006-07-07 20:04:32.000000000 -0400
+++ nfs-utils-1.0.9/utils/mount/nfsumount.c 2006-07-28 11:07:24.000000000 -0400
@@ -23,12 +23,14 @@
#include <mntent.h>
#include <sys/mount.h>
#include <ctype.h>
+#include <pwd.h>
#include "xcommon.h"
#include "fstab.h"
#include "nls.h"
#include "conn.h"
+#include "nfs_mount.h"
#include "mount_constants.h"
#include "mount.h"
#include "nfsumount.h"
@@ -307,7 +309,7 @@ int _nfsumount(const char *spec, const c
goto out_bad;
return nfs_call_umount(&mnt_server, &dirname);
out_bad:
- printf("%s: %s: not found or not mounted\n", progname, spec);
+ fprintf(stderr, "%s: %s: not found or not mounted\n", progname, spec);
return 0;
}
@@ -376,6 +378,21 @@ int nfsumount(int argc, char *argv[])
printf(_("Could not find %s in mtab\n"), spec);
if(mc) {
+ if(contains(mc->m.mnt_opts, "user") && getuid() != 0) {
+ struct passwd *pw = getpwuid(getuid());
+ if(!pw || strcmp(pw->pw_name, get_value(mc->m.mnt_opts, "user="))) {
+ fprintf(stderr, "%s: permission denied to unmount %s\n",
+ progname, spec);
+ exit(1);
+ }
+ } else {
+ if(!contains(mc->m.mnt_opts, "users") && getuid() != 0) {
+ fprintf(stderr, "%s: only root can unmount %s from %s\n",
+ progname, mc->m.mnt_fsname, mc->m.mnt_dir);
+ exit(1);
+ }
+ }
+
ret = _nfsumount(mc->m.mnt_fsname, mc->m.mnt_opts);
if(ret)
ret = add_mtab2(mc->m.mnt_fsname, mc->m.mnt_dir,

View File

@ -1,109 +0,0 @@
Thi patch avoid the collision between commas in security contexts and the
delimiter betweeen mount options.
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Cory Olmo <colmo@TrustedCS.com>
--- nfs-utils-1.0.9/utils/mount/nfsmount.c.kzak 2006-12-18 23:52:37.000000000 +0100
+++ nfs-utils-1.0.9/utils/mount/nfsmount.c 2006-12-18 23:59:34.000000000 +0100
@@ -548,15 +548,31 @@
struct pmap *mnt_pmap = &mnt_server->pmap;
struct pmap *nfs_pmap = &nfs_server->pmap;
int len;
- char *opt, *opteq;
+ char *opt, *opteq, *p, *opt_b;
char *mounthost = NULL;
char cbuf[128];
+ int open_quote = 0;
data->flags = 0;
*bg = 0;
len = strlen(new_opts);
- for (opt = strtok(old_opts, ","); opt; opt = strtok(NULL, ",")) {
+ for (p=old_opts, opt_b=NULL; p && *p; p++) {
+ if (!opt_b)
+ opt_b = p; /* begin of the option item */
+ if (*p == '"')
+ open_quote ^= 1; /* reverse the status */
+ if (open_quote)
+ continue; /* still in quoted block */
+ if (*p == ',')
+ *p = '\0'; /* terminate the option item */
+ if (*p == '\0' || *(p+1) == '\0') {
+ opt = opt_b; /* opt is useful now */
+ opt_b = NULL;
+ }
+ else
+ continue; /* still somewhere in the option item */
+
if (strlen(opt) >= sizeof(cbuf))
goto bad_parameter;
if ((opteq = strchr(opt, '=')) && isdigit(opteq[1])) {
@@ -671,13 +687,23 @@
strcspn(opteq+1," \t\n\r,"));
else if (!strcmp(opt, "context")) {
char *context = opteq + 1;
+ int ctxlen = strlen(context);
- if (strlen(context) > NFS_MAX_CONTEXT_LEN) {
+ if (ctxlen > NFS_MAX_CONTEXT_LEN) {
printf(_("context parameter exceeds limit of %d\n"),
NFS_MAX_CONTEXT_LEN);
goto bad_parameter;
}
- strncpy(data->context, context, NFS_MAX_CONTEXT_LEN);
+ /* The context string is in the format of
+ * "system_u:object_r:...". We only want
+ * the context str between the quotes.
+ */
+ if (*context == '"')
+ strncpy(data->context, context+1,
+ ctxlen-2);
+ else
+ strncpy(data->context, context,
+ NFS_MAX_CONTEXT_LEN);
} else if (!sloppy)
goto bad_parameter;
sprintf(cbuf, "%s=%s,", opt, opteq+1);
--- nfs-utils-1.0.9/utils/mount/mount.c.kzak 2006-12-18 23:52:37.000000000 +0100
+++ nfs-utils-1.0.9/utils/mount/mount.c 2006-12-18 23:52:37.000000000 +0100
@@ -289,18 +289,30 @@
{
if (options != NULL) {
char *opts = xstrdup(options);
- char *opt;
- int len = strlen(opts) + 20;
-
+ char *opt, *p;
+ int len = strlen(opts) + 256;
+ int open_quote = 0;
+
*extra_opts = xmalloc(len);
**extra_opts = '\0';
- for (opt = strtok(opts, ","); opt; opt = strtok(NULL, ","))
- parse_opt(opt, flags, *extra_opts, len);
-
+ for (p=opts, opt=NULL; p && *p; p++) {
+ if (!opt)
+ opt = p; /* begin of the option item */
+ if (*p == '"')
+ open_quote ^= 1; /* reverse the status */
+ if (open_quote)
+ continue; /* still in quoted block */
+ if (*p == ',')
+ *p = '\0'; /* terminate the option item */
+ /* end of option item or last item */
+ if (*p == '\0' || *(p+1) == '\0') {
+ parse_opt(opt, flags, *extra_opts, len);
+ opt = NULL;
+ }
+ }
free(opts);
}
-
}
/*

View File

@ -1,114 +0,0 @@
--- nfs-utils-1.0.9/utils/mount/mount.c.orig 2006-10-25 10:52:32.000000000 -0400
+++ nfs-utils-1.0.9/utils/mount/mount.c 2006-10-25 12:09:52.000000000 -0400
@@ -163,16 +163,29 @@ static char * fix_opts_string (int flags
return new_opts;
}
-void copy_mntent(struct mntent *ment, nfs_mntent_t *nment)
+static inline void dup_mntent(struct mntent *ment, nfs_mntent_t *nment)
{
/* Not sure why nfs_mntent_t should exist */
- strcpy(nment->mnt_fsname, ment->mnt_fsname);
- strcpy(nment->mnt_dir, ment->mnt_dir);
- strcpy(nment->mnt_type, ment->mnt_type);
- strcpy(nment->mnt_opts, ment->mnt_opts);
+ nment->mnt_fsname = strdup(ment->mnt_fsname);
+ nment->mnt_dir = strdup(ment->mnt_dir);
+ nment->mnt_type = strdup(ment->mnt_type);
+ nment->mnt_opts = strdup(ment->mnt_opts);
nment->mnt_freq = ment->mnt_freq;
nment->mnt_passno = ment->mnt_passno;
}
+static inline void
+free_mntent(struct mntent *ment, int remount)
+{
+ free(ment->mnt_fsname);
+ free(ment->mnt_dir);
+ free(ment->mnt_type);
+ /*
+ * Note: free(ment->mnt_opts) happens in discard_mntentchn()
+ * via update_mtab() on remouts
+ */
+ if (!remount)
+ free(ment->mnt_opts);
+}
int add_mtab(char *fsname, char *mount_point, char *fstype, int flags, char *opts, int freq, int passno)
{
@@ -190,8 +203,9 @@ int add_mtab(char *fsname, char *mount_p
if(flags & MS_REMOUNT) {
nfs_mntent_t nment;
- copy_mntent(&ment, &nment);
+ dup_mntent(&ment, &nment);
update_mtab(nment.mnt_dir, &nment);
+ free_mntent(&nment, 1);
return 0;
}
@@ -341,10 +355,11 @@ static void mount_error(char *node)
fprintf(stderr, "%s: %s\n", progname, strerror(errno));
}
}
+#define NFS_MOUNT_VERS_DEFAULT 3
int main(int argc, char *argv[])
{
- int c, flags = 0, nfs_mount_vers = 0, mnt_err = 1, fake = 0;
+ int c, flags = 0, nfs_mount_vers, mnt_err = 1, fake = 0;
char *spec, *mount_point, *extra_opts = NULL;
char *mount_opts = NULL, *p;
struct mntentchn *mc;
@@ -375,6 +390,10 @@ int main(int argc, char *argv[])
return 0;
}
+ nfs_mount_vers = NFS_MOUNT_VERS_DEFAULT;
+ if (!strcmp(progname, "mount.nfs4"))
+ nfs_mount_vers = 4;
+
while ((c = getopt_long (argc - 2, argv + 2, "rt:vVwfno:hs",
longopts, NULL)) != -1) {
switch (c) {
@@ -465,9 +484,9 @@ int main(int argc, char *argv[])
}
}
- if (!strcmp(progname, "mount.nfs4") || nfs_mount_vers == 4) {
- nfs_mount_vers = 4;
- mnt_err = nfs4mount(spec, mount_point, &flags, &extra_opts, &mount_opts, 0);
+ if (nfs_mount_vers == 4) {
+ mnt_err = nfs4mount(spec, mount_point, &flags,
+ &extra_opts, &mount_opts, 0);
}
else {
if (!strcmp(progname, "mount.nfs")) {
@@ -475,21 +494,19 @@ int main(int argc, char *argv[])
&extra_opts, &mount_opts, &nfs_mount_vers, 0);
}
}
-
if (fake)
return 0;
if (mnt_err)
exit(EX_FAIL);
- if(!(flags & MS_REMOUNT)) {
- mnt_err = do_mount_syscall(spec, mount_point,
- nfs_mount_vers == 4 ? "nfs4" : "nfs", flags, mount_opts);
-
- if(mnt_err) {
- mount_error(mount_point);
- exit(EX_FAIL);
- }
+ mnt_err = do_mount_syscall(spec, mount_point,
+ nfs_mount_vers == 4 ? "nfs4" : "nfs", flags, mount_opts);
+
+ if(mnt_err) {
+ mount_error(mount_point);
+ exit(EX_FAIL);
}
+
if(!nomtab) {
add_mtab(spec, mount_point, nfs_mount_vers == 4 ? "nfs4" : "nfs",
flags, extra_opts, 0, 0);

View File

@ -1,124 +0,0 @@
--- nfs-utils-1.0.9/utils/mount/nfs4mount.c.sloppy 2006-09-20 12:08:39.000000000 +0200
+++ nfs-utils-1.0.9/utils/mount/nfs4mount.c 2006-09-20 12:08:39.000000000 +0200
@@ -50,6 +50,7 @@
#endif
extern int verbose;
+extern int sloppy;
char *IDMAPLCK = DEFAULT_DIR "/rpcidmapd";
#define idmapd_check() do { \
@@ -338,7 +339,7 @@
nocto = !val;
else if (!strcmp(opt, "ac"))
noac = !val;
- else {
+ else if (!sloppy) {
printf(_("unknown nfs mount option: "
"%s%s\n"), val ? "" : "no", opt);
goto fail;
--- nfs-utils-1.0.9/utils/mount/mount.c.sloppy 2006-09-20 12:08:39.000000000 +0200
+++ nfs-utils-1.0.9/utils/mount/mount.c 2006-09-20 12:10:31.000000000 +0200
@@ -44,6 +44,7 @@
int nomtab;
int verbose;
int mounttype;
+int sloppy;
static struct option longopts[] = {
{ "fake", 0, 0, 'f' },
@@ -239,6 +240,7 @@
printf("\t-w\t\tMount file system read-write\n");
printf("\t-f\t\tFake mount, don't actually mount\n");
printf("\t-n\t\tDo not update /etc/mtab\n");
+ printf("\t-s\t\tTolerate sloppy mount options rather than failing.\n");
printf("\t-h\t\tPrint this help\n");
printf("\tversion\t\tnfs4 - NFS version 4, nfs - older NFS version supported\n");
printf("\tnfsoptions\tRefer mount.nfs(8) or nfs(5)\n\n");
@@ -373,7 +375,7 @@
return 0;
}
- while ((c = getopt_long (argc - 2, argv + 2, "rt:vVwfno:h",
+ while ((c = getopt_long (argc - 2, argv + 2, "rt:vVwfno:hs",
longopts, NULL)) != -1) {
switch (c) {
case 'r':
@@ -403,6 +405,9 @@
else
mount_opts = xstrdup(optarg);
break;
+ case 's':
+ ++sloppy;
+ break;
case 128: /* bind */
mounttype = MS_BIND;
break;
--- nfs-utils-1.0.9/utils/mount/nfsmount.c.sloppy 2006-09-20 12:08:39.000000000 +0200
+++ nfs-utils-1.0.9/utils/mount/nfsmount.c 2006-09-20 12:08:39.000000000 +0200
@@ -104,6 +104,7 @@
static char errbuf[BUFSIZ];
static char *erreob = &errbuf[BUFSIZ];
extern int verbose;
+extern int sloppy;
/* Convert RPC errors into strings */
int rpc_strerror(int);
@@ -606,13 +607,13 @@
} else if (!strcmp(opt, "namlen")) {
if (nfs_mount_version >= 2)
data->namlen = val;
- else
+ else if (!sloppy)
goto bad_parameter;
#endif
} else if (!strcmp(opt, "addr")) {
/* ignore */;
continue;
- } else
+ } else if (!sloppy)
goto bad_parameter;
sprintf(cbuf, "%s=%s,", opt, opteq+1);
} else if (opteq) {
@@ -629,7 +630,7 @@
mnt_pmap->pm_prot = IPPROTO_TCP;
data->flags |= NFS_MOUNT_TCP;
#endif
- } else
+ } else if (!sloppy)
goto bad_parameter;
#if NFS_MOUNT_VERSION >= 5
} else if (!strcmp(opt, "sec")) {
@@ -658,7 +659,7 @@
data->pseudoflavor = AUTH_GSS_SPKMI;
else if (!strcmp(secflavor, "spkm3p"))
data->pseudoflavor = AUTH_GSS_SPKMP;
- else {
+ else if (!sloppy) {
printf(_("Warning: Unrecognized security flavor %s.\n"),
secflavor);
goto bad_parameter;
@@ -677,7 +678,7 @@
goto bad_parameter;
}
strncpy(data->context, context, NFS_MAX_CONTEXT_LEN);
- } else
+ } else if (!sloppy)
goto bad_parameter;
sprintf(cbuf, "%s=%s,", opt, opteq+1);
} else {
@@ -768,9 +769,11 @@
#endif
} else {
bad_option:
- printf(_("Unsupported nfs mount option: "
- "%s%s\n"), val ? "" : "no", opt);
- goto out_bad;
+ if (!sloppy) {
+ printf(_("Unsupported nfs mount option: "
+ "%s%s\n"), val ? "" : "no", opt);
+ goto out_bad;
+ }
}
sprintf(cbuf, val ? "%s,":"no%s,", opt);
}

View File

@ -1,21 +0,0 @@
--- nfs-utils-1.0.9/utils/mount/nfsmount.c.orig 2006-10-13 10:32:02.956172000 -0400
+++ nfs-utils-1.0.9/utils/mount/nfsmount.c 2006-10-13 10:51:31.641546000 -0400
@@ -1097,12 +1097,14 @@
flavor = mountres->auth_flavors.auth_flavors_val;
while (--i >= 0) {
- if (flavor[i] == data.pseudoflavor)
- yum = 1;
#ifdef NFS_MOUNT_DEBUG
- printf("auth flavor %d: %d\n",
- i, flavor[i]);
+ printf("auth flavor[%d] %d\n", i, flavor[i]);
#endif
+ if (flavor[i] == data.pseudoflavor ||
+ flavor[i] == AUTH_NONE) {
+ yum = 1;
+ break;
+ }
}
if (!yum) {
fprintf(stderr,

View File

@ -1,40 +0,0 @@
--- nfs-utils-1.0.9/utils/mount/mount.c.orig 2006-09-26 11:32:13.000000000 -0400
+++ nfs-utils-1.0.9/utils/mount/mount.c 2006-09-26 20:23:50.000000000 -0400
@@ -476,21 +476,24 @@
}
}
- if (!mnt_err && !fake) {
- if(!(flags & MS_REMOUNT)) {
- mnt_err = do_mount_syscall(spec, mount_point,
- nfs_mount_vers == 4 ? "nfs4" : "nfs", flags, mount_opts);
-
- if(mnt_err) {
- mount_error(mount_point);
- exit(-1);
- }
- }
- if(!nomtab) {
- add_mtab(spec, mount_point, nfs_mount_vers == 4 ? "nfs4" : "nfs",
- flags, extra_opts, 0, 0);
+ if (fake)
+ return 0;
+ if (mnt_err)
+ exit(EX_FAIL);
+
+ if(!(flags & MS_REMOUNT)) {
+ mnt_err = do_mount_syscall(spec, mount_point,
+ nfs_mount_vers == 4 ? "nfs4" : "nfs", flags, mount_opts);
+
+ if(mnt_err) {
+ mount_error(mount_point);
+ exit(EX_FAIL);
}
}
+ if(!nomtab) {
+ add_mtab(spec, mount_point, nfs_mount_vers == 4 ? "nfs4" : "nfs",
+ flags, extra_opts, 0, 0);
+ }
return 0;
}

View File

@ -0,0 +1,11 @@
--- nfs-utils-1.1.0/support/nfs/exports.c.orig 2007-05-10 23:40:57.000000000 -0400
+++ nfs-utils-1.1.0/support/nfs/exports.c 2007-07-16 09:13:40.000000000 -0400
@@ -355,7 +355,7 @@ static int valid_uuid(char *uuid)
static int
parseopts(char *cp, struct exportent *ep, int warn, int *had_subtree_opt_ptr)
{
- int had_subtree_opt = 0;
+ int had_subtree_opt = 1;
char *flname = efname?efname:"command line";
int flline = efp?efp->x_line:0;

View File

@ -1,5 +1,42 @@
--- nfs-utils-1.0.9/utils/mount/nfs4mount.c.orig 2006-10-16 08:32:53.789617000 -0400
+++ nfs-utils-1.0.9/utils/mount/nfs4mount.c 2006-10-16 08:33:53.098133000 -0400
--- nfs-utils-1.1.0/utils/mount/nfsmount.c.orig 2007-05-10 23:40:57.000000000 -0400
+++ nfs-utils-1.1.0/utils/mount/nfsmount.c 2007-07-25 11:25:33.000000000 -0400
@@ -733,6 +733,10 @@ parse_options(char *old_opts, struct nfs
data->flags &= ~NFS_MOUNT_SOFT;
if (val)
data->flags |= NFS_MOUNT_SOFT;
+ } else if (!strcmp(opt, "fsc")) {
+ data->flags &= ~NFS_MOUNT_FSCACHE;
+ if (val)
+ data->flags |= NFS_MOUNT_FSCACHE;
} else if (!strcmp(opt, "hard")) {
data->flags &= ~NFS_MOUNT_SOFT;
if (!val)
--- nfs-utils-1.1.0/utils/mount/nfs.man.orig 2007-05-10 23:40:57.000000000 -0400
+++ nfs-utils-1.1.0/utils/mount/nfs.man 2007-07-25 11:27:55.000000000 -0400
@@ -288,6 +288,10 @@ Mount the NFS filesystem using the UDP p
Disables NFSv3 READDIRPLUS RPCs. Use this option when
mounting servers that don't support or have broken
READDIRPLUS implementations.
+.TP 1.5i
+.I fsc
+Enable the use of persistent caching to the local disk using
+the FS-Cache facility for the given mount point.
.P
All of the non-value options have corresponding nooption forms.
For example, nointr means don't allow file operations to be
@@ -444,6 +448,10 @@ This extracts a
server performance penalty but it allows two different NFS clients
to get reasonable good results when both clients are actively
writing to common filesystem on the server.
+.TP 1.5i
+.I fsc
+Enable the use of persistent caching to the local disk using
+the FS-Cache facility for the given mount point.
.P
All of the non-value options have corresponding nooption forms.
For example, nointr means don't allow file operations to be
--- nfs-utils-1.1.0/utils/mount/nfs4mount.c.orig 2007-05-10 23:40:57.000000000 -0400
+++ nfs-utils-1.1.0/utils/mount/nfs4mount.c 2007-07-25 11:25:33.000000000 -0400
@@ -201,7 +201,7 @@ int nfs4mount(const char *spec, const ch
char *s;
int val;
@ -36,60 +73,25 @@
/*
* Give a warning if the rpc.idmapd daemon is not running
--- nfs-utils-1.0.9/utils/mount/nfs_mount.h.orig 2006-10-16 08:32:53.763643000 -0400
+++ nfs-utils-1.0.9/utils/mount/nfs_mount.h 2006-10-16 08:33:53.113133000 -0400
@@ -63,6 +63,7 @@ struct nfs_mount_data {
#define NFS_MOUNT_BROKEN_SUID 0x0400 /* 4 */
#define NFS_MOUNT_NOACL 0x0800 /* 4 */
#define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 */
+#define NFS_MOUNT_FSCACHE 0x4000 /* 6 */
/* security pseudoflavors */
--- nfs-utils-1.0.9/utils/mount/nfsmount.c.orig 2006-10-16 08:32:53.853553000 -0400
+++ nfs-utils-1.0.9/utils/mount/nfsmount.c 2006-10-16 08:33:53.128133000 -0400
@@ -695,6 +695,10 @@ parse_options(char *old_opts, struct nfs
data->flags &= ~NFS_MOUNT_SOFT;
if (val)
data->flags |= NFS_MOUNT_SOFT;
+ } else if (!strcmp(opt, "fsc")) {
+ data->flags &= ~NFS_MOUNT_FSCACHE;
+ if (val)
+ data->flags |= NFS_MOUNT_FSCACHE;
} else if (!strcmp(opt, "hard")) {
data->flags &= ~NFS_MOUNT_SOFT;
if (!val)
--- nfs-utils-1.0.9/utils/mount/nfs4_mount.h.orig 2006-07-07 20:04:32.000000000 -0400
+++ nfs-utils-1.0.9/utils/mount/nfs4_mount.h 2006-10-16 08:33:53.143133000 -0400
@@ -65,6 +65,7 @@ struct nfs4_mount_data {
--- nfs-utils-1.1.0/utils/mount/nfs4_mount.h.orig 2007-05-10 23:40:57.000000000 -0400
+++ nfs-utils-1.1.0/utils/mount/nfs4_mount.h 2007-07-25 11:27:07.000000000 -0400
@@ -65,7 +65,8 @@ struct nfs4_mount_data {
#define NFS4_MOUNT_NOCTO 0x0010 /* 1 */
#define NFS4_MOUNT_NOAC 0x0020 /* 1 */
#define NFS4_MOUNT_STRICTLOCK 0x1000 /* 1 */
+#define NFS4_MOUNT_FSCACHE 0x4000 /* 1 */
#define NFS4_MOUNT_FLAGMASK 0xFFFF
-#define NFS4_MOUNT_FLAGMASK 0xFFFF
+#define NFS4_MOUNT_FSCACHE 0x10000 /* 1 */
+#define NFS4_MOUNT_FLAGMASK 0x1FFFF
/* pseudoflavors: */
--- nfs-utils-1.0.9/utils/mount/nfs.man.orig 2006-10-16 08:32:53.825581000 -0400
+++ nfs-utils-1.0.9/utils/mount/nfs.man 2006-10-16 08:36:39.503163000 -0400
@@ -272,6 +272,10 @@ default UDP protocol. Many NFS servers
.I udp
Mount the NFS filesystem using the UDP protocol. This
is the default.
+.TP 1.5i
+.I fsc
+Enable the use of persistent caching to the local disk using
+the FS-Cache facility for the given mount point.
.P
All of the non-value options have corresponding nooption forms.
For example, nointr means don't allow file operations to be
@@ -428,6 +432,10 @@ This extracts a
server performance penalty but it allows two different NFS clients
to get reasonable good results when both clients are actively
writing to common filesystem on the server.
+.TP 1.5i
+.I fsc
+Enable the use of persistent caching to the local disk using
+the FS-Cache facility for the given mount point.
.P
All of the non-value options have corresponding nooption forms.
For example, nointr means don't allow file operations to be
--- nfs-utils-1.1.0/utils/mount/nfs_mount.h.orig 2007-05-10 23:40:57.000000000 -0400
+++ nfs-utils-1.1.0/utils/mount/nfs_mount.h 2007-07-25 11:26:39.000000000 -0400
@@ -64,6 +64,7 @@ struct nfs_mount_data {
#define NFS_MOUNT_NOACL 0x0800 /* 4 */
#define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 */
#define NFS_MOUNT_NORDIRPLUS 0x4000 /* 5 */
+#define NFS_MOUNT_FSCACHE 0x10000 /* 5 */
/* security pseudoflavors */

View File

@ -1,46 +1,37 @@
commit 99defadcebf3bf892871f5541bfe762685faccbd
Author: Steve Dickson <steved@redhat.com>
Date: Wed May 9 13:14:26 2007 -0400
When nfs4 mount fail because the exported directory does
not exist, the mount command claims the local mount point
does not exist which is wrong. This patch fixes that problem
as well as makes the v4 mount failures look like v3/v2 failures.
Signed-off-by: Steve Dickson <steved@redhat.com>
--- nfs-utils-1.0.12/utils/mount/mount.c.orig 2007-05-09 14:06:23.574929000 -0400
+++ nfs-utils-1.0.12/utils/mount/mount.c 2007-05-09 14:07:34.368247000 -0400
@@ -348,22 +348,49 @@
return 0;
--- nfs-utils-1.1.0/utils/mount/mount.c.orig 2007-07-18 16:26:01.000000000 -0400
+++ nfs-utils-1.1.0/utils/mount/mount.c 2007-07-18 16:37:34.000000000 -0400
@@ -286,17 +286,24 @@ static void parse_opts (const char *opti
}
}
-static void mount_error(char *node)
+static void mount_error(char *mntpnt, char *node)
+static void mount_error(char *mount_point, char *node)
{
switch(errno) {
case ENOTDIR:
- fprintf(stderr, "%s: mount point %s is not a directory\n", progname, node);
+ fprintf(stderr, "%s: mount point %s is not a directory\n",
+ progname, mntpnt);
+ progname, mount_point);
break;
case EBUSY:
- fprintf(stderr, "%s: %s is already mounted or busy\n", progname, node);
+ fprintf(stderr, "%s: %s is already mounted or busy\n",
+ progname, mntpnt);
+ fprintf(stderr, "%s: %s is already mounted or busy\n", progname,
+ mount_point);
break;
case ENOENT:
- fprintf(stderr, "%s: mount point %s does not exist\n", progname, node);
+ if (node) {
+ if (node)
+ fprintf(stderr, "%s: %s failed, reason given by server: %s\n",
+ progname, node, strerror(errno));
+ } else
+ fprintf(stderr, "%s: mount point %s does not exist\n",
+ progname, mntpnt);
+ else
+ fprintf(stderr, "%s: mount point %s does not exist\n", progname,
+ mount_point);
break;
default:
fprintf(stderr, "%s: %s\n", progname, strerror(errno));
}
@@ -352,6 +359,26 @@ static int start_statd()
#endif
return 0;
}
+static int chk_mountpoint(char *mount_point)
+{
@ -62,21 +53,21 @@ Date: Wed May 9 13:14:26 2007 -0400
+
+ return 0;
+}
#define NFS_MOUNT_VERS_DEFAULT 3
int main(int argc, char *argv[])
@@ -493,6 +520,9 @@
{
@@ -509,6 +536,9 @@ int main(int argc, char *argv[])
}
}
+ if (chk_mountpoint(mount_point))
+ exit(EX_FAIL);
+ exit(1);
+
if (nfs_mount_vers == 4) {
mnt_err = nfs4mount(spec, mount_point, &flags,
&extra_opts, &mount_opts, 0);
@@ -512,7 +542,7 @@
flags, mount_opts);
if (nfs_mount_vers == 4)
mnt_err = nfs4mount(spec, mount_point, &flags, &extra_opts, &mount_opts, 0);
else {
@@ -539,7 +569,7 @@ int main(int argc, char *argv[])
mount_opts);
if (mnt_err) {
- mount_error(mount_point);

View File

@ -0,0 +1,20 @@
--- nfs-utils-1.1.0/utils/showmount/showmount.c.orig 2007-05-10 23:40:57.000000000 -0400
+++ nfs-utils-1.1.0/utils/showmount/showmount.c 2007-07-16 13:02:42.000000000 -0400
@@ -242,6 +242,8 @@ static unsigned short getport(struct soc
rpc_createerr.cf_stat = status;
clnt_destroy(client);
return 0;
+ } else if (port == 0) {
+ rpc_createerr.cf_stat = RPC_PROGNOTREGISTERED;
}
clnt_destroy(client);
@@ -368,7 +370,7 @@ char **argv;
server_addr.sin_port = getport(&server_addr,
MOUNTPROG, MOUNTVERS, IPPROTO_UDP);
if (!server_addr.sin_port) {
- clnt_pcreateerror("portmap getport");
+ clnt_pcreateerror("showmount");
exit(1);
}
msock = RPC_ANYSOCK;

View File

@ -1,8 +1,8 @@
Summary: NFS utilities and supporting clients and daemons for the kernel NFS server
Name: nfs-utils
URL: http://sourceforge.net/projects/nfs
Version: 1.0.12
Release: 7%{?dist}
Version: 1.1.0
Release: 1%{?dist}
Epoch: 1
# group all 32bit related archs
@ -24,35 +24,19 @@ Source15: nfs.sysconfig
Patch00: nfs-utils-1.0.5-statdpath.patch
Patch01: nfs-utils-1.0.6-mountd.patch
Patch02: nfs-utils-1.0.6-idmap.conf.patch
Patch03: nfs-utils-1.0.6-gssd_mixed_case.patch
Patch04: nfs-utils-1.0.8-privports.patch
Patch05: nfs-utils-1.0.12-export-nosubtree.patch
Patch06: nfs-utils-1.0.9-mount-options-v3.patch
Patch07: nfs-utils-1.0.9-lazy-umount.patch
Patch08: nfs-utils-1.0.9-mount-sloppy.patch
Patch09: nfs-utils-1.0.9-mount-man-nfs.patch
Patch10: nfs-utils-1.0.9-return-mount-error.patch
Patch11: nfs-utils-1.0.9-nfsmount-authnone.patch
Patch12: nfs-utils-1.0.9-mount-remount.patch
Patch13: nfs-utils-1.0.10-mount-nfsvers.patch
Patch14: nfs-utils-1.0.10-udp-no-connect.patch
Patch15: nfs-utils-1.0.10-v4-umounts.patch
Patch16: nfs-utils-1.0.9-mount-quotes.patch
Patch17: nfs-utils-1.0.10-mount-fake.patch
Patch18: nfs-utils-1.0.12-mount-v4-errors.patch
Patch19: nfs-utils-1.0.12-rmtab-ipaddr-manupdate.patch
Patch20: nfs-utils-1.0.12-mountd-memleak.patch
Patch21: nfs-utils-1.0.12-nfsd-macargs.patch
Patch22: nfs-utils-1.0.12-mtab-mis-unlock.patch
Patch23: nfs-utils-1.0.12-mountd-etab.patch
Patch24: nfs-utils-1.0.10-mount-nordirplus.patch
Patch02: nfs-utils-1.0.6-gssd_mixed_case.patch
Patch03: nfs-utils-1.0.12-mountd-memleak.patch
Patch04: nfs-utils-1.0.12-nfsd-macargs.patch
Patch05: nfs-utils-1.0.12-mtab-mis-unlock.patch
Patch06: nfs-utils-1.1.0-exp-subtree-warn-off.patch
Patch07: nfs-utils-1.1.0-showmount-rpcerror.patch
Patch08: nfs-utils-1.1.0-mount-v4-errors.patch
%if %{enablefscache}
Patch90: nfs-utils-1.0.9-mount-fsc.patch
Patch90: nfs-utils-1.1.0-mount-fsc.patch
%endif
Patch100: nfs-utils-1.0.9-compile.patch
#Patch100: nfs-utils-1.0.9-compile.patch
Group: System Environment/Daemons
Provides: exportfs = %{epoch}:%{version}-%{release}
@ -63,25 +47,27 @@ Provides: rpc.idmapd = %{epoch}:%{version}-%{release}
Provides: rpc.mountd = %{epoch}:%{version}-%{release}
Provides: rpc.nfsd = %{epoch}:%{version}-%{release}
Provides: rpc.statd = %{epoch}:%{version}-%{release}
Provides: rpc.lockd = %{epoch}:%{version}-%{release}
Provides: rpc.gssd = %{epoch}:%{version}-%{release}
Provides: rpc.svcgssd = %{epoch}:%{version}-%{release}
Provides: mount.nfs = %{epoch}:%{version}-%{release}
Provides: mount.nfs4 = %{epoch}:%{version}-%{release}
Provides: umount.nfs = %{epoch}:%{version}-%{release}
Provides: umount.nfs4 = %{epoch}:%{version}-%{release}
Provides: sm-notify = %{epoch}:%{version}-%{release}
Provides: start-statd = %{epoch}:%{version}-%{release}
License: GPL
Buildroot: %{_tmppath}/%{name}-%{version}-root
Requires: rpcbind, sed, gawk, sh-utils, fileutils, textutils, grep
Requires: modutils >= 2.4.26-9
BuildRequires: nfs-utils-lib-devel libevent-devel libgssapi-devel
BuildRequires: libgssapi-devel >= 0.11 libevent-devel >= 1.3b
BuildRequires: nfs-utils-lib-devel >= 1.1.0
BuildRequires: krb5-libs >= 1.4 autoconf >= 2.57 openldap-devel >= 2.2
BuildRequires: automake, libtool, keyutils-libs-devel
BuildRequires: tcp_wrappers-devel, e2fsprogs-devel, krb5-devel
BuildRequires: automake, libtool
BuildRequires: e2fsprogs-devel, krb5-devel, tcp_wrappers-devel
Requires(pre): shadow-utils >= 4.0.3-25
Requires(pre): /sbin/chkconfig /sbin/nologin
Requires(pre): nfs-utils-lib libevent libgssapi
Requires: nfs-utils-lib >= 1.1.0 libgssapi >= 0.11 libevent >= 1.3b
%description
The nfs-utils package provides a daemon for the kernel NFS server and
@ -106,29 +92,13 @@ This package also contains the mount.nfs and umount.nfs program.
%patch06 -p1
%patch07 -p1
%patch08 -p1
%patch09 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%if %{enablefscache}
%patch90 -p1
%endif
# Do the magic to get things to compile
%patch100 -p1
#%patch100 -p1
# Remove .orig files
find . -name "*.orig" | xargs rm -f
@ -167,23 +137,14 @@ install -m 755 %{SOURCE13} $RPM_BUILD_ROOT/etc/rc.d/init.d/rpcgssd
install -m 755 %{SOURCE14} $RPM_BUILD_ROOT/etc/rc.d/init.d/rpcsvcgssd
install -m 644 %{SOURCE15} $RPM_BUILD_ROOT/etc/sysconfig/nfs
install -m 644 utils/idmapd/idmapd.conf \
$RPM_BUILD_ROOT/etc/idmapd.conf
mkdir -p $RPM_BUILD_ROOT/var/lib/nfs/rpc_pipefs
touch $RPM_BUILD_ROOT/var/lib/nfs/rmtab
mv $RPM_BUILD_ROOT/usr/sbin/{rpc.lockd,rpc.statd} $RPM_BUILD_ROOT/sbin
mv $RPM_BUILD_ROOT/usr/sbin/{mount.*,umount.*} $RPM_BUILD_ROOT/sbin
mv $RPM_BUILD_ROOT/usr/sbin/rpc.statd $RPM_BUILD_ROOT/sbin
mkdir -p $RPM_BUILD_ROOT/var/lib/nfs/statd
mkdir -p $RPM_BUILD_ROOT/var/lib/nfs/statd/sm
mkdir -p $RPM_BUILD_ROOT/var/lib/nfs/v4recovery
# we are using quotad from quota utils
rm %{buildroot}/%{_mandir}/man8/rquotad*
rm %{buildroot}/%{_mandir}/man8/rpc.rquotad*
rm %{buildroot}/%{_sbindir}/rpc.rquotad
%clean
rm -rf $RPM_BUILD_ROOT
@ -268,17 +229,16 @@ fi
%config /etc/rc.d/init.d/rpcgssd
%config /etc/rc.d/init.d/rpcsvcgssd
%config(noreplace) /etc/sysconfig/nfs
%config(noreplace) /etc/idmapd.conf
%dir /var/lib/nfs/v4recovery
%dir /var/lib/nfs/rpc_pipefs
%dir /var/lib/nfs
%dir %attr(700,rpcuser,rpcuser) /var/lib/nfs/statd
%dir %attr(700,rpcuser,rpcuser) /var/lib/nfs/statd/sm
%config(noreplace) /var/lib/nfs/xtab
%config(noreplace) /var/lib/nfs/etab
%config(noreplace) /var/lib/nfs/rmtab
%config(noreplace) /var/lib/nfs/state
%doc linux-nfs/*
/sbin/rpc.lockd
/sbin/rpc.statd
/usr/sbin/exportfs
/usr/sbin/nfsstat
@ -291,6 +251,8 @@ fi
/usr/sbin/rpc.svcgssd
/usr/sbin/gss_clnt_send_err
/usr/sbin/gss_destroy_creds
/usr/sbin/sm-notify
/usr/sbin/start-statd
%{_mandir}/*/*
%config /etc/rc.d/init.d/nfslock
@ -300,6 +262,9 @@ fi
%attr(4755,root,root) /sbin/umount.nfs4
%changelog
* Sat Jul 28 2007 Steve Dickson <steved@redhat.com> 1.1.0-1
- Upgraded to the latest upstream version (nfs-utils-1.1.0)
* Thu May 24 2007 Steve Dickson <steved@redhat.com> 1.0.10-7
- Fixed typo in mount.nfs4 that causes a segfault during
error processing (bz 241190)

View File

@ -15,17 +15,17 @@
# Source networking configuration.
if [ ! -f /etc/sysconfig/network ]; then
exit 0
exit 6
fi
. /etc/sysconfig/network
# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0
[ "${NETWORKING}" = "no" ] && exit 6
[ -x /usr/sbin/rpc.nfsd ] || exit 0
[ -x /usr/sbin/rpc.mountd ] || exit 0
[ -x /usr/sbin/exportfs ] || exit 0
[ -x /usr/sbin/rpc.nfsd ] || exit 5
[ -x /usr/sbin/rpc.mountd ] || exit 5
[ -x /usr/sbin/exportfs ] || exit 5
# Don't fail if /etc/exports doesn't exist; create a bare-bones version and continue.
[ -r /etc/exports ] || \
@ -106,7 +106,6 @@ case "$1" in
;;
stop)
# Stop daemons.
[ -x /usr/sbin/rpc.svcgssd ] && /sbin/service rpcsvcgssd stop
echo -n $"Shutting down NFS mountd: "
killproc rpc.mountd
echo
@ -116,6 +115,7 @@ case "$1" in
if [ -n "$RQUOTAD" -a "$RQUOTAD" != "no" ]; then
echo -n $"Shutting down NFS quotas: "
killproc rpc.rquotad
RETVAL=$?
echo
fi
# Reset the lockd ports if they were set
@ -133,6 +133,7 @@ case "$1" in
else
action $"Shutting down NFS services: " /bin/false
fi
[ -x /usr/sbin/rpc.svcgssd ] && /sbin/service rpcsvcgssd stop
rm -f /var/lock/subsys/nfs
;;
status)
@ -172,15 +173,10 @@ case "$1" in
$0 start
}
;;
condstop)
[ -x /usr/sbin/rpc.svcgssd ] && /sbin/service rpcsvcgssd condstop
[ -f /var/lock/subsys/nfs ] && {
$0 stop
}
;;
*)
echo $"Usage: nfs {start|stop|status|restart|reload|condrestart|condstop}"
exit 1
echo $"Usage: nfs {start|stop|status|restart|reload|condrestart}"
RETVAL=3
;;
esac
exit $?
exit $RETVAL

View File

@ -14,7 +14,7 @@
# Source networking configuration.
if [ ! -f /etc/sysconfig/network ]; then
exit 0
exit 6
fi
# Check for and source configuration file
@ -23,7 +23,7 @@ fi
. /etc/sysconfig/network
# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0
[ "${NETWORKING}" = "no" ] && exit 6
# Start lockd from userland only if kernel <= 2.2.18
OS_RELEASE=`uname --release`
@ -38,10 +38,10 @@ else
fi
if [ "$USERLAND_LOCKD" ] ; then
[ -x /sbin/rpc.lockd ] || exit 0
[ -x /sbin/rpc.lockd ] || exit 5
fi
[ -x /sbin/rpc.statd ] || exit 0
[ -x /sbin/rpc.statd ] || exit 5
RETVAL=0
if [ -n "${STATD_HOSTNAME}" ]; then
@ -139,14 +139,10 @@ case "$1" in
start
}
;;
condstop)
[ -f /var/lock/subsys/nfslock ] && {
stop
}
;;
*)
echo $"Usage: $0 {start|stop|status|restart|probe|condrestart|condstop}"
exit 1
echo $"Usage: $0 {start|stop|status|restart|probe|condrestart}"
RETVAL=3
;;
esac
exit $RETVAL

View File

@ -4,7 +4,7 @@
#
# Authors: Chuck Lever <cel@netapp.com>
#
# chkconfig: 345 19 69
# chkconfig: 345 19 85
# description: Starts user-level daemon that manages RPCSEC GSS contexts \
# for the NFSv4 client.
@ -13,18 +13,18 @@
# Source networking configuration.
if [ ! -f /etc/sysconfig/network ]; then
exit 0
exit 6
fi
. /etc/sysconfig/network
# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0
[ "${NETWORKING}" = "no" ] && exit 6
[ ! -x /usr/sbin/rpc.gssd ] && exit 0
[ ! -x /usr/sbin/rpc.gssd ] && exit 5
# Check for and source configuration file otherwise set defaults
[ -f /etc/sysconfig/nfs ] && . /etc/sysconfig/nfs
[ "${SECURE_NFS}" != "yes" ] && exit 0
[ "${SECURE_NFS}" != "yes" ] && exit 6
# List of kernel modules to load
[ -z "${SECURE_NFS_MODS}" ] && SECURE_NFS_MODS="des rpcsec_gss_krb5"
@ -45,25 +45,35 @@ case "$1" in
echo -n $"Starting RPC gssd: "
# Load sunrpc which mounts the rpc_pipes fs.
# Make sure the rpc_pipefs filesystem is available
[ "${RPCMTAB}" != "noload" ] && {
RPCMTAB=`grep -v '^#' /proc/mounts | \
awk '{ if ($3 ~ /^rpc_pipefs$/ ) print $2}'`
[ -z "${RPCMTAB}" ] && {
[ -x /sbin/lsmod -a -x /sbin/modprobe ] && {
if ! /sbin/lsmod | grep sunrpc > /dev/null ; then
/sbin/modprobe sunrpc || exit 1
/sbin/modprobe sunrpc
fi
# Load rpcsec modules
for i in ${SECURE_NFS_MODS}
do
}
RPCMTAB=`grep -v '^#' /proc/mounts | \
awk '{ if ($3 ~ /^rpc_pipefs$/ ) print $2}'`
[ -z "${RPCMTAB}" ] && { \
echo "Error: RPC MTAB does not exist."
exit 6
}
}
}
[ "${SECURE_NFS_MODS}" != "noload" ] && {
[ -x /sbin/lsmod -a -x /sbin/modprobe ] && {
for i in ${SECURE_NFS_MODS}; do
if ! /sbin/lsmod | grep $i > /dev/null ; then
/sbin/modprobe $i || exit 1
/sbin/modprobe $i || {
echo "Error: Unable to load '$i' security module."
exit 6;
}
fi
done
}
# Make sure the mount worked.
[ -z "${RPCMTAB}" ] && RPCMTAB=`grep -v '^#' /proc/mounts | \
awk '{ if ($3 ~ /^rpc_pipefs$/ ) print $2}'`
[ -z "${RPCMTAB}" ] && {
echo "Error: RPC MTAB does not exist."
exit 1
}
# Start daemon.
@ -74,7 +84,7 @@ case "$1" in
;;
stop)
# Stop daemon.
echo -n $"Shutting down RPC gssd: "
echo -n $"Stopping RPC gssd: "
killproc $prog
RETVAL=$?
echo
@ -95,15 +105,10 @@ case "$1" in
RETVAL=$?
fi
;;
condstop)
if [ -f $LOCKFILE ]; then
$0 stop
RETVAL=$?
fi
;;
*)
echo $"Usage: $0 {start|stop|restart|condstart|condrestart|condstop|status}"
exit 1
echo $"Usage: $0 {start|stop|restart|condstart|condrestart|status}"
RETVAL=3
;;
esac
exit $RETVAL

View File

@ -4,7 +4,7 @@
#
# Authors: Chuck Lever <cel@netapp.com>
#
# chkconfig: 345 18 68
# chkconfig: 345 18 85
# description: Starts user-level daemon for NFSv4 that maps user \
# names to UID and GID numbers.
@ -13,14 +13,14 @@
# Source networking configuration.
if [ ! -f /etc/sysconfig/network ]; then
exit 0
exit 6
fi
. /etc/sysconfig/network
# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0
[ "${NETWORKING}" = "no" ] && exit 6
[ ! -x /usr/sbin/rpc.idmapd ] && exit 0
[ ! -x /usr/sbin/rpc.idmapd ] && exit 5
# Check for and source configuration file otherwise set defaults
[ -f /etc/sysconfig/nfs ] && . /etc/sysconfig/nfs
@ -40,20 +40,26 @@ case "$1" in
echo -n $"Starting RPC idmapd: "
# Load sunrpc which mounts the rpc_pipes fs.
# Make sure the rpc_pipefs filesystem is available
[ "${RPCMTAB}" != "noload" ] && {
RPCMTAB=`grep -v '^#' /proc/mounts | \
awk '{ if ($3 ~ /^rpc_pipefs$/ ) print $2}'`
[ -z "${RPCMTAB}" ] && {
[ -x /sbin/lsmod -a -x /sbin/modprobe ] && {
if ! /sbin/lsmod | grep sunrpc > /dev/null ; then
/sbin/modprobe sunrpc || exit 1
/sbin/modprobe sunrpc
fi
}
RPCMTAB=`grep -v '^#' /proc/mounts | \
awk '{ if ($3 ~ /^rpc_pipefs$/ ) print $2}'`
[ -z "${RPCMTAB}" ] && { \
echo "Error: RPC MTAB does not exist."
exit 6
}
}
}
# Make sure the mount worked.
[ -z "${RPCMTAB}" ] && RPCMTAB=`grep -v '^#' /proc/mounts | \
awk '{ if ($3 ~ /^rpc_pipefs$/ ) print $2}'`
[ -z "${RPCMTAB}" ] && {
echo "Error: RPC MTAB does not exist."
exit 1
}
# Start daemon.
daemon $prog ${RPCIDMAPDARGS}
@ -63,7 +69,7 @@ case "$1" in
;;
stop)
# Stop daemon.
echo -n $"Shutting down RPC idmapd: "
echo -n $"Stopping RPC idmapd: "
killproc $prog
RETVAL=$?
echo
@ -84,15 +90,10 @@ case "$1" in
RETVAL=$?
fi
;;
condstop)
if [ -f $LOCKFILE ]; then
$0 stop
RETVAL=$?
fi
;;
*)
echo $"Usage: $0 {start|stop|restart|condstart|condrestart|condstop|status}"
exit 1
echo $"Usage: $0 {start|stop|restart|condstart|condrestart|status}"
RETVAL=3
;;
esac
exit $RETVAL

View File

@ -13,18 +13,18 @@
# Source networking configuration.
if [ ! -f /etc/sysconfig/network ]; then
exit 0
exit 6
fi
. /etc/sysconfig/network
# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0
[ "${NETWORKING}" = "no" ] && exit 6
[ ! -x /usr/sbin/rpc.svcgssd ] && exit 0
[ ! -x /usr/sbin/rpc.svcgssd ] && exit 5
# Check for and source configuration file otherwise set defaults
[ -f /etc/sysconfig/nfs ] && . /etc/sysconfig/nfs
[ "${SECURE_NFS}" != "yes" ] && exit 0
[ "${SECURE_NFS}" != "yes" ] && exit 6
# List of kernel modules to load
[ -z "${SECURE_NFS_MODS}" ] && SECURE_NFS_MODS="des rpcsec_gss_krb5"
@ -43,26 +43,37 @@ case "$1" in
echo -n $"Starting RPC svcgssd: "
# Load sunrpc which mounts the rpc_pipes fs.
# Make sure the rpc_pipefs filesystem is available
[ "${RPCMTAB}" != "noload" ] && {
RPCMTAB=`grep -v '^#' /proc/mounts | \
awk '{ if ($3 ~ /^rpc_pipefs$/ ) print $2}'`
[ -z "${RPCMTAB}" ] && {
[ -x /sbin/lsmod -a -x /sbin/modprobe ] && {
if ! /sbin/lsmod | grep sunrpc > /dev/null ; then
/sbin/modprobe sunrpc || exit 1
/sbin/modprobe sunrpc
fi
}
RPCMTAB=`grep -v '^#' /proc/mounts | \
awk '{ if ($3 ~ /^rpc_pipefs$/ ) print $2}'`
[ -z "${RPCMTAB}" ] && { \
echo "Error: RPC MTAB does not exist."
exit 6
}
}
}
[ "${SECURE_NFS_MODS}" != "noload" ] && {
[ -x /sbin/lsmod -a -x /sbin/modprobe ] && {
# Load rpcsec modules
for i in ${SECURE_NFS_MODS}
do
if ! /sbin/lsmod | grep $i > /dev/null ; then
/sbin/modprobe $i || exit 1
/sbin/modprobe $i || {
echo "Error: Unable to load '$i' security module."
exit 6;
}
fi
done
}
# Make sure the mount worked.
[ -z "${RPCMTAB}" ] && RPCMTAB=`grep -v '^#' /proc/mounts | \
awk '{ if ($3 ~ /^rpc_pipefs$/ ) print $2}'`
[ -z "${RPCMTAB}" ] && {
echo "Error: RPC MTAB does not exist."
exit 1
}
# Start daemon.
@ -94,15 +105,10 @@ case "$1" in
RETVAL=$?
fi
;;
condstop)
if [ -f $LOCKFILE ]; then
$0 stop
RETVAL=$?
fi
;;
*)
echo $"Usage: $0 {start|stop|restart|condstart|condrestart|condstop|status}"
exit 1
echo $"Usage: $0 {start|stop|restart|condstart|condrestart|status}"
RETVAL=3
;;
esac
exit $RETVAL

View File

@ -1,2 +1,2 @@
ae7db9c61c5ad04f83bb99e5caed73da nfs.doc.tar.gz
2c4425cad533d327afce16d30a344e19 nfs-utils-1.0.12.tar.bz2
42d92ed97f7d4071a017ccac8055cf51 nfs-utils-1.1.0.tar.bz2