sssd/0108-certmap-Suppress-warning-Wmissing-braces.patch
Lukas Slebodnik 8eda442b2e Fix few bugs/regressions
Resolves: rhbz#1488327 - SELinux is preventing selinux_child from write access
                         on the sock_file system_bus_socket
Resolves: rhbz#1490402 - SSSD does not create /var/lib/sss/deskprofile and
                         fails to download desktop profile data
Resolves: upstream#3485 - getsidbyid does not work with 1.15.3
Resolves: upstream#3488 - SUDO doesn't work for IPA users on IPA clients after
                          applying ID Views for them in IPA server
Resolves: upstream#3501 - Accessing IdM kerberos ticket fails while id mapping
                          is applied
2017-09-12 09:22:07 +02:00

52 lines
2.0 KiB
Diff

From 22abbb479e00438ec4ab19735824cc6e79dd9aaf Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn@redhat.com>
Date: Wed, 6 Sep 2017 07:35:46 +0200
Subject: [PATCH 108/115] certmap: Suppress warning Wmissing-braces
Older version of gcc(e.g. gcc-4.8.5-11.el7) had a false positive warning
with c99 struct initialisation "{ 0 }".
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64709
CC src/lib/certmap/libsss_certmap_la-sss_cert_content_nss.lo
src/lib/certmap/sss_cert_content_nss.c:
In function 'add_pkinit_princ_to_san_list':
src/lib/certmap/sss_cert_content_nss.c:475:12:
error: missing braces around initializer [-Werror=missing-braces]
struct kerberos_principal_name kname = { 0 };
^
src/lib/certmap/sss_cert_content_nss.c:475:12:
error: (near initialization for 'kname.realm') [-Werror=missing-braces]
Reviewed-by: Sumit Bose <sbose@redhat.com>
---
src/lib/certmap/sss_cert_content_nss.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/lib/certmap/sss_cert_content_nss.c b/src/lib/certmap/sss_cert_content_nss.c
index 9b9409797228e906ce59de2472677cb292692610..925124ccd505cc474e338e676ef2bc20c135dd6c 100644
--- a/src/lib/certmap/sss_cert_content_nss.c
+++ b/src/lib/certmap/sss_cert_content_nss.c
@@ -472,10 +472,16 @@ static int add_pkinit_princ_to_san_list(TALLOC_CTX *mem_ctx,
{
struct san_list *i = NULL;
SECStatus rv;
- struct kerberos_principal_name kname = { 0 };
+ /* To avoid 'Wmissing-braces' warnings with older versions of
+ * gcc kerberos_principal_name cannot be initialized with { 0 }
+ * but must be initialized with memset().
+ */
+ struct kerberos_principal_name kname;
int ret;
size_t c;
+ memset(&kname, 0, sizeof(kname));
+
rv = SEC_ASN1DecodeItem(pool, &kname,
kerberos_principal_name_template,
&(current->name.OthName.name));
--
2.14.1