summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd
diff options
context:
space:
mode:
authorSerhey Popovych <serhe.popovych@gmail.com>2019-01-12 11:22:47 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-02-25 16:34:58 +0000
commitc9580ef0810196f6703567d9db458b73dbbfb35f (patch)
tree04a32572072fd5a5af79e95286faea8632387bd0 /meta/recipes-core/systemd/systemd
parent6f010c9b7777aae5ce2108122d0c6d3b1d630a21 (diff)
downloadopenembedded-core-contrib-c9580ef0810196f6703567d9db458b73dbbfb35f.tar.gz
systemd: Correctly check ENABLE_GSHADOW with if/endif
Use commit 4f07ffa8f5ab ("Use #if instead of #ifdef for ENABLE_GSHADOW") from upstream to check ENABLE_GSHADOW correctly that is defined as 0 in case of musl. While there replace specific patch with one from upstream that does exactly the same commit 66a5b5ce9b99 ("basic/user-util: properly protect use of gshadow"). Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/systemd/systemd')
-rw-r--r--meta/recipes-core/systemd/systemd/0005-basic-user-util-properly-protect-use-of-gshadow.patch38
-rw-r--r--meta/recipes-core/systemd/systemd/0005-include-gshadow-only-if-ENABLE_GSHADOW-is-1.patch29
-rw-r--r--meta/recipes-core/systemd/systemd/0022-Use-if-instead-of-ifdef-for-ENABLE_GSHADOW.patch28
3 files changed, 66 insertions, 29 deletions
diff --git a/meta/recipes-core/systemd/systemd/0005-basic-user-util-properly-protect-use-of-gshadow.patch b/meta/recipes-core/systemd/systemd/0005-basic-user-util-properly-protect-use-of-gshadow.patch
new file mode 100644
index 0000000000..518c05b73a
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0005-basic-user-util-properly-protect-use-of-gshadow.patch
@@ -0,0 +1,38 @@
+From 66a5b5ce9b991327d594f7b635de16999ca54093 Mon Sep 17 00:00:00 2001
+From: "Yann E. MORIN" <yann.morin.1998@free.fr>
+Date: Wed, 21 Nov 2018 18:09:04 +0100
+Subject: basic/user-util: properly protect use of gshadow
+
+Commit 100d5f6ee6 (user-util: add new wrappers for [...] database
+files), ammended by commit 4f07ffa8f5 (Use #if instead of #ifdef for
+ENABLE_GSHADOW) moved code from sysuser to basic/user-util.
+
+In doing so, the combination of both commits properly propagated the
+ENABLE_GSHADOW conditions around the function manipulating gshadow, but
+they forgot to protect the inclusion of the gshadow.h header.
+
+Fix that to be able to build on C libraries that do not provide gshadow
+(e.g. uClibc-ng, where it does not exist.)
+
+Upstream-Status: Backport [https://github.com/systemd/systemd/commit/66a5b5ce9b991327d594f7b635de16999ca54093]
+---
+ src/basic/user-util.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/basic/user-util.h b/src/basic/user-util.h
+index b6de0e423..cc899ee76 100644
+--- a/src/basic/user-util.h
++++ b/src/basic/user-util.h
+@@ -2,7 +2,9 @@
+ #pragma once
+
+ #include <grp.h>
++#if ENABLE_GSHADOW
+ #include <gshadow.h>
++#endif
+ #include <pwd.h>
+ #include <shadow.h>
+ #include <stdbool.h>
+--
+2.18.1
+
diff --git a/meta/recipes-core/systemd/systemd/0005-include-gshadow-only-if-ENABLE_GSHADOW-is-1.patch b/meta/recipes-core/systemd/systemd/0005-include-gshadow-only-if-ENABLE_GSHADOW-is-1.patch
deleted file mode 100644
index 6d5faf5fed..0000000000
--- a/meta/recipes-core/systemd/systemd/0005-include-gshadow-only-if-ENABLE_GSHADOW-is-1.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From a2c4d46944892174930135672508389a04e191f0 Mon Sep 17 00:00:00 2001
-From: Chen Qi <Qi.Chen@windriver.com>
-Date: Fri, 29 Jun 2018 13:53:29 +0800
-Subject: [PATCH 05/19] include gshadow only if ENABLE_GSHADOW is 1
-
-Upstream-Status: Inappropriate [musl]
-
-Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
----
- src/basic/user-util.h | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/src/basic/user-util.h b/src/basic/user-util.h
-index b74f16885..f9c1e29c4 100644
---- a/src/basic/user-util.h
-+++ b/src/basic/user-util.h
-@@ -2,7 +2,9 @@
- #pragma once
-
- #include <grp.h>
-+#if ENABLE_GSHADOW
- #include <gshadow.h>
-+#endif
- #include <pwd.h>
- #include <shadow.h>
- #include <stdbool.h>
---
-2.11.0
-
diff --git a/meta/recipes-core/systemd/systemd/0022-Use-if-instead-of-ifdef-for-ENABLE_GSHADOW.patch b/meta/recipes-core/systemd/systemd/0022-Use-if-instead-of-ifdef-for-ENABLE_GSHADOW.patch
new file mode 100644
index 0000000000..a9c1c9cfe5
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0022-Use-if-instead-of-ifdef-for-ENABLE_GSHADOW.patch
@@ -0,0 +1,28 @@
+From 4f07ffa8f5ab85011422bb7114f1cddf49d4923d Mon Sep 17 00:00:00 2001
+From: ChenQi1989 <40684930+ChenQi1989@users.noreply.github.com>
+Date: Fri, 29 Jun 2018 06:54:07 +0000
+Subject: Use #if instead of #ifdef for ENABLE_GSHADOW
+
+ENABLE_GSHADOW is defined to be 0 or 1. So #if should be used instead of #ifdef.
+
+Upstream-Status: Backport [https://github.com/systemd/systemd/commit/4f07ffa8f5ab85011422bb7114f1cddf49d4923d]
+---
+ src/basic/user-util.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/basic/user-util.h b/src/basic/user-util.h
+index b74f16885..b2f198c89 100644
+--- a/src/basic/user-util.h
++++ b/src/basic/user-util.h
+@@ -102,7 +102,7 @@ int fgetgrent_sane(FILE *stream, struct group **gr);
+ int putpwent_sane(const struct passwd *pw, FILE *stream);
+ int putspent_sane(const struct spwd *sp, FILE *stream);
+ int putgrent_sane(const struct group *gr, FILE *stream);
+-#ifdef ENABLE_GSHADOW
++#if ENABLE_GSHADOW
+ int fgetsgent_sane(FILE *stream, struct sgrp **sg);
+ int putsgent_sane(const struct sgrp *sg, FILE *stream);
+ #endif
+--
+2.18.1
+