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
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D27832
This commit is contained in:
Robert Wing 2021-02-17 00:22:23 -09:00
parent 02af91c52e
commit 63640b2f55

View File

@ -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)