[cloud-init] Fixed incorrect interpretation of relative path for AuthorizedKeysFile (BZ #735521)

Andy Grimm arg at fedoraproject.org
Sat Mar 31 20:12:45 UTC 2012


commit 83d60c4decd690f1f3c0c10fc722fb3d3e84d761
Author: Andy Grimm <agrimm at gmail.com>
Date:   Sat Mar 31 15:54:53 2012 -0400

    Fixed incorrect interpretation of relative path for
    AuthorizedKeysFile (BZ #735521)

 cloud-init-0.6.3-lp970071.patch |   11 +++++++++++
 cloud-init.spec                 |    9 ++++++++-
 2 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/cloud-init-0.6.3-lp970071.patch b/cloud-init-0.6.3-lp970071.patch
new file mode 100644
index 0000000..0fe9376
--- /dev/null
+++ b/cloud-init-0.6.3-lp970071.patch
@@ -0,0 +1,11 @@
+--- cloud-init-0.6.3-bzr532.orig/cloudinit/SshUtil.py	2012-03-05 14:05:34.000000000 -0500
++++ cloud-init-0.6.3-bzr532/cloudinit/SshUtil.py	2012-03-31 15:21:30.365271359 -0400
+@@ -155,6 +155,8 @@
+         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
diff --git a/cloud-init.spec b/cloud-init.spec
index 585db44..bf19af3 100644
--- a/cloud-init.spec
+++ b/cloud-init.spec
@@ -2,7 +2,7 @@
 
 Name:           cloud-init
 Version:        0.6.3
-Release:        0.1.bzr532%{?dist}
+Release:        0.2.bzr532%{?dist}
 Summary:        Cloud instance init scripts
 
 Group:          System Environment/Base
@@ -16,6 +16,8 @@ Patch0:         cloud-init-0.6.3-fedora.patch
 # Make runparts() work on Fedora
 # https://bugs.launchpad.net/cloud-init/+bug/934404
 Patch1:         cloud-init-0.6.3-no-runparts.patch
+# https://bugs.launchpad.net/cloud-init/+bug/970071
+Patch2:         cloud-init-0.6.3-lp970071.patch
 
 BuildArch:      noarch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -50,6 +52,7 @@ ssh keys and to let the user run various scripts.
 %setup -q -n %{name}-%{version}-bzr532
 %patch0 -p0
 %patch1 -p0
+%patch2 -p1
 
 cp -p %{SOURCE2} README.fedora
 
@@ -131,6 +134,10 @@ fi
 
 
 %changelog
+* Sat Mar 31 2012 Andy Grimm <agrimm at gmail.com> - 0.6.3-0.2.bzr532
+- Fixed incorrect interpretation of relative path for
+  AuthorizedKeysFile (BZ #735521)
+
 * Mon Mar  5 2012 Garrett Holmstrom <gholms at fedoraproject.org> - 0.6.3-0.1.bzr532
 - Rebased against upstream rev 532
 - Fixed runparts() incompatibility with Fedora


More information about the scm-commits mailing list