On Mon, May 12, 2008 at 4:20 PM, Warren Belfer <[EMAIL PROTECTED]> wrote:
> Mike Gerdts wrote:
>> On Mon, May 12, 2008 at 3:20 PM, Terry Smith <[EMAIL PROTECTED]> wrote:
>>> Hi I seem to have found a small problem with zoneadm
>>> I have configured a zone called "2" in this case.
>> Interesting.  Zones shouldn't be able to be named that.
>>>From <sys/zone.h>:
>> /*
>>  * Extended Regular expression (see regex(5)) which matches all valid zone
>>  * names.
>>  */
>> #define ZONENAME_REGEXP         "[a-zA-Z0-9][-_.a-zA-Z0-9]{0,62}"
> Hi,
> Actually, this allows zone names to start with either
> [a-z], [A-Z] or [0-9]
> followed by 0 to 62 of any of [-_.a-zA-Z0-9]
> So from this it would seem that "2" is a valid, but perhaps unexpected zone 
> name.
> HTH,
> Warren

Yep - I misread it and the code that does the checking.  Either
libzonecfg needs to change the notion of what a valid zone name is or
it needs to look up by name before looking up by id.  Looking up by
name before by id is consistent with the behavior required by SUSv2
for commands such as chown(1)[1].

1. http://www.opengroup.org/onlinepubs/7990989775/xcu/chown.html

I would think that all numeric zone names should be discouraged as
they will just invite this type of problem.

Mike Gerdts
zones-discuss mailing list

Reply via email to