From 3e4b94e40bc9e45dfd9dcffb29cb0096b9c3f19d Mon Sep 17 00:00:00 2001 From: kzak Date: Fri, 15 Sep 2006 09:08:32 +0000 Subject: [PATCH] - some important FC6 bugfixes --- util-linux-2.13-mount-sloppy.patch | 20 ++++++++ util-linux-2.13-mount-twiceloop.patch | 72 +++++++++++++++------------ util-linux-2.13-mount-uhelper.patch | 49 ++++++++++++++++++ util-linux.spec | 14 +++++- 4 files changed, 123 insertions(+), 32 deletions(-) create mode 100644 util-linux-2.13-mount-sloppy.patch create mode 100644 util-linux-2.13-mount-uhelper.patch diff --git a/util-linux-2.13-mount-sloppy.patch b/util-linux-2.13-mount-sloppy.patch new file mode 100644 index 0000000..43b985c --- /dev/null +++ b/util-linux-2.13-mount-sloppy.patch @@ -0,0 +1,20 @@ +--- util-linux-2.13-pre6/mount/mount.c.sloppy 2006-09-15 08:39:53.000000000 +0200 ++++ util-linux-2.13-pre6/mount/mount.c 2006-09-15 08:43:24.000000000 +0200 +@@ -554,7 +554,7 @@ + if (stat(mountprog, &statbuf) == 0) { + res = fork(); + if (res == 0) { +- char *oo, *mountargs[10]; ++ char *oo, *mountargs[11]; + int i = 0; + + setuid(getuid()); +@@ -563,6 +563,8 @@ + mountargs[i++] = mountprog; + mountargs[i++] = spec; + mountargs[i++] = node; ++ if (sloppy && (strcmp(type, "nfs")==0 || strcmp(type, "nfs4")==0)) ++ mountargs[i++] = "-s"; + if (nomtab) + mountargs[i++] = "-n"; + if (verbose) diff --git a/util-linux-2.13-mount-twiceloop.patch b/util-linux-2.13-mount-twiceloop.patch index a82401a..f694bcf 100644 --- a/util-linux-2.13-mount-twiceloop.patch +++ b/util-linux-2.13-mount-twiceloop.patch @@ -1,35 +1,15 @@ ---- util-linux-2.13-pre6/mount/fstab.c.twiceloop 2006-01-03 18:35:05.000000000 +0100 -+++ util-linux-2.13-pre6/mount/fstab.c 2006-01-03 18:37:44.000000000 +0100 -@@ -254,6 +254,27 @@ - return (ct == 1); - } +--- util-linux-2.13-pre6/mount/fstab.h.twiceloop 2006-09-15 08:50:46.000000000 +0200 ++++ util-linux-2.13-pre6/mount/fstab.h 2006-09-15 08:51:10.000000000 +0200 +@@ -2,6 +2,7 @@ + int mtab_is_writable(void); + int mtab_does_not_exist(void); + int is_mounted_once(const char *name); ++int is_mounted_same_loopfile(const char *loopfile, const char *dir); -+/* -+ * Given the loop file LOOPFILE, and the mount point DIR, check that -+ * same file is already mounted on same directory -+ * -+ * Don't forget there's -+ * /path/loopfile /path/dir loop=/dev/loop0 -+ * in mtab for loop devices. -+ */ -+int -+is_mounted_same_loopfile(const char *loopfile, const char *dir) { -+ struct mntentchn *mc, *mc0; -+ int ct = 0; -+ -+ mc0 = mtab_head(); -+ for (mc = mc0->prev; mc && mc != mc0; mc = mc->prev) -+ if (streq(mc->m.mnt_fsname, loopfile) && -+ streq(mc->m.mnt_dir, dir)) -+ ct++; -+ return (ct == 1); -+} -+ - /* Given the name FILE, try to find the option "loop=FILE" in mtab. */ - struct mntentchn * - getmntoptfile (const char *file) { ---- util-linux-2.13-pre6/mount/mount.c.twiceloop 2006-01-03 18:35:06.000000000 +0100 -+++ util-linux-2.13-pre6/mount/mount.c 2006-01-03 18:37:44.000000000 +0100 + struct mntentchn { + struct mntentchn *nxt, *prev; +--- util-linux-2.13-pre6/mount/mount.c.twiceloop 2006-09-15 08:50:23.000000000 +0200 ++++ util-linux-2.13-pre6/mount/mount.c 2006-09-15 08:50:24.000000000 +0200 @@ -671,7 +671,7 @@ static int @@ -60,3 +40,33 @@ if (res) goto out; } +--- util-linux-2.13-pre6/mount/fstab.c.twiceloop 2006-09-15 08:50:23.000000000 +0200 ++++ util-linux-2.13-pre6/mount/fstab.c 2006-09-15 08:50:24.000000000 +0200 +@@ -254,6 +254,27 @@ + return (ct == 1); + } + ++/* ++ * Given the loop file LOOPFILE, and the mount point DIR, check that ++ * same file is already mounted on same directory ++ * ++ * Don't forget there's ++ * /path/loopfile /path/dir loop=/dev/loop0 ++ * in mtab for loop devices. ++ */ ++int ++is_mounted_same_loopfile(const char *loopfile, const char *dir) { ++ struct mntentchn *mc, *mc0; ++ int ct = 0; ++ ++ mc0 = mtab_head(); ++ for (mc = mc0->prev; mc && mc != mc0; mc = mc->prev) ++ if (streq(mc->m.mnt_fsname, loopfile) && ++ streq(mc->m.mnt_dir, dir)) ++ ct++; ++ return (ct == 1); ++} ++ + /* Given the name FILE, try to find the option "loop=FILE" in mtab. */ + struct mntentchn * + getmntoptfile (const char *file) { diff --git a/util-linux-2.13-mount-uhelper.patch b/util-linux-2.13-mount-uhelper.patch new file mode 100644 index 0000000..b687591 --- /dev/null +++ b/util-linux-2.13-mount-uhelper.patch @@ -0,0 +1,49 @@ +--- util-linux-2.13-pre6/mount/umount.8.uhelper 2006-09-15 09:44:43.000000000 +0200 ++++ util-linux-2.13-pre6/mount/umount.8 2006-09-15 10:07:11.000000000 +0200 +@@ -122,6 +122,19 @@ + Any pending loop devices can be freed using `losetup -d', see + .BR losetup (8). + ++.SH NOTES ++The syntax of external umount helpers is: ++ ++.br ++.BI "/sbin/umount. [\-nlfvr] " "dir " | " device " ++.br ++ ++where the is filesystem type or a value from "uhelper=" mtab option. ++ ++The uhelper (unprivileged umount request helper) is possible used when non-root ++user wants to umount device which has been mounted by an external process (e.g. ++HAL) and there is not entry in fstab for this mountpoint. ++ + .SH FILES + .I /etc/mtab + table of mounted file systems +--- util-linux-2.13-pre6/mount/umount.c.uhelper 2006-09-15 09:11:38.000000000 +0200 ++++ util-linux-2.13-pre6/mount/umount.c 2006-09-15 09:44:10.000000000 +0200 +@@ -565,11 +565,24 @@ + + if (suid) { + char *mtab_user = NULL; ++ char *uhelper = NULL; + + if (!mc) + die(2, + _("umount: %s is not mounted (according to mtab)"), + file); ++ /* ++ * uhelper - unprivileged umount helper ++ * -- external umount (for example HAL mounts) ++ */ ++ if (mc->m.mnt_opts) ++ uhelper = get_value(mc->m.mnt_opts, "uhelper="); ++ if (uhelper) { ++ int status = 0; ++ if (check_special_umountprog(arg, arg, uhelper, &status)) ++ return status; ++ } ++ + /* The 2.4 kernel will generally refuse to mount the same + filesystem on the same mount point, but will accept NFS. + So, unmounting must be possible. */ diff --git a/util-linux.spec b/util-linux.spec index 6074b51..9d69ffe 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -9,7 +9,7 @@ Summary: A collection of basic system utilities. Name: util-linux Version: 2.13 -Release: 0.40 +Release: 0.41 License: distributable Group: System Environment/Base @@ -227,6 +227,10 @@ Patch246: util-linux-2.13-nfsmount-fsc.patch Patch247: util-linux-2.13-login-timeval.patch # 199745 - Non-existant simpleinit(8) mentioned in ctrlaltdel(8) Patch248: util-linux-2.13-ctrlaltdel-man.patch +# 205038 - mount not allowing sloppy option +Patch249: util-linux-2.13-mount-sloppy.patch +# 188193 - util-linux should provide plugin infrastructure for HAL +Patch250: util-linux-2.13-mount-uhelper.patch # When adding patches, please make sure that it is easy to find out what bug # the # patch fixes. @@ -326,6 +330,8 @@ cp %{SOURCE8} %{SOURCE9} . %patch246 -p1 %patch247 -p1 %patch248 -p1 +%patch249 -p1 +%patch250 -p1 %build unset LINGUAS || : @@ -730,6 +736,12 @@ exit 0 /sbin/losetup %changelog +* Fri Sep 15 2006 Karel Zak 2.13-0.41 +- fix #205038 - mount not allowing sloppy option (exports "-s" + to external /sbin/mount.nfs(4) calls) +- fix minor bug in util-linux-2.13-mount-twiceloop.patch +- fix #188193- util-linux should provide plugin infrastructure for HAL + * Mon Aug 21 2006 Karel Zak 2.13-0.40 - fix Makefile.am in util-linux-2.13-mount-context.patch - fix #201343 - pam_securetty requires known user to work