From 62da5ec11c60c42383da04ad5c73a9166046873e Mon Sep 17 00:00:00 2001 From: martijn Date: Wed, 11 Jul 2018 07:03:03 +0000 Subject: [PATCH] Using resolved after realpath(3) has failed is dangerous. Don't do it! Minor tweak and OK jca@ OK beck@ deraadt@ --- sbin/mount_tmpfs/mount_tmpfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/mount_tmpfs/mount_tmpfs.c b/sbin/mount_tmpfs/mount_tmpfs.c index 4f61a397be0..98d84f38fe4 100644 --- a/sbin/mount_tmpfs/mount_tmpfs.c +++ b/sbin/mount_tmpfs/mount_tmpfs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_tmpfs.c,v 1.6 2016/06/06 17:09:03 espie Exp $ */ +/* $OpenBSD: mount_tmpfs.c,v 1.7 2018/07/11 07:03:03 martijn Exp $ */ /* $NetBSD: mount_tmpfs.c,v 1.24 2008/08/05 20:57:45 pooka Exp $ */ /* @@ -241,9 +241,9 @@ pathadj(const char *input, char *adjusted) { if (realpath(input, adjusted) == NULL) - warn("Warning: realpath %s", input); + err(1, "realpath %s", input); if (strncmp(input, adjusted, PATH_MAX)) { - warnx("\"%s\" is a non-resolved or relative path.", input); + warnx("\"%s\" is a relative path.", input); warnx("using \"%s\" instead.", adjusted); } } -- 2.20.1