diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2003-07-03 22:41:41 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2003-07-03 22:41:41 +0000 |
commit | 68c4ff61328d01e604a97f41a255784b3ba007b2 (patch) | |
tree | 7424873456d7982920c124a4f0a56cb7140ca8c8 /sbin/mount_cd9660/mount_cd9660.c | |
parent | f231113e2426ef83d1f4662298c597f2d2719ed5 (diff) |
use realpath() in helpers instead of doing it ourselves every time.
also fixes pr1662. from otto moerbeek
Diffstat (limited to 'sbin/mount_cd9660/mount_cd9660.c')
-rw-r--r-- | sbin/mount_cd9660/mount_cd9660.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sbin/mount_cd9660/mount_cd9660.c b/sbin/mount_cd9660/mount_cd9660.c index ffc0778bca5..e2ee9a086d2 100644 --- a/sbin/mount_cd9660/mount_cd9660.c +++ b/sbin/mount_cd9660/mount_cd9660.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_cd9660.c,v 1.15 2003/06/11 06:22:13 deraadt Exp $ */ +/* $OpenBSD: mount_cd9660.c,v 1.16 2003/07/03 22:41:40 tedu Exp $ */ /* $NetBSD: mount_cd9660.c,v 1.3 1996/04/13 01:31:08 jtc Exp $ */ /* @@ -45,7 +45,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)mount_cd9660.c 8.4 (Berkeley) 3/27/94"; #else -static char rcsid[] = "$OpenBSD: mount_cd9660.c,v 1.15 2003/06/11 06:22:13 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: mount_cd9660.c,v 1.16 2003/07/03 22:41:40 tedu Exp $"; #endif #endif /* not lint */ @@ -75,7 +75,7 @@ main(int argc, char *argv[]) { struct iso_args args; int ch, mntflags, opts; - char *dev, *dir; + char *dev, dir[MAXPATHLEN]; mntflags = opts = 0; while ((ch = getopt(argc, argv, "egjo:R")) != -1) @@ -106,7 +106,8 @@ main(int argc, char *argv[]) usage(); dev = argv[0]; - dir = argv[1]; + if (realpath(argv[1], dir) == NULL) + err(1, "realpath %s", dir); #define DEFAULT_ROOTUID -2 args.fspec = dev; |