[lxc-devel] [PATCH] lxc-download: POSIX doesn't specify -f for chown

Serge Hallyn serge.hallyn at ubuntu.com
Wed Jan 15 14:48:52 UTC 2014


Quoting Stéphane Graber (stgraber at ubuntu.com):
> Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>

and you were already sending output to /dev/null anyway :)

Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>

Though I would also point out that the man page shows options
coming before the [OWNER][:[GROUP]], which implies there might
be implementations where putting $LXC_MAPPED_UID before the -R
might break.  Not sure.

> ---
>  templates/lxc-download.in | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/templates/lxc-download.in b/templates/lxc-download.in
> index c318041..04f5846 100644
> --- a/templates/lxc-download.in
> +++ b/templates/lxc-download.in
> @@ -396,7 +396,7 @@ if [ "$DOWNLOAD_USE_CACHE" = "false" ]; then
>          echo $DOWNLOAD_BUILD > $LXC_CACHE_PATH/build_id
>  
>          if [ -n "$LXC_MAPPED_UID" ] && [ "$LXC_MAPPED_UID" != "-1" ]; then
> -            chown $LXC_MAPPED_UID -Rf $LXC_CACHE_BASE >/dev/null 2>&1 || true
> +            chown $LXC_MAPPED_UID -R $LXC_CACHE_BASE >/dev/null 2>&1 || true
>          fi
>          echo "The image cache is now ready"
>      fi
> @@ -489,7 +489,7 @@ for file in $TEMPLATE_FILES; do
>  done
>  
>  if [ -n "$LXC_MAPPED_UID" ] && [ "$LXC_MAPPED_UID" != "-1" ]; then
> -    chown $LXC_MAPPED_UID -f $LXC_PATH/config $LXC_PATH/fstab || true
> +    chown $LXC_MAPPED_UID $LXC_PATH/config $LXC_PATH/fstab >/dev/null 2>&1 || true
>  fi
>  
>  if [ -e "$(relevant_file create-message)" ]; then
> -- 
> 1.8.5.2
> 
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel


More information about the lxc-devel mailing list