On Tuesday 24 April 2007, Karel Zak wrote: > On Fri, Apr 13, 2007 at 07:28:25AM -0400, Mike Frysinger wrote: > > --- > > mount/mount.c | 2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/mount/mount.c b/mount/mount.c > > index 8e850b0..ea5ddc9 100644 > > --- a/mount/mount.c > > +++ b/mount/mount.c > > @@ -759,7 +759,7 @@ update_mtab_entry(const char *spec, const char *node, > > const char *type, print_one (&mnt); > > > > if (!nomtab && mtab_is_writable()) { > > - if (flags & MS_REMOUNT) > > + if (fake || (flags & MS_REMOUNT)) > > update_mtab (mnt.mnt_dir, &mnt); > > else { > > mntFILE *mfp; > > Sorry, NAK. > > man mount (about -f): > Causes everything to be done except for the actual system call; > > > there is nothing about any other exception. It's root's mistake when > add to mtab duplicate entry. The mount command prevents duplicate > mounts for "mount -a" or MS_USER/MS_USERS only. I don't think that we > need an exception for fake mounts. The fake mount has to work exactly > like normal mount otherwise it's nonsense. well, the reason for the change was because of the usage in the man page you also referred to: Causes everything to be done except for the actual system call; if it's not obvious, this fakes'' mounting the file system. This option is useful in conjunction with the -v flag to determine what the mount command is trying to do. It can also be used to add entries for devices that were mounted earlier with the -n option. that description (last sentence) indicates that the process should be a lot more safe than it actually is ... if the change i proposed above is NACKed, then perhaps the man page should be tweaked to indicate this possible duplication in mtab ... -mike
Attachment:
signature.asc
Description: This is a digitally signed message part.