This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/17273] New: getmntent() returns wrong default value for fs_passno
- From: "naszar at ya dot ru" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Fri, 15 Aug 2014 03:52:43 +0000
- Subject: [Bug libc/17273] New: getmntent() returns wrong default value for fs_passno
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=17273
Bug ID: 17273
Summary: getmntent() returns wrong default value for fs_passno
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: libc
Assignee: unassigned at sourceware dot org
Reporter: naszar at ya dot ru
CC: drepper.fsp at gmail dot com
Created attachment 7747
--> https://sourceware.org/bugzilla/attachment.cgi?id=7747&action=edit
simple test program
man 5 fstab states that if the fifth field (fs_freq) and the sixth field
(fs_passno) is not present a value of zero is returned (i.q.
fs_req=0,fs_passno=0 if there is no fifth and sixth field in /etc/fstab line).
If fourth field ends with '\n' all work fine. But if there is extra tabs or
spaces getmntent() returns garbage in ((struct mntent *) mp)->mnt_passno. It is
because in misc/mntent_r.c:__getmntent_r() at line 167 no checks that sscanf()
returns EOF or no striping for spaces and tabs like it done at line 164 for
example.
In my mashine attached test_mntent (for testtab which also attached) say:
mnt_dir=/home mnt_freq=42 mnt_passno=666
mnt_dir=/home mnt_freq=42 mnt_passno=666
but must:
mnt_dir=/home mnt_freq=42 mnt_passno=666
mnt_dir=/home mnt_freq=0 mnt_passno=0
--
You are receiving this mail because:
You are on the CC list for the bug.