URL: https://github.com/SSSD/sssd/pull/995
Author: mzidek-gh
 Title: #995: nss: Collision with external nss symbol
Action: opened

PR body:
"""
One of our internal static function names started
to collide with external nss symbol. Additional
sss_ suffix was added to avoid the collision.

This is needed to unblock Fedora Rawhide's
SSSD build.

FYI here is the error on rawhide:
```
src/responder/nss/nss_cmd.c:736:16: error: 'nss_setnetgrent' redeclared as 
different kind of symbol
  736 | static errno_t nss_setnetgrent(struct cli_ctx *cli_ctx,
      |                ^~~~~~~~~~~~~~~
In file included from ./src/sss_client/sss_cli.h:28,
                 from ./src/db/sysdb.h:27,
                 from src/responder/nss/nss_cmd.c:26:
/usr/include/nss.h:184:25: note: previous declaration of 'nss_setnetgrent' was 
here
  184 | typedef enum nss_status nss_setnetgrent (const char *, struct 
__netgrent *);
      |                         ^~~~~~~~~~~~~~~
```

Running scratch build right now to see if it fixed the issue.
"""

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/995/head:pr995
git checkout pr995
From 3851fc75327ea874acc9e6e1bea59d3301e9dd57 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michal=20=C5=BDidek?= <mzi...@redhat.com>
Date: Thu, 27 Feb 2020 06:50:40 +0100
Subject: [PATCH] nss: Collision with external nss symbol

One of our internal static function names started
to collide with external nss symbol. Additional
sss_ suffix was added to avoid the collision.

This is needed to unblock Fedora Rawhide's
SSSD build.
---
 src/responder/nss/nss_cmd.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/responder/nss/nss_cmd.c b/src/responder/nss/nss_cmd.c
index 356aea1564..2b67e3c18e 100644
--- a/src/responder/nss/nss_cmd.c
+++ b/src/responder/nss/nss_cmd.c
@@ -733,9 +733,11 @@ static void nss_getent_done(struct tevent_req *subreq)
 
 static void nss_setnetgrent_done(struct tevent_req *subreq);
 
-static errno_t nss_setnetgrent(struct cli_ctx *cli_ctx,
-                               enum cache_req_type type,
-                               nss_protocol_fill_packet_fn fill_fn)
+/* This function's name started to collide with external nss symbol,
+ * so it has additional sss_* prefix unlike other functions here. */
+static errno_t sss_nss_setnetgrent(struct cli_ctx *cli_ctx,
+                                   enum cache_req_type type,
+                                   nss_protocol_fill_packet_fn fill_fn)
 {
     struct nss_ctx *nss_ctx;
     struct nss_state_ctx *state_ctx;
@@ -1040,8 +1042,8 @@ static errno_t nss_cmd_initgroups_ex(struct cli_ctx *cli_ctx)
 
 static errno_t nss_cmd_setnetgrent(struct cli_ctx *cli_ctx)
 {
-    return nss_setnetgrent(cli_ctx, CACHE_REQ_NETGROUP_BY_NAME,
-                           nss_protocol_fill_setnetgrent);
+    return sss_nss_setnetgrent(cli_ctx, CACHE_REQ_NETGROUP_BY_NAME,
+                               nss_protocol_fill_setnetgrent);
 }
 
 static errno_t nss_cmd_getnetgrent(struct cli_ctx *cli_ctx)
_______________________________________________
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/sssd-devel@lists.fedorahosted.org

Reply via email to