From 53f83656392079e646de5788384f6349e7ab7630 Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Sep 27 2006 00:32:15 +0000 Subject: - mount.nfs was not returning a non-zero exit value on failed mounts (bz 206705) --- diff --git a/nfs-utils-1.0.9-return-mount-error.patch b/nfs-utils-1.0.9-return-mount-error.patch new file mode 100644 index 0000000..024d12a --- /dev/null +++ b/nfs-utils-1.0.9-return-mount-error.patch @@ -0,0 +1,40 @@ +--- 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; + } diff --git a/nfs-utils.spec b/nfs-utils.spec index 53c7551..902640f 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -32,6 +32,7 @@ Patch57: nfs-utils-1.0.9-mount-fsc.patch Patch58: nfs-utils-1.0.9-krb5-memory.patch Patch59: nfs-utils-1.0.9-mount-sloppy.patch Patch60: nfs-utils-1.0.9-mount-man-nfs.patch +Patch61: nfs-utils-1.0.9-return-mount-error.patch Patch100: nfs-utils-1.0.9-compile.patch @@ -84,6 +85,7 @@ This package also contains the mount.nfs and umount.nfs program. %patch58 -p1 %patch59 -p1 %patch60 -p1 +%patch61 -p1 # Do the magic to get things to compile %patch100 -p1 @@ -257,6 +259,10 @@ fi %endif %changelog +* Tue Sep 26 2006 Steve Dickson 1.0.9-8 +- mount.nfs was not returning a non-zero exit value + on failed mounts (bz 206705) + * Wed Sep 20 2006 Karel Zak 1.0.9-7 - Added support for the mount -s (sloppy) option (#205038) - Added nfs.5 man page from util-linux