forked from pool/cloud-init
Accepting request 866971 from Cloud:Tools
OBS-URL: https://build.opensuse.org/request/show/866971 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/cloud-init?expand=0&rev=78
This commit is contained in:
commit
3e03d52384
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Jan 22 16:27:17 UTC 2021 - Jordi Massaguer <jmassaguerpla@suse.com>
|
||||
|
||||
- Add use_arroba_to_include_sudoers_directory-bsc_1181283.patchfix (bsc#1181283)
|
||||
- Do not including sudoers.d directory twice
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jan 4 22:27:22 UTC 2021 - Robert Schweikert <rjschwei@suse.com>
|
||||
|
||||
|
@ -41,6 +41,7 @@ Patch59: cloud-init-recognize-hpc.patch
|
||||
# FIXME https://github.com/canonical/cloud-init/commit/eea754492f074e00b601cf77aa278e3623857c5a
|
||||
Patch60: cloud-init-azure-def-usr-pass.patch
|
||||
Patch61: cloud-init-sle12-compat.patch
|
||||
Patch70: use_arroba_to_include_sudoers_directory-bsc_1181283.patch
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: filesystem
|
||||
# pkg-config is needed to find correct systemd unit dir
|
||||
@ -141,6 +142,7 @@ Documentation and examples for cloud-init tools
|
||||
%patch60
|
||||
%if 0%{?suse_version} < 1500
|
||||
%patch61
|
||||
%patch70
|
||||
%endif
|
||||
# patch in the full version to version.py
|
||||
version_pys=$(find . -name version.py -type f)
|
||||
|
36
use_arroba_to_include_sudoers_directory-bsc_1181283.patch
Normal file
36
use_arroba_to_include_sudoers_directory-bsc_1181283.patch
Normal file
@ -0,0 +1,36 @@
|
||||
commit d62bd1f0efb25bc156a23b8e703ff264e479303c
|
||||
Author: Jordi Massaguer Pla <jmassaguerpla@suse.de>
|
||||
Date: Fri Jan 22 17:10:17 2021 +0100
|
||||
|
||||
includedir in suoders can be prefixed by "arroba"
|
||||
|
||||
Since version 1.9.1, @includedir can be used in the sudoers files
|
||||
instead of #includedir:
|
||||
|
||||
https://github.com/sudo-project/sudo/releases/tag/SUDO_1_9_1
|
||||
|
||||
This happens to be the default in SUSE Linux enterprise sudoer package,
|
||||
so cloudinit should take this into account.
|
||||
|
||||
Otherwise, cloudinit was adding an extra #includedir, which was
|
||||
resulting on the files under /etc/sudoers.d being included twice, one by
|
||||
@includedir from the SUSE package, one by the @includedir from
|
||||
cloudinit. The consequence of this, was that if you were defining an
|
||||
Cmnd_Alias inside any of those files, this was being defined twice and
|
||||
creating an error when using sudo.
|
||||
|
||||
Signed-off-by: Jordi Massaguer Pla <jmassaguerpla@suse.de>
|
||||
|
||||
diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py
|
||||
index 1e118472..220bd11f 100755
|
||||
--- a/cloudinit/distros/__init__.py
|
||||
+++ b/cloudinit/distros/__init__.py
|
||||
@@ -673,7 +673,7 @@ class Distro(persistence.CloudInitPickleMixin, metaclass=abc.ABCMeta):
|
||||
found_include = False
|
||||
for line in sudoers_contents.splitlines():
|
||||
line = line.strip()
|
||||
- include_match = re.search(r"^#includedir\s+(.*)$", line)
|
||||
+ include_match = re.search(r"^[#|@]includedir\s+(.*)$", line)
|
||||
if not include_match:
|
||||
continue
|
||||
included_dir = include_match.group(1).strip()
|
Loading…
Reference in New Issue
Block a user