New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two typos in gentoo template for auth_key #379

Closed
nougad opened this Issue Dec 15, 2014 · 4 comments

Comments

3 participants
@nougad

nougad commented Dec 15, 2014

in https://github.com/lxc/lxc/blob/master/templates/lxc-gentoo.in#L644 the file name which should be cat is missing (should be "${auth_key}"

in https://github.com/lxc/lxc/blob/master/templates/lxc-gentoo.in#L778 the parameter is called auth_key but the case statement uses --auth-key (with -).

--- /usr/share/lxc/templates/lxc-gentoo 2014-12-15 21:49:41.383135672 +0100
+++ /tmp/lxc-gentoo     2014-12-15 21:52:16.000064629 +0100
@@ -641,7 +641,7 @@
     if [[ -r "${auth_key}" ]]; then
         printf " deploying auth_key %s for user %s ...\n" "${auth_key}" "${user}"
         mkdir -p "${rootfs}/${auth_home}/.ssh"
-        cat "${auth_key}" >> "${rootfs}/${auth_home}/.ssh/authorized_keys"
+        cat >> "${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
@@ -775,7 +775,7 @@
 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"
@CameronNemo

This comment has been minimized.

Show comment
Hide comment
@CameronNemo

CameronNemo Dec 15, 2014

Contributor

I think you reversed the order of the commits when you generated this patch.

Contributor

CameronNemo commented Dec 15, 2014

I think you reversed the order of the commits when you generated this patch.

@stgraber

This comment has been minimized.

Show comment
Hide comment
@stgraber

stgraber Jan 26, 2015

Member

Would you mind sending an updated patch or a pull request with that change and the required Signed-off-by line (per CONTRIBUTING)?

Thanks

Member

stgraber commented Jan 26, 2015

Would you mind sending an updated patch or a pull request with that change and the required Signed-off-by line (per CONTRIBUTING)?

Thanks

@nougad

This comment has been minimized.

Show comment
Hide comment
@nougad

nougad Feb 1, 2015

Hi @stgraber here the updated patch:

--- /usr/share/lxc/templates/lxc-gentoo 2014-12-15 21:49:41.383135672 +0100
+++ /tmp/lxc-gentoo     2014-12-15 21:52:16.000064629 +0100
@@ -641,7 +641,7 @@
     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
@@ -775,7 +775,7 @@
 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"

nougad commented Feb 1, 2015

Hi @stgraber here the updated patch:

--- /usr/share/lxc/templates/lxc-gentoo 2014-12-15 21:49:41.383135672 +0100
+++ /tmp/lxc-gentoo     2014-12-15 21:52:16.000064629 +0100
@@ -641,7 +641,7 @@
     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
@@ -775,7 +775,7 @@
 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"
@stgraber

This comment has been minimized.

Show comment
Hide comment
@stgraber

stgraber Feb 2, 2015

Member

Thanks, though again, can you please give us the required Signed-off-by line? otherwise we can't include that change.

Member

stgraber commented Feb 2, 2015

Thanks, though again, can you please give us the required Signed-off-by line? otherwise we can't include that change.

@stgraber stgraber closed this in 7785e39 Mar 13, 2015

stgraber added a commit that referenced this issue Mar 16, 2015

Fix the --auth-key flag in gentoo template
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.

Closes #379

Signed-off-by: Erik Mackdanz <erikmack@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>

stgraber added a commit that referenced this issue Aug 14, 2015

Fix the --auth-key flag in gentoo template
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.

Closes #379

Signed-off-by: Erik Mackdanz <erikmack@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>

z-image pushed a commit to z-image/lxc that referenced this issue Oct 16, 2016

Fix the --auth-key flag in gentoo template
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.

Closes #379

Signed-off-by: Erik Mackdanz <erikmack@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment