Summary: | [jail] Jail names cannot start with a '0', resulting in 'jail: name cannot be numeric (unless it is the jid)' | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Sergey Zakharchenko <doublef.mobile> | ||||||
Component: | kern | Assignee: | Jamie Gritton <jamie> | ||||||
Status: | Closed FIXED | ||||||||
Severity: | Affects Some People | CC: | jamie | ||||||
Priority: | --- | Keywords: | patch | ||||||
Version: | 10.2-RELEASE | ||||||||
Hardware: | Any | ||||||||
OS: | Any | ||||||||
Attachments: |
|
Description
Sergey Zakharchenko
2015-11-29 18:13:10 UTC
Created attachment 164084 [details]
check for non-numeric or canonical jid
I'm trying to remember a few years back, but I think the reason I checked for namelc[0] == '0' is to weed out leading zeroes (since the "!= jid" test will already catch a name of "0"). That was clearly not done right.
This patch will allow any name that's not fully numeric, such as your "0day" example, also the jid in normal form (no leading zero, space, '+'), but no other fully numeric names. I'll submit it shortly unless anyone sees some problem.
A commit references this bug: Author: jamie Date: Tue Dec 15 17:25:00 UTC 2015 New revision: 292277 URL: https://svnweb.freebsd.org/changeset/base/292277 Log: Fix jail name checking that disallowed anything that starts with '0'. The intention was to just limit leading zeroes on numeric names. That check is now improved to also catch the leading spaces and '+' that strtoul can pass through. PR: 204897 MFC after: 3 days Changes: head/sys/kern/kern_jail.c A commit references this bug: Author: jamie Date: Fri Dec 18 00:33:03 UTC 2015 New revision: 292415 URL: https://svnweb.freebsd.org/changeset/base/292415 Log: MFC r292277: Fix jail name checking that disallowed anything that starts with '0'. The intention was to just limit leading zeroes on numeric names. That check is now improved to also catch the leading spaces and '+' that strtoul can pass through. PR: 204897 Changes: _U stable/9/sys/ stable/9/sys/kern/kern_jail.c A commit references this bug: Author: jamie Date: Fri Dec 18 00:33:04 UTC 2015 New revision: 292416 URL: https://svnweb.freebsd.org/changeset/base/292416 Log: MFC r292277: Fix jail name checking that disallowed anything that starts with '0'. The intention was to just limit leading zeroes on numeric names. That check is now improved to also catch the leading spaces and '+' that strtoul can pass through. PR: 204897 Changes: _U stable/10/ stable/10/sys/kern/kern_jail.c |