Remove risk of nfs_addmntent corrupting mtab
authorNeilBrown <neilb@suse.de>
Mon, 23 May 2011 12:19:57 +0000 (08:19 -0400)
committerSteve Dickson <steved@redhat.com>
Mon, 23 May 2011 12:25:00 +0000 (08:25 -0400)
commit7a802337bfc92d0b30fe94dbd0fa231990a26161
tree0c03426f83fbe838991549dffb2d7d3a4fabc820
parent56f537535190d034039570bafd9a0de71b79b8f1
Remove risk of nfs_addmntent corrupting mtab

nfs_addmntent is used to append directly to /etc/mtab.
If the write partially fail, e.g. due to RLIMIT_FSIZE,
truncate back to original size and return an error.

See also https://bugzilla.redhat.com/show_bug.cgi?id=697975
(CVE-2011-1749) CVE-2011-1749 nfs-utils: mount.nfs fails to anticipate RLIMIT_FSIZE

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Steve Dickson <steved@redhat.com>
support/nfs/nfs_mntent.c