From: Mike Frysinger Date: Mon, 5 Sep 2005 04:48:10 +0000 (+0000) Subject: Fix `mount --move` mtab updating #104697 by Jakub Jozwicki. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=03cc6d5542a63f1188c1abafc9a788562f558fda;p=gentoo.git Fix `mount --move` mtab updating #104697 by Jakub Jozwicki. Package-Manager: portage-2.0.51.22-r2 --- diff --git a/sys-apps/util-linux/ChangeLog b/sys-apps/util-linux/ChangeLog index 3d7d80f854a0..f81ac6c63f1d 100644 --- a/sys-apps/util-linux/ChangeLog +++ b/sys-apps/util-linux/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for sys-apps/util-linux # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/ChangeLog,v 1.106 2005/09/03 02:24:24 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/ChangeLog,v 1.107 2005/09/05 04:48:10 vapier Exp $ + + 05 Sep 2005; Mike Frysinger + +files/util-linux-2.12q-update-mtab-when-moving.patch, + util-linux-2.12q-r1.ebuild: + Fix `mount --move` mtab updating #104697 by Jakub Jozwicki. 03 Sep 2005; Mike Frysinger +files/util-linux-2.12q-more-fake-checks.patch, diff --git a/sys-apps/util-linux/Manifest b/sys-apps/util-linux/Manifest index 925d8b5110ec..b1a364f201a0 100644 --- a/sys-apps/util-linux/Manifest +++ b/sys-apps/util-linux/Manifest @@ -3,10 +3,10 @@ Hash: SHA1 MD5 40353e338343ed2b6a8f23259c881e49 util-linux-2.12q.ebuild 4785 MD5 3539732064102ec9896b7ae3b90e8e99 util-linux-2.12p-r1.ebuild 4396 -MD5 1281e5b67b05e64bf029a780be510073 util-linux-2.12q-r1.ebuild 5011 +MD5 615dd5dc24cb67c6ff5d7f4f8fd64b50 util-linux-2.12q-r1.ebuild 5124 MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164 MD5 af4d9067188d2b9be9ff65f0a2482a1f util-linux-2.12i-r1.ebuild 3846 -MD5 c63170dca767a50edd38e3d9db1fe9d9 ChangeLog 18148 +MD5 6c5bc8e71db0b375818df454ba43eeb3 ChangeLog 18348 MD5 519d6757067c4ee7c634c8b60f9abeb3 files/util-linux-2.12p-swapon-check-symlinks.patch 864 MD5 e3697bc8fd6a344e8cba1c7d32e34790 files/util-linux-2.11z-parallel-make.patch 369 MD5 28b1a8ed38823851eafadacef8ce11ec files/util-linux-2.12q-no-m68k-fdisk.patch 239 @@ -14,6 +14,7 @@ MD5 33ddd96078cf91030b80f73eb70f5371 files/util-linux-2.12i-swapon-check-symlink MD5 8d4f1146f0699deb1e6872e1c81293e3 files/util-linux-2.12-selinux.diff.bz2 2558 MD5 a33ff00c09f558d4273360a581880c23 files/digest-util-linux-2.12q-r1 292 MD5 6eba0a390d20cd25c0d23e3155755f31 files/util-linux-2.12q-more-fake-checks.patch 612 +MD5 e8c2796a3427138ca8a09a69db357a1f files/util-linux-2.12q-update-mtab-when-moving.patch 1031 MD5 d448f3b1b3ea21db4c2c4f303b48c1c8 files/digest-util-linux-2.12p-r1 294 MD5 65f42fbf981464410f7d5d84a429e920 files/util-linux-no-kill.patch 642 MD5 a43d2b8c70c5f40a195721dc536abace files/util-linux-2.12-swapon-unistd.patch 289 @@ -38,7 +39,7 @@ MD5 cfa3960fd97ca16c85b0d1b87e6ba226 files/digest-util-linux-2.12i-r1 156 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) -iD8DBQFDGQl9gIKl8Uu19MoRAs3JAJ9evpJU3+bm0legJBzigLj/zk6bAwCdGyWQ -dZ7lDDFwOOGzS7Dw00LkMO4= -=ZtDK +iD4DBQFDG845gIKl8Uu19MoRAtE5AJ0Ri+tY5B+aDnXgmYIxzQZuiJFP1gCXb9ub +0o8h/wGrtqrm/J4u8WLUzQ== +=yX/B -----END PGP SIGNATURE----- diff --git a/sys-apps/util-linux/files/util-linux-2.12q-update-mtab-when-moving.patch b/sys-apps/util-linux/files/util-linux-2.12q-update-mtab-when-moving.patch new file mode 100644 index 000000000000..34927d4d8a7f --- /dev/null +++ b/sys-apps/util-linux/files/util-linux-2.12q-update-mtab-when-moving.patch @@ -0,0 +1,33 @@ +Running `mount --move /foo /bar` would leave the old /foo entry in /etc/mtab +and create a new /bar entry with wrong info. + +http://bugs.gentoo.org/104697 + +--- mount/mount.c ++++ mount/mount.c +@@ -665,6 +665,25 @@ + else { + mntFILE *mfp; + ++ /* when moving a mount point, we have to make sure the mtab ++ * gets updated properly. We get info about the old mount ++ * point, copy it to the new mount point, and then delete ++ * the old mount point. */ ++ if (flags & MS_MOVE) { ++ const char *olddir = mnt.mnt_fsname; ++ struct mntentchn *oldmc = oldmc = getmntfile(olddir); ++ if (oldmc != NULL) { ++ mnt.mnt_fsname = strdup(oldmc->m.mnt_fsname); ++ mnt.mnt_type = oldmc->m.mnt_type; ++ mnt.mnt_opts = oldmc->m.mnt_opts; ++ mnt.mnt_freq = oldmc->m.mnt_freq; ++ mnt.mnt_passno = oldmc->m.mnt_passno; ++ } ++ update_mtab(olddir, NULL); ++ if (oldmc != NULL) ++ my_free(olddir); ++ } ++ + lock_mtab(); + mfp = my_setmntent(MOUNTED, "a+"); + if (mfp == NULL || mfp->mntent_fp == NULL) { diff --git a/sys-apps/util-linux/util-linux-2.12q-r1.ebuild b/sys-apps/util-linux/util-linux-2.12q-r1.ebuild index 9c1935715d4a..48499a74ca43 100644 --- a/sys-apps/util-linux/util-linux-2.12q-r1.ebuild +++ b/sys-apps/util-linux/util-linux-2.12q-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/util-linux-2.12q-r1.ebuild,v 1.5 2005/09/03 02:24:24 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/util-linux-2.12q-r1.ebuild,v 1.6 2005/09/05 04:48:10 vapier Exp $ inherit eutils flag-o-matic toolchain-funcs @@ -54,6 +54,9 @@ src_unpack() { # Fix -f usage with -a and in general epatch ${FILESDIR}/${PN}-2.12q-more-fake-checks.patch + # Fix mtab updates with `mount --move /foo /bar` + epatch ${FILESDIR}/${PN}-2.12q-update-mtab-when-moving.patch + # Fix unreadable df output when using devfs ... this check is kind of # a hack, but whatever, the output isnt critical at all :P [[ -e /dev/.devfsd ]] && epatch ${FILESDIR}/no-symlink-resolve.patch