Re: [PATCH] Dont try to update mtab with -n and /etc/mtab isnt writable.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday 24 April 2007, Karel Zak wrote:
> On Fri, Apr 13, 2007 at 07:29:37AM -0400, Mike Frysinger wrote:
> > --- a/mount/umount.c
> > +++ b/mount/umount.c
> > @@ -349,7 +349,7 @@ umount_one (const char *spec, const char *node, const
> > char *type, remnt.mnt_type = remnt.mnt_fsname = NULL;
> >  			remnt.mnt_dir = xstrdup(node);
> >  			remnt.mnt_opts = xstrdup("ro");
> > -			if (!nomtab)
> > +			if (!nomtab && mtab_is_writable())
> >  				update_mtab(node, &remnt);
>
>  See ftab.c:
>
>  void
>  update_mtab (const char *dir, struct my_mntent *instead) {
>       mntFILE *mfp, *mftmp;
>       const char *fnam = MOUNTED;
>       struct mntentchn mtabhead;      /* dummy */
>       struct mntentchn *mc, *mc0, *absent = NULL;
>
>       if (mtab_does_not_exist() || !mtab_is_writable())
>                                    ^^^^^^^^^^^^^^^^^^^
>            return;
>
>
>  It means the patch duplicates the check. Unfortunately, the same
>  duplication is already in mount.c (I will fix it).
>
>  I think better will be keep the mtab_is_writable() in
>  update_mtab() only.

the patch was to fix the mentioned use case ... if the use case is fixed, then 
it doesnt matter to me how ... old version of util-linux lacked that check 
you pointed out in the current git, so indeed my patch would double up the 
writable check in current git

cheers
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux