Mount (2.8a from redhat 5.2) always reports lineno 0 for errors in an fstab: To reproduce: Damage the /etc/fstab for e.g. /mnt/floppy by adding an aditional nonsense field before the options, the try to mount: prompt> mount /mnt/floppy [mntent]: line 0 in /etc/fstab is bad mount: can't find /mnt/floppy in /etc/mtab or /etc/fstab prompt> After applying this one line patch the correct lineno is reported: prompt> mount /mnt/floppy [mntent]: line 7 in /etc/fstab is bad mount: can't find /mnt/floppy in /etc/mtab or /etc/fstab prompt> ====patch follows:=========== *** mntent.c.old Sat May 29 12:51:22 1999 --- mntent.c Sat May 29 12:51:14 1999 *************** *** 148,157 **** --- 148,158 ---- /* read the next non-blank non-comment line */ do { if (fgets (buf, sizeof(buf), mfp->mntent_fp) == NULL) return NULL; + mfp->mntent_lineno++; s = index (buf, '\n'); if (s == NULL) { /* extremely long line - assume file was corrupted */ mfp->mntent_errs = 1;
This is fixed in util-linux-2.9o.