View | Details | Raw Unified | Return to bug 204897 | Differences between
and this patch

Collapse All | Expand All

(-)sys/kern/kern_jail.c (-3 / +6 lines)
Lines 1580-1590 Link Here
1580
#endif
1580
#endif
1581
	onamelen = namelen = 0;
1581
	onamelen = namelen = 0;
1582
	if (name != NULL) {
1582
	if (name != NULL) {
1583
		/* Give a default name of the jid. */
1583
		/* Give a default name of the jid.  Also allow the name to be
1584
		 * explicitly the jid - but not any other number, and only in
1585
		 * normal form (no leading space/zero/etc).
1586
		 */
1584
		if (name[0] == '\0')
1587
		if (name[0] == '\0')
1585
			snprintf(name = numbuf, sizeof(numbuf), "%d", jid);
1588
			snprintf(name = numbuf, sizeof(numbuf), "%d", jid);
1586
		else if (*namelc == '0' || (strtoul(namelc, &p, 10) != jid &&
1589
		else if ((strtoul(namelc, &p, 10) != jid ||
1587
		    *p == '\0')) {
1590
			  namelc[0] < '1' || namelc[0] > '9') && *p == '\0') {
1588
			error = EINVAL;
1591
			error = EINVAL;
1589
			vfs_opterror(opts,
1592
			vfs_opterror(opts,
1590
			    "name cannot be numeric (unless it is the jid)");
1593
			    "name cannot be numeric (unless it is the jid)");

Return to bug 204897