aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Wing <rew@FreeBSD.org>2021-02-17 09:22:23 +0000
committerRobert Wing <rew@FreeBSD.org>2021-02-25 18:53:02 +0000
commitcf9829d98dc771f9ca0696e493dc3bb635999536 (patch)
tree60ae0442e00c829941d95f198baf2e39043e895a
parente2c9871f6a7ba8a14b2c377a860cfaf1adcdff83 (diff)
downloadsrc-cf9829d98dc771f9ca0696e493dc3bb635999536.tar.gz
src-cf9829d98dc771f9ca0696e493dc3bb635999536.zip
automount(8): fix absolute path when creating a mountpoint
When executing automount(8), it will attempt to create the directory where an autofs filesystem is to be mounted. Explicity set the root path for this directory to "/". This fixes the issue where the directory being created was being treated as a relative path instead of an absolute path (as expected). PR: 224601 Reported by: kusumi.tomohiro@gmail.com Reviewed by: trasz Differential Revision: https://reviews.freebsd.org/D27832 (cherry picked from commit 63640b2f552c0476f50484635eb9888eafcd22dc)
-rw-r--r--usr.sbin/autofs/common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/autofs/common.c b/usr.sbin/autofs/common.c
index a6ed90909ec9..7c8df4205a86 100644
--- a/usr.sbin/autofs/common.c
+++ b/usr.sbin/autofs/common.c
@@ -140,7 +140,7 @@ create_directory(const char *path)
*/
copy = tofree = checked_strdup(path + 1);
- partial = checked_strdup("");
+ partial = checked_strdup("/");
for (;;) {
component = strsep(&copy, "/");
if (component == NULL)