# HG changeset patch # User Franz Glasner # Date 1714722098 -7200 # Node ID 071f24359eef81fc7c882b4090d4b099ad6e9ad9 # Parent a2011285f054fa556e0dc257c7f6d0677e9a5378 Move "_ensure_no_optios()" into common.subr diff -r a2011285f054 -r 071f24359eef sbin/ftjail --- a/sbin/ftjail Fri May 03 09:35:09 2024 +0200 +++ b/sbin/ftjail Fri May 03 09:41:38 2024 +0200 @@ -56,30 +56,13 @@ filesystem. ' -# Reset to standard umask -umask 0022 + +_p_datadir="$(dirname "$0")"/../share/local-bsdtools +. "${_p_datadir}/common.subr" -#: -#: Ensure that no command line options are given -#: -#: Args: -#: $@: -#: -#: Exit: -#: 2: If formally `getopts` finds options in "$@" -#: -#: Return: -#: - 0 -#: -_ensure_no_options() { - local _opt - - while getopts ":" _opt ; do - [ "${_opt}" = '?' ] && { echo "ERROR: no option allowed" 1>&2; exit 2; } - done - return 0 -} +# Reset to standard umask +umask 0022 _get_dataset_for_mountpoint() { diff -r a2011285f054 -r 071f24359eef share/local-bsdtools/common.subr --- a/share/local-bsdtools/common.subr Fri May 03 09:35:09 2024 +0200 +++ b/share/local-bsdtools/common.subr Fri May 03 09:41:38 2024 +0200 @@ -10,6 +10,29 @@ #: :ID: @(#)@@SIMPLEVERSIONTAG@@ #: + +#: +#: Ensure that no command line options are given +#: +#: Args: +#: $@: +#: +#: Exit: +#: 2: If formally `getopts` finds options in "$@" +#: +#: Return: +#: - 0 +#: +_ensure_no_options() { + local _opt + + while getopts ":" _opt ; do + [ "${_opt}" = '?' ] && { echo "ERROR: no option allowed" 1>&2; exit 2; } + done + return 0 +} + + #: #: Determine some important dataset properties that are set locally #: