[lxc-devel] [PATCH] lxc-attach: elevate specific privileges

Serge Hallyn serge.hallyn at ubuntu.com
Wed Nov 20 16:57:01 UTC 2013


Quoting Nikola Kotur (kotnick at gmail.com):
>  	switch (c) {
> -	case 'e': elevated_privileges = 1; break;
> +	case 'e':
> +		ret = lxc_fill_elevated_privileges(arg, &elevated_privileges);
> +		if (ret)
> +			return -1;
> +		break;
>  	case 'R': remount_sys_proc = 1; break;
>  	case 'a':
>  		new_personality = lxc_config_parse_arch(arg);
> @@ -102,7 +106,7 @@ static int my_parser(struct lxc_arguments* args, int c, char* arg)
>  		if (ret)
>  			return -1;
>  		/* -s implies -e */
> -		elevated_privileges = 1;
> +		lxc_fill_elevated_privileges(NULL, &elevated_privileges);

Note I've applied it as is, and this failure shouldn't ever happen
anyway, but you're not checking return value of
lxc_fill_elevated_privileges() here.

-serge




More information about the lxc-devel mailing list