From fcf4fb8cca8074ea3918b168763e330c7c336f9c Mon Sep 17 00:00:00 2001 From: dds Date: Fri, 11 Mar 2005 07:50:09 +0000 Subject: Ensure the configuration file is given with an absolute file path. --- usr.sbin/mount_portalfs/mount_portalfs.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'usr.sbin') diff --git a/usr.sbin/mount_portalfs/mount_portalfs.c b/usr.sbin/mount_portalfs/mount_portalfs.c index 49a11d0..376e827 100644 --- a/usr.sbin/mount_portalfs/mount_portalfs.c +++ b/usr.sbin/mount_portalfs/mount_portalfs.c @@ -136,6 +136,12 @@ main(argc, argv) * Get config file and mount point */ conf = argv[optind]; + if (conf[0] != '/') { + (void)fprintf(stderr, + "The configuration file must be specified" + "through an absolute file path.\n"); + exit(EX_USAGE); + } /* resolve the mountpoint with realpath(3) */ (void)checkpath(argv[optind+1], mountpt); -- cgit v1.1