Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 3141 - Patch for mount line counting for error report
Summary: Patch for mount line counting for error report
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: mount
Version: 5.2
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: David Lawrence
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 1999-05-29 13:17 UTC by tom.vijlbrief
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 1999-05-31 16:13:05 UTC

Attachments (Terms of Use)

Description tom.vijlbrief 1999-05-29 13:17:41 UTC
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

prompt> mount /mnt/floppy
[mntent]: line 0 in /etc/fstab is bad
mount: can't find /mnt/floppy in /etc/mtab or /etc/fstab

After applying this one line patch the correct lineno is

prompt> mount /mnt/floppy
[mntent]: line 7 in /etc/fstab is bad
mount: can't find /mnt/floppy in /etc/mtab or /etc/fstab

====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;

Comment 1 Jeff Johnson 1999-05-31 16:13:59 UTC
This is fixed in util-linux-2.9o.

Note You need to log in before you can comment on or make changes to this bug.