Commit graph

61 commits

Author SHA1 Message Date
Edward Tomasz Napierala bd9325a169 Add the "autoro" flag to /media. This makes it attempt to mount
it read-only instead of just failing if the media is write-protected.

The /net doesn't seem to require the flag.

MFC after:	2 weeks
Relnotes:	yes
Sponsored by:	DARPA, AFRL
2018-08-14 13:52:08 +00:00
Brad Davis 0ab0a723ed Move autofs related configs to usr.sbin/autofs/
This is prep for pkgbase to have config files tagged as such.

Approved by:	will (mentor)
Differential Revision:	https://reviews.freebsd.org/D16492
2018-08-04 22:41:17 +00:00
Edward Tomasz Napierala abdd394564 Add SPDX tags for automount(8) et al.
MFC after:	2 weeks
2018-01-24 16:39:02 +00:00
Bryan Drewery ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Benjamin Kaduk fe8b4983b4 Fix mdoc typo in auto_master.5
There needs to be a space after the no-space macro in order for it
to be interpreted.

PR:		221986
Submitted by:	Paul Townsend <pt@zendware.com>
2017-09-01 22:04:45 +00:00
Edward Tomasz Napierala d4acedbc64 Revert r317804; apparently I forgot the auto_master syntax.
MFC after:	2 weeks
2017-05-04 19:55:32 +00:00
Edward Tomasz Napierala 1638f1d3e4 Make automount(8) error out when the map name is missing.
MFC after:	2 weeks
2017-05-04 19:41:19 +00:00
Enji Cooper 64a0982bee usr.sbin: normalize paths using SRCTOP-relative paths or :H when possible
This simplifies make logic/output

MFC after:	1 month
Sponsored by:	Dell EMC Isilon
2017-03-04 11:38:03 +00:00
Warner Losh fbbd9655e5 Renumber copyright clause 4
Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by:	Jan Schaumann <jschauma@stevens.edu>
Pull Request:	https://github.com/freebsd/freebsd/pull/96
2017-02-28 23:42:47 +00:00
Edward Tomasz Napierala 8379360aeb Make autounmountd(8) not die when traced with "truss -p".
MFC after:	1 month
2016-11-02 08:12:37 +00:00
Edward Tomasz Napierala 275253770b Use proper argument order for calloc(3).
MFC after:	1 month
2016-09-14 11:20:58 +00:00
Baptiste Daroussin 7556d9b06a Remove usage of _WITH_GETLINE from usr.sbin 2016-07-30 01:10:05 +00:00
Edward Tomasz Napierala debc480e03 Add new unmount(2) flag, MNT_NONBUSY, to check whether there are
any open vnodes before proceeding. Make autounmound(8) use this flag.
Without it, even an unsuccessfull unmount causes filesystem flush,
which interferes with normal operation.

Reviewed by:	kib@
Approved by:	re (gjb@)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D7047
2016-07-07 09:03:57 +00:00
Glen Barber d60840138f MFH
Sponsored by:	The FreeBSD Foundation
2016-04-04 23:55:32 +00:00
Edward Tomasz Napierala e19462c33b Use the log_errno value passed to the function instead of the errno global
variable.

Suggested by:	Daniel Braniss
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-03-15 11:03:45 +00:00
Glen Barber 52259a98ad MFH
Sponsored by:	The FreeBSD Foundation
2016-03-02 16:14:46 +00:00
Edward Tomasz Napierala 4b9f77e45e Autofs is section 5, not 4.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-02-29 17:14:04 +00:00
Bryan Drewery bd18fd57db DIRDEPS_BUILD: Regenerate without local dependencies.
These are no longer needed after the recent 'beforebuild: depend' changes
and hooking DIRDEPS_BUILD into a subset of FAST_DEPEND which supports
skipping 'make depend'.

Sponsored by:	EMC / Isilon Storage Division
2016-02-24 17:20:11 +00:00
Glen Barber dd181aca6c Create a package for autofs(5)
Sponsored by:	The FreeBSD Foundation
2016-02-02 17:33:37 +00:00
Edward Tomasz Napierala 592d6e850a The <libutil.h> is an ordinary header file; should sort just like any other.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-01-24 18:11:36 +00:00
Bryan Drewery b1f92fa229 META MODE: Update dependencies with 'the-lot' and add missing directories.
This is not properly respecting WITHOUT or ARCH dependencies in target/.
Doing so requires a massive effort to rework targets/ to do so.  A
better approach will be to either include the SUBDIR Makefiles directly
and map to DIRDEPS or just dynamically lookup the SUBDIR.  These lose
the benefit of having a userland/lib, userland/libexec, etc, though and
results in a massive package.  The current implementation of targets/ is
very unmaintainable.

Currently rescue/rescue and sys/modules are still not connected.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 05:23:19 +00:00
Edward Tomasz Napierala 286c4906d6 Add -noauto autofs map, for automatic handling of fstab entries
marked "noauto".

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-03-13 12:44:46 +00:00
Edward Tomasz Napierala 52df29e6a5 Get executable direct maps to work.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-03-13 12:27:59 +00:00
Edward Tomasz Napierala cd3772d076 Rework the concat() algorithm to be correct in all cases.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-03-13 11:26:02 +00:00
Edward Tomasz Napierala 8ee4f5ef45 Make "automount -LL -o whatever" present options in the same order
as used by automountd(8).

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-03-12 12:36:08 +00:00
Edward Tomasz Napierala 4d58da13af Make concat() accept NULL arguments.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-03-12 12:17:15 +00:00
Edward Tomasz Napierala 5c16a48aec Options from auto_master must be appended to options from maps,
not prepended.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-03-12 12:14:11 +00:00
Edward Tomasz Napierala 7b74285f65 Fix typo.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-03-10 14:43:07 +00:00
Edward Tomasz Napierala 61d75c3229 Properly pass options for direct maps.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-03-10 12:25:05 +00:00
Edward Tomasz Napierala 12f1f00c30 Fix handling of direct maps, broken in r275756. Previously, running
automount(8) would unmount direct map trigger nodes every second time.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-03-10 11:59:33 +00:00
Edward Tomasz Napierala 7a20e4799e Refactor.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-03-10 09:53:15 +00:00
Edward Tomasz Napierala 5d44d58834 Erm, revert chunk committed by mistake.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-03-09 15:44:36 +00:00
Edward Tomasz Napierala 6d8e60c342 Make things more readable; no functional changes.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-03-09 15:31:33 +00:00
Edward Tomasz Napierala ef4b8dfad7 Remove some particularly bad code; no functional changes.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-03-09 15:20:12 +00:00
Edward Tomasz Napierala 8f0eba6738 Fix memory leak.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-03-09 13:21:00 +00:00
Edward Tomasz Napierala 5585582d14 Improve separated_concat() to properly handle the case of concatenating
"/" and "/foo".

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-03-09 13:00:59 +00:00
Edward Tomasz Napierala 1bc6f46438 Minor optimization/cleanup in node_path(); no functional changes.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-03-09 11:59:58 +00:00
Edward Tomasz Napierala 21cee0c5ce When there are no automounted filesystems, autounmountd(8) should wait
for filesystem event, instead of looping on a timeout.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-01-28 15:46:11 +00:00
Edward Tomasz Napierala 1e9685eeaa Improve documentation for autofs variables and executable maps;
also some markup fixes.

Differential Revision:	https://reviews.freebsd.org/D1447
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-01-09 10:59:49 +00:00
Edward Tomasz Napierala cc4026a45c Fix bug that made automount(8) never unmount stale autofs(5) mounts,
ie mounts for entries that were there in auto_master(5), and then
got removed.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2014-12-14 10:49:22 +00:00
Edward Tomasz Napierala da0ba09710 Fix spurious "child process X terminated with exit status 1" messages
from automountd(8).

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2014-12-14 10:37:17 +00:00
Edward Tomasz Napierala b468a673cf Fix markup.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2014-12-13 17:14:35 +00:00
Edward Tomasz Napierala d0ff09c9c0 Add "-media" autofs map, to access data on removable media, such as CD
drives or flash keys.  It can be enabled by uncommenting a single entry
in default /etc/auto_master.  It can also be easily modified to use
fuse-based filesystems instead of in-kernel ones.

There is still one deficiency - the mountpoints are permanent, they
don't disappear when user removes the media.  Fixing it needs some
autofs changes.

Differential Revision:	https://reviews.freebsd.org/D1210
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2014-12-10 14:36:44 +00:00
Baptiste Daroussin c6db8143ed Convert usr.sbin to LIBADD
Reduce overlinking
2014-11-25 16:57:27 +00:00
Edward Tomasz Napierala e3d5f1fe3b Implement "automount -c".
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2014-11-22 16:48:29 +00:00
Edward Tomasz Napierala a675fdbf5f Document use of wildcards (*) and ampersands (&) in autofs map files.
Differential Revision:	https://reviews.freebsd.org/D1199
Reviewed by:	wblock@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2014-11-21 15:49:41 +00:00
Edward Tomasz Napierala e202e3ffec Make the auto_master(5) man page clearer on how auto_master
and map files work together, and add example for smbfs.

Differential Revision:	https://reviews.freebsd.org/D1184
Reviewed by:	wblock@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2014-11-19 19:46:58 +00:00
Edward Tomasz Napierala c26264ace9 The "intr" option is NFS-specific; fix examples in auto_master(5).
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2014-11-17 12:36:01 +00:00
Edward Tomasz Napierala 75afaef266 Fix automountd(8) not to leave zombies.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2014-10-16 08:33:04 +00:00
Edward Tomasz Napierala 4cdc52bdef Make automountd(8) inform autofs(4) whether directory being handled can
have wildcards.  This makes it possible for autofs(4) to avoid requesting
automountd(8) action on access to nonexistent nodes - unless wildcards
are actually used.

Note that this change breaks ABI for automountd(8).

Tested by:	dhw@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2014-10-15 09:28:45 +00:00