Date: Tue, 26 Dec 2017 18:06:14 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 224601] autofs: Make automount(8) call chdir("/") before create_directory() Message-ID: <bug-224601-8@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D224601 Bug ID: 224601 Summary: autofs: Make automount(8) call chdir("/") before create_directory() Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Many People Priority: --- Component: bin Assignee: freebsd-bugs@FreeBSD.org Reporter: kusumi.tomohiro@gmail.com Created attachment 189116 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D189116&action= =3Dedit Fixes the issue. Unlike automountd where the daemon is daemonized or lesser-daemonized, an automount process isn't necessarily at /, and this results in creating unneeded directories at the current directory. In the example below, mounting autofs on /mnt/media fails because the command mkdirs mnt/media instead of /mnt/media. If /mnt/media already exists the command can mount autofs on /mnt/media, but it still mkdirs unneeded directories mnt/media. Calling chdir("/") before creation and restoring the directory after creation avoids this. -- [root@]~# automount -L /mnt/media -nosuid -media # indi= rect map referenced at /etc/auto_master:8 [root@]~# ls mnt ls: mnt: No such file or directory [root@]~# automount automount: cannot mount map -media on /mnt/media: No such file or directory [root@]~# mount | grep autofs [root@]~# ls mnt media [root@]~# tree mnt mnt `-- media --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-224601-8>