git: 60848a08b093 - main - examples/jails: Allow any character in interface names

Devin Teske <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a890700.376b1.1fd20197__17036.9603367121$1787365142$gmane$org@gitrepo.freebsd.org>
The branch main has been updated by dteske:

URL: https://cgit.FreeBSD.org/src/commit/?id=60848a08b0931abfdfb812fece93258d47377541

commit 60848a08b0931abfdfb812fece93258d47377541
Author:     Jose Luis Duran <[email protected]>
AuthorDate: 2026-08-22 02:12:24 +0000
Commit:     Devin Teske <[email protected]>
CommitDate: 2026-08-22 02:12:24 +0000

    examples/jails: Allow any character in interface names
    
    Interface names have no limitations on the allowed character set, only
    a length restriction.
    
    Widen the allowed character set for interface names to include any
    printable character.
    
    PR:     290916
    Reviewed by:    dteske
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D53865
---
 share/examples/jails/jib |  8 ++++----
 share/examples/jails/jng | 12 ++++++------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/share/examples/jails/jib b/share/examples/jails/jib
index a4de22da2b49..44d53c44bf11 100755
--- a/share/examples/jails/jib
+++ b/share/examples/jails/jib
@@ -7,7 +7,7 @@
 ############################################################ IDENT(1)
 #
 # $Title: if_bridge(4) management script for vnet jails $
-# $Version: 9.0 $
+# $Version: 9.1 $
 #
 ############################################################ INFORMATION
 #
@@ -111,7 +111,7 @@
 #
 ############################################################ GLOBALS
 
-VERSION='$Version: 9.0 $'
+VERSION='$Version: 9.1 $'
 
 pgm="${0##*/}" # Program basename
 
@@ -258,7 +258,7 @@ jib_addm()
 	shift $(( $OPTIND - 1 ))
 
 	local name="$1"
-	[ "${name:-x}" = "${name#*[!0-9a-zA-Z_]}" -a $# -gt 1 ] ||
+	[ "${name:-x}" = "${name#*[![:print:]]}" -a $# -gt 1 ] ||
 		action_usage addm # NOTREACHED
 	shift 1 # name
 
@@ -368,7 +368,7 @@ jib_destroy()
 	done
 	shift $(( $OPTIND -1 ))
 	local name="$1"
-	[ "${name:-x}" = "${name#*[!0-9a-zA-Z_]}" -a $# -eq 1 ] ||
+	[ "${name:-x}" = "${name#*[![:print:]]}" -a $# -eq 1 ] ||
 		action_usage destroy # NOTREACHED
 	mustberoot_to_continue
 	jib_show "$name" | xargs -rn1 -I eiface ifconfig eiface destroy
diff --git a/share/examples/jails/jng b/share/examples/jails/jng
index e8d24f3d00ab..48dc3eb67967 100755
--- a/share/examples/jails/jng
+++ b/share/examples/jails/jng
@@ -7,7 +7,7 @@
 ############################################################ IDENT(1)
 #
 # $Title: netgraph(4) management script for vnet jails $
-# $Version: 9.2 $
+# $Version: 9.3 $
 #
 ############################################################ INFORMATION
 #
@@ -138,7 +138,7 @@ NG_BRIDGE_MAX_STALENESS=4294967295
 
 ############################################################ GLOBALS
 
-VERSION='$Version: 9.2 $'
+VERSION='$Version: 9.3 $'
 
 pgm="${0##*/}" # Program basename
 
@@ -410,7 +410,7 @@ jng_bridge()
 	[ $# -gt 0 ] || action_usage bridge "too few arguments" # NOTREACHED
 
 	local name="$1"
-	[ "${name:-x}" = "${name#*[!0-9a-zA-Z_]}" ] ||
+	[ "${name:-x}" = "${name#*[![:print:]]}" ] ||
 		action_usage bridge "invalid bridge name: %s" "$name"
 		# NOTREACHED
 	shift 1 # name
@@ -543,7 +543,7 @@ jng_pin()
 	mustberoot_to_continue
 
 	for name in "$@"; do
-		[ "${name:-x}" = "${name#*[!0-9a-zA-Z_]}" ] ||
+		[ "${name:-x}" = "${name#*[![:print:]]}" ] ||
 			action_usage pin "invalid name: %s" "$name"
 			# NOTREACHED
 		for jiface in $( jexec "$name" ifconfig -l 2> /dev/null )
@@ -650,7 +650,7 @@ jng_shutdown()
 
 	local name
 	for name in "$@"; do
-		[ "${name:-x}" = "${name#*[!0-9a-zA-Z_]}" ] ||
+		[ "${name:-x}" = "${name#*[![:print:]]}" ] ||
 			action_usage shutdown "invalid name: %s" "$name"
 			# NOTREACHED
 		jng_show "$name" | xargs -rn1 -I jiface ngctl shutdown jiface:
@@ -697,7 +697,7 @@ jng_stats()
 
 	local now="$( date +%s )"
 	for name in "$@"; do
-		[ "${name:-x}" = "${name#*[!0-9a-zA-Z_]}" ] ||
+		[ "${name:-x}" = "${name#*[![:print:]]}" ] ||
 			action_usage stats "invalid name: %s" "$name"
 			# NOTREACHED
 		if ifconfig -l | xargs -n1 2> /dev/null | fgrep -qw "$name"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.