git: 63640b2f552c - main - automount(8): fix absolute path when creating a mountpoint

Robert Wing rew at FreeBSD.org
Wed Feb 17 10:09:51 UTC 2021


The branch main has been updated by rew:

URL: https://cgit.FreeBSD.org/src/commit/?id=63640b2f552c0476f50484635eb9888eafcd22dc

commit 63640b2f552c0476f50484635eb9888eafcd22dc
Author:     Robert Wing <rew at FreeBSD.org>
AuthorDate: 2021-02-17 09:22:23 +0000
Commit:     Robert Wing <rew at FreeBSD.org>
CommitDate: 2021-02-17 10:02:56 +0000

    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 at gmail.com
    Reviewed by:    trasz
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D27832
---
 usr.sbin/autofs/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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)


More information about the dev-commits-src-all mailing list