aboutsummaryrefslogtreecommitdiff
path: root/src/rc/fstabinfo.c
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2016-06-07 04:31:48 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2016-06-10 17:16:37 -0500
commitb2c92b88cc6ce6d81444667efbc6d44542db1788 (patch)
treeb6047ba0c9e8f88c42936815fafb6833ee5616ff /src/rc/fstabinfo.c
parent1b32af17225a4b18ced7f4326727cbe8265e7fd2 (diff)
fstabinfo/mountinfo: ensure /etc/fstab exists before calling setmntent
This is based on a patch by A. Wilcox <awilfox.gentoo@foxkit.us>. X-Gentoo-Bug: 478226 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=478226 X-Gentoo-Bug: 478226 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=478226
Diffstat (limited to 'src/rc/fstabinfo.c')
-rw-r--r--src/rc/fstabinfo.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/rc/fstabinfo.c b/src/rc/fstabinfo.c
index bd2372d6..75c8bc2b 100644
--- a/src/rc/fstabinfo.c
+++ b/src/rc/fstabinfo.c
@@ -178,6 +178,9 @@ int main(int argc, char **argv)
FILE *fp;
#endif
+ /* fail if there is no /etc/fstab */
+ if (!exists("/etc/fstab"))
+ eerrorx("/etc/fstab does not exist");
/* Ensure that we are only quiet when explicitly told to be */
unsetenv("EINFO_QUIET");