FreeBSD Bugzilla – Attachment 164084 Details for
Bug 204897
[jail] Jail names cannot start with a '0', resulting in 'jail: name cannot be numeric (unless it is the jid)'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
check for non-numeric or canonical jid
jail.diff (text/plain), 858 bytes, created by
Jamie Gritton
on 2015-12-10 19:19:30 UTC
(
hide
)
Description:
check for non-numeric or canonical jid
Filename:
MIME Type:
Creator:
Jamie Gritton
Created:
2015-12-10 19:19:30 UTC
Size:
858 bytes
patch
obsolete
>Index: sys/kern/kern_jail.c >=================================================================== >--- sys/kern/kern_jail.c (revision 292065) >+++ sys/kern/kern_jail.c (working copy) >@@ -1580,11 +1580,14 @@ > #endif > onamelen = namelen = 0; > if (name != NULL) { >- /* Give a default name of the jid. */ >+ /* Give a default name of the jid. Also allow the name to be >+ * explicitly the jid - but not any other number, and only in >+ * normal form (no leading space/zero/etc). >+ */ > if (name[0] == '\0') > snprintf(name = numbuf, sizeof(numbuf), "%d", jid); >- else if (*namelc == '0' || (strtoul(namelc, &p, 10) != jid && >- *p == '\0')) { >+ else if ((strtoul(namelc, &p, 10) != jid || >+ namelc[0] < '1' || namelc[0] > '9') && *p == '\0') { > error = EINVAL; > vfs_opterror(opts, > "name cannot be numeric (unless it is the jid)");
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 204897
:
163656
| 164084