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

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 44b8556631d95fc033a0b4ba13441d9b4e2c8bcc 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 | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/src/responder/nss/nss_cmd.c b/src/responder/nss/nss_cmd.c
index 356aea1564..37a196b666 100644
--- a/src/responder/nss/nss_cmd.c
+++ b/src/responder/nss/nss_cmd.c
@@ -731,11 +731,13 @@ static void nss_getent_done(struct tevent_req *subreq)
     talloc_free(cmd_ctx);
 }
 
-static void nss_setnetgrent_done(struct tevent_req *subreq);
+static void sss_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;
@@ -777,7 +779,7 @@ static errno_t nss_setnetgrent(struct cli_ctx *cli_ctx,
         goto done;
     }
 
-    tevent_req_set_callback(subreq, nss_setnetgrent_done, cmd_ctx);
+    tevent_req_set_callback(subreq, sss_nss_setnetgrent_done, cmd_ctx);
 
     ret = EOK;
 
@@ -790,7 +792,7 @@ static errno_t nss_setnetgrent(struct cli_ctx *cli_ctx,
     return EOK;
 }
 
-static void nss_setnetgrent_done(struct tevent_req *subreq)
+static void sss_nss_setnetgrent_done(struct tevent_req *subreq)
 {
     struct nss_cmd_ctx *cmd_ctx;
     errno_t ret;
@@ -814,8 +816,8 @@ static void nss_setnetgrent_done(struct tevent_req *subreq)
 static void nss_getnetgrent_done(struct tevent_req *subreq);
 
 static errno_t nss_getnetgrent(struct cli_ctx *cli_ctx,
-                               enum cache_req_type type,
-                               nss_protocol_fill_packet_fn fill_fn)
+                                  enum cache_req_type type,
+                                  nss_protocol_fill_packet_fn fill_fn)
 {
     struct nss_cmd_ctx *cmd_ctx;
     struct tevent_req *subreq;
@@ -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