Page MenuHomeFreeBSD

examples/jails: Allow any character in interface names
Needs ReviewPublic

Authored by jlduran on Fri, Nov 21, 7:41 PM.
Tags
None
Referenced Files
F137321635: D53865.id166924.diff
Sat, Nov 22, 11:03 AM
F137316927: D53865.id.diff
Sat, Nov 22, 9:47 AM
F137312190: D53865.diff
Sat, Nov 22, 8:29 AM
Unknown Object (File)
Sat, Nov 22, 3:19 AM
Unknown Object (File)
Sat, Nov 22, 3:19 AM
Unknown Object (File)
Sat, Nov 22, 3:18 AM
Unknown Object (File)
Sat, Nov 22, 1:53 AM
Unknown Object (File)
Sat, Nov 22, 1:23 AM

Details

Reviewers
dteske
Group Reviewers
Jails
Summary

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

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 68791
Build 65674: arc lint + arc unit

Event Timeline

Include the same pattern in jib_destroy(), jng_shutdown(), and jng_stats().

Using tabs, spaces or newlines in interface names is just asking for trouble. A lot of the rc.d shell code is not properly written to deal with such intentional stupidity.

Using tabs, spaces or newlines in interface names is just asking for trouble. A lot of the rc.d shell code is not properly written to deal with such intentional stupidity.

Right, I agree, I believe isprint(3) does not include those...
Probably the original pattern stems from rc.subr (*[!a-zA-Z0-9_]). If I remember correctly, @dteske preferred creating jails using rc.conf and not jail.conf (a vague recollection of some YouTube video).

Interesting.

BastilleBSD has code to automatically sed ‘s/-/_/‘ for the /etc/rc.conf part when jail names contain a hyphen.

I would at least consider allowing (.) as they are very common when using vlan with interfaces.