kevans 3758ef9ee4 jail_getid(3): validate jid string input
Currently, if jail_getid(3) is passed in a numeric string, it assumes that
this is a jid string and passes it back converted to an int without checking
that it's a valid/existing jid. This breaks consumers that might use
jail_getid(3) to see if it can trivially grab a jid from a name if that name
happens to be numeric but not actually the name/jid of the jail. Instead of
returning -1 for the jail not existing, it'll return the int version of the
input and the consumer will not fallback to trying other methods.

Pass the numeric input to jail_get(2) as the jid for validation, rather than
the name. This works well- the kernel enforces that jid=name if name is
numeric, so doing the safe thing and checking numeric input as a jid will
still DTRT based on the description of jail_getid.

Reported by:	Wes Maag
Reviewed by:	jamie, Wes Maag
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D20388
2019-05-24 01:28:07 +00:00
..
2019-05-01 18:54:27 +00:00
2019-05-20 18:07:45 +00:00
2019-02-26 05:59:22 +00:00
2019-04-02 12:50:01 +00:00
2019-04-22 18:38:54 +00:00
2019-05-13 17:53:03 +00:00
2018-03-29 19:43:29 +00:00
2019-01-10 14:35:23 +00:00
2019-01-10 14:35:23 +00:00
2018-11-04 16:08:59 +00:00
2019-02-25 18:22:20 +00:00
2018-03-21 14:37:04 +00:00
2018-10-12 05:27:58 +00:00
2018-06-27 19:29:15 +00:00
2018-09-19 07:05:31 +00:00
2019-04-15 03:32:01 +00:00
2018-09-20 09:26:10 +00:00
2019-04-14 00:06:49 +00:00
2018-09-19 07:06:20 +00:00
2018-09-20 09:31:27 +00:00
2019-03-05 14:47:15 +00:00
2018-09-22 13:17:30 +00:00
2019-05-06 20:20:21 +00:00
2018-06-17 18:05:27 +00:00
2018-12-29 21:18:01 +00:00
2019-04-22 18:38:54 +00:00