- fix one-argument mount in cases where fstab or mtab contain overlapping
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Tue, 4 Apr 2006 08:23:59 +0000 (08:23 -0000)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Tue, 4 Apr 2006 08:23:59 +0000 (08:23 -0000)
  entries.  (Such as "mount -o remount,rw /" where you're not on rootfs.).
  (r14723 from trunk)

util-linux/mount.c

index 1b6ff965bc539ed5ca3acbee14a97caf1248a551..1e4d5aa31758998783796f0237a4577977fdce68 100644 (file)
@@ -477,8 +477,9 @@ int mount_main(int argc, char **argv)
 
                // Get next fstab entry
 
-               if (!getmntent_r(fstab, mtcur, bb_common_bufsiz1,
-                                       sizeof(bb_common_bufsiz1)))
+               if (!getmntent_r(fstab, mtcur, bb_common_bufsiz1
+                                       + (mtcur==mtpair ? sizeof(bb_common_bufsiz1)/2 : 0),
+                               sizeof(bb_common_bufsiz1)/2))
                {
                        // Were we looking for something specific?