Accepting request 174647 from Base:System

support relative path for authorized_keys file, backport fix from upstream version 0.7.1 (bnc#818306)

OBS-URL: https://build.opensuse.org/request/show/174647
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/cloud-init?expand=0&rev=2
This commit is contained in:
Stephan Kulow 2013-05-07 13:10:36 +00:00 committed by Git OBS Bridge
parent 83245c4ac8
commit 04e3dd1a0d
4 changed files with 32 additions and 7 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon May 6 14:50:17 UTC 2013 - jdsn@suse.de
- support relative path for authorized_keys file
backport fix from upstream version 0.7.1 (bnc#818306)
-------------------------------------------------------------------
Wed Sep 19 12:42:07 UTC 2012 - jdsn@suse.de

View File

@ -51,7 +51,7 @@ case "$1" in
stop)
echo -n "Shutting down cloud-init "
killproc $CLOUDINIT_BIN
killall `basename $CLOUDINIT_BIN`
rc_status -v
;;
@ -63,7 +63,7 @@ case "$1" in
status)
echo -n "Checking for service cloud-init"
[ -e /root/.ssh/authorized_keys ]
[ -e /root/.ssh/authorized_keys ]
rc_status -v
;;
*)

View File

@ -1,7 +1,7 @@
#
# spec file for package cloud-init
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -21,20 +21,25 @@
Name: %{component}
Version: 0.6.3
Release: 0
License: GPL-3.0
Summary: Cloud node initialization tool
Url: http://launchpad.net/cloud-init/
License: GPL-3.0
Group: System/Management
Url: http://launchpad.net/cloud-init/
Source0: %{component}-%{version}.tar.bz2
Source1: cloud.cfg.suse
Source2: cloud-init.init
Patch0: drop-MAAS-datasource.diff
Patch1: drop-python27-only-code.diff
Patch2: drop-ubuntu-default-username.diff
Requires: python-yaml python-cheetah python-boto python-xml
# backport fix from upstream version 0.7.1 for bug bnc#818306
Patch3: relative-authorized-keys-file.diff
Requires: python-boto
Requires: python-cheetah
Requires: python-xml
Requires: python-yaml
BuildRequires: filesystem
BuildRequires: python-devel
BuildRequires: python-setuptools
BuildRequires: filesystem
#BuildRequires: python-distribute
BuildRequires: fdupes
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -67,6 +72,7 @@ Authors:
echo "ssh_genkeytypes: ['rsa', 'dsa']" >> %{S:1}
%endif
%patch2 -p1
%patch3 -p1
%build
python setup.py build

View File

@ -0,0 +1,13 @@
Index: cloud-init-0.6.3/cloudinit/SshUtil.py
===================================================================
--- cloud-init-0.6.3.orig/cloudinit/SshUtil.py
+++ cloud-init-0.6.3/cloudinit/SshUtil.py
@@ -155,6 +155,8 @@ def setup_user_keys(keys, user, key_pref
akeys = ssh_cfg.get("AuthorizedKeysFile", "%h/.ssh/authorized_keys")
akeys = akeys.replace("%h", pwent.pw_dir)
akeys = akeys.replace("%u", user)
+ if not akeys.startswith('/'):
+ akeys = os.path.join(pwent.pw_dir, akeys)
authorized_keys = akeys
except Exception:
authorized_keys = '%s/.ssh/authorized_keys' % pwent.pw_dir