[lxc-devel] [PATCH 1/8] templates: require running as root

Stéphane Graber stgraber at ubuntu.com
Sun Jul 21 08:43:59 UTC 2013


On Fri, Jul 19, 2013 at 02:26:48PM +0000, Serge Hallyn wrote:
> From: Serge Hallyn <serge.hallyn at ubuntu.com>
> 
> Up to now lxc-create ensured that you were running as root.  Now the
> templates which require root need to do it for themselves.  Templates
> which do mknod definately require root.
> 
> Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>

Acked-by: Stéphane Graber <stgraber at ubuntu.com>

> ---
>  templates/lxc-alpine.in | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/templates/lxc-alpine.in b/templates/lxc-alpine.in
> index be2a535..ce7226f 100644
> --- a/templates/lxc-alpine.in
> +++ b/templates/lxc-alpine.in
> @@ -250,6 +250,12 @@ default_path=@LXCPATH@
>  release=
>  arch=$(uname -m)
>  
> +# template mknods, requires root
> +if [ $(id -u) -ne 0 ]; then
> +   echo "$(basename $0): must be run as root" >&2
> +   exit 1
> +fi
> +
>  while [ $# -gt 0 ]; do
>      opt="$1"
>      shift
> -- 
> 1.8.3.2
> 
> 
> ------------------------------------------------------------------------------
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20130721/36a39577/attachment.pgp>


More information about the lxc-devel mailing list