[CRIU] Re: [PATCH v2 2/3] namespaces: parametrized namespace option introduced

Kinsbursky Stanislav skinsbursky at openvz.org
Tue Jan 31 03:01:49 EST 2012


30.01.2012 21:54, Pavel Emelyanov пишет:
>> +static int parse_ns_string(const char *ptr, unsigned int *flags)
>> +{
>> +	const char *end = ptr + strlen(ptr);
>> +
>> +	do {
>> +		if (strlen(ptr)<  3)
> This strlen is excessive. The strncmp will do the thing.

Yep. You right.
Will resend.

>> +			goto bad_ns;
>> +		if (ptr[3] != ','&&  ptr[3] != '\0')
>> +			goto bad_ns;
>> +		if (!strncmp(ptr, "uts", 3))
>> +			opts.namespaces_flags |= CLONE_NEWUTS;
>> +		else
>> +			goto bad_ns;
>> +		ptr += 4;
>> +	} while (ptr<  end);
>> +	return 0;
>> +
>> +bad_ns:
>> +	pr_err("Unknown namespace '%s'\n", ptr);
>> +	return -1;
>> +}


-- 
Best regards,
Stanislav Kinsbursky




More information about the CRIU mailing list