- Add 0001-Throw-error-if-SSH-keys-could-not-be-written.patch:

Don't silently ignore if the SSH key could not be written
  [boo#1159232]

OBS-URL: https://build.opensuse.org/package/show/devel:kubic:ignition/ignition?expand=0&rev=36
This commit is contained in:
Ignaz Forster 2020-01-08 18:08:37 +00:00 committed by Git OBS Bridge
parent 29b985c591
commit 7f434f12b7
3 changed files with 39 additions and 1 deletions

View File

@ -0,0 +1,29 @@
commit 7d5235ce7ab91ec21e50f09295dd40fd59a98005
Author: Ignaz Forster <iforster@suse.com>
Date: Wed Jan 8 17:29:55 2020 +0100
References: [boo#1159232]
Upstream: Merged [gh#coreos/ignition#908]
Throw error if SSH keys could not be written
diff --git a/internal/exec/util/passwd.go b/internal/exec/util/passwd.go
index 5d961e3..55c378c 100644
--- a/internal/exec/util/passwd.go
+++ b/internal/exec/util/passwd.go
@@ -173,11 +173,14 @@ func (u Util) AuthorizeSSHKeys(c types.PasswdUser) error {
}
if distro.WriteAuthorizedKeysFragment() {
- writeAuthKeysFile(usr, filepath.Join(usr.HomeDir, ".ssh", "authorized_keys.d", "ignition"), []byte(ks))
+ err = writeAuthKeysFile(usr, filepath.Join(usr.HomeDir, ".ssh", "authorized_keys.d", "ignition"), []byte(ks))
} else {
- writeAuthKeysFile(usr, filepath.Join(usr.HomeDir, ".ssh", "authorized_keys"), []byte(ks))
+ err = writeAuthKeysFile(usr, filepath.Join(usr.HomeDir, ".ssh", "authorized_keys"), []byte(ks))
}
+ if err != nil {
+ return fmt.Errorf("failed to set SSH key: %v", err)
+ }
return nil
}, "adding ssh keys to user %q", c.Name)
}

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Jan 8 17:47:30 UTC 2020 - Ignaz Forster <iforster@suse.com>
- Add 0001-Throw-error-if-SSH-keys-could-not-be-written.patch:
Don't silently ignore if the SSH key could not be written
[boo#1159232]
-------------------------------------------------------------------
Mon Dec 23 09:16:22 UTC 2019 - iforster@suse.de

View File

@ -1,7 +1,7 @@
#
# spec file for package ignition
#
# Copyright (c) 2019 SUSE LLC
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -24,6 +24,7 @@ License: Apache-2.0
Group: System/Management
URL: https://github.com/coreos/ignition
Source: %{name}-%{version}.tar.xz
Patch1: 0001-Throw-error-if-SSH-keys-could-not-be-written.patch
Requires: dracut
BuildRequires: dracut
BuildRequires: libblkid-devel
@ -40,6 +41,7 @@ applies the configuration.
%prep
%setup -q
%patch1 -p1
%build
sed -i -e 's|go build -ldflags|go build -buildmode=pie -ldflags|g' build