[lxc-devel] [PATCH] Fix the --auth-key flag in gentoo template

Stéphane Graber stgraber at ubuntu.com
Fri Mar 13 23:21:42 UTC 2015


On Thu, Mar 12, 2015 at 04:36:18PM -0500, Erik Mackdanz wrote:
> Fix a typo in the getopt call,  should be auth-key not auth_key.
> Also provide the argument to cat, so the script doesn't hang waiting
> on stdin.  This fixes Github issue #379.
> 
> Signed-off-by: Erik Mackdanz <erikmack at gmail.com>

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

> ---
>  templates/lxc-gentoo.in | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/templates/lxc-gentoo.in b/templates/lxc-gentoo.in
> index bcaca4e..0a76766 100644
> --- a/templates/lxc-gentoo.in
> +++ b/templates/lxc-gentoo.in
> @@ -641,11 +641,11 @@ container_auth()
>      if [[ -r "${auth_key}" ]]; then
>          printf " deploying auth_key %s for user %s ...\n" "${auth_key}" "${user}"
>          mkdir -p "${rootfs}/${auth_home}/.ssh"
> -        cat >> "${rootfs}/${auth_home}/.ssh/authorized_keys"
> +        cat "${auth_key}" >> "${rootfs}/${auth_home}/.ssh/authorized_keys"
>          chroot "${rootfs}" chown "${user}:" "${auth_home}/.ssh/authorized_keys"
>          printf "  => inserted public key in %s/.ssh/authorized_keys\n" "${auth_home}"
>          [[ -z "${forced_password}" ]] && unset password
> -        store_user_message "${user} has the ssh key you gived us"
> +        store_user_message "${user} has the ssh key you gave us"
>      fi
>  
>      if [[ -n "${password}" ]]; then
> @@ -782,7 +782,7 @@ user="root"
>  password="toor"
>  tty=1
>  settings="common"
> -options=$(getopt -o hp:n:a:FcPv:t:S:u:w:s:m: -l help,rootfs:,path:,name:,arch:,flush-cache,cache-only,private-portage,variant:,portage-dir:,tarball:,auth_key:,user:,autologin,password:,settings:,mirror:,tty: -- "$@")
> +options=$(getopt -o hp:n:a:FcPv:t:S:u:w:s:m: -l help,rootfs:,path:,name:,arch:,flush-cache,cache-only,private-portage,variant:,portage-dir:,tarball:,auth-key:,user:,autologin,password:,settings:,mirror:,tty: -- "$@")
>  
>  eval set -- "$options"
>  
> -- 
> 2.3.1
> 
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/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: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20150313/637abede/attachment.sig>


More information about the lxc-devel mailing list