That does, in fact, catch my case of setting autodev on with a
non-systemd container (F14 in my case).  That case is shot.  Good catch.

Regards,
Mike

On Tue, 2013-01-08 at 09:08 +0800, Alexander Vladimirov wrote:
> According to docs, mknod clears each permission bit whose
> corresponding bit in the process umask is set, so we should fix it
> before creating device nodes.
> ---
>  src/lxc/conf.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/lxc/conf.c b/src/lxc/conf.c
> index 85d72c9..c0a270f 100644
> --- a/src/lxc/conf.c
> +++ b/src/lxc/conf.c
> @@ -963,6 +963,7 @@ static int setup_autodev(char *root)
>       struct lxc_devs *d;
>       char path[MAXPATHLEN];
>       int i;
> +     mode_t cmask;
>  
>       INFO("Creating initial consoles under %s/dev\n", root);
>  
> @@ -974,6 +975,7 @@ static int setup_autodev(char *root)
>               run_makedev(path);
>  
>       INFO("Populating /dev under %s\n", root);
> +     cmask = umask(S_IXUSR | S_IXGRP | S_IXOTH);
>       for (i = 0; i < sizeof(lxc_devs) / sizeof(lxc_devs[0]); i++) {
>               d = &lxc_devs[i];
>               ret = snprintf(path, MAXPATHLEN, "%s/dev/%s", root, d->name);
> @@ -985,6 +987,7 @@ static int setup_autodev(char *root)
>                       return -1;
>               }
>       }
> +     umask(cmask);
>  
>       INFO("Populated /dev under %s\n", root);
>       return 0;
> -- 
> 1.8.1
> 
> 
> ------------------------------------------------------------------------------
> Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
> and more. Get SQL Server skills now (including 2012) with LearnDevNow -
> 200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
> SALE $99.99 this month only - learn more at:
> http://p.sf.net/sfu/learnmore_122512
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel
> 

-- 
Michael H. Warfield (AI4NB) | (770) 985-6132 |  m...@wittsend.com
   /\/\|=mhw=|\/\/          | (678) 463-0932 |  http://www.wittsend.com/mhw/
   NIC whois: MHW9          | An optimist believes we live in the best of all
 PGP Key: 0x674627FF        | possible worlds.  A pessimist is sure of it!

Attachment: signature.asc
Description: This is a digitally signed message part

------------------------------------------------------------------------------
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512
_______________________________________________
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel

Reply via email to