Skip to content

Commit

Permalink
security/sssd2: fix building on current
Browse files Browse the repository at this point in the history
  • Loading branch information
jhixson74 committed Feb 12, 2024
1 parent 34302a6 commit 28f442a
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 37 deletions.
3 changes: 1 addition & 2 deletions security/sssd2/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PORTNAME= sssd
PORTVERSION= 2.9.4
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= security
PKGNAMESUFFIX= -devel

Expand All @@ -11,7 +11,6 @@ WWW= https://sssd.io/
LICENSE= GPLv3+
LICENSE_FILE= ${WRKSRC}/COPYING

BROKEN_FreeBSD_15= fails to compile: linker fails to resolve nss symbols
CONFLICTS_INSTALL?= sssd*

BUILD_DEPENDS= bash:shells/bash \
Expand Down
44 changes: 23 additions & 21 deletions security/sssd2/files/bsdnss.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@
#include <nss.h>
#include <netdb.h>

NSS_METHOD_PROTOTYPE(__nss_compat_getgrnam_r);
NSS_METHOD_PROTOTYPE(__nss_compat_getgrgid_r);
NSS_METHOD_PROTOTYPE(__nss_compat_getgrent_r);
NSS_METHOD_PROTOTYPE(__nss_compat_setgrent);
NSS_METHOD_PROTOTYPE(__nss_compat_endgrent);

NSS_METHOD_PROTOTYPE(__nss_compat_getpwnam_r);
NSS_METHOD_PROTOTYPE(__nss_compat_getpwuid_r);
NSS_METHOD_PROTOTYPE(__nss_compat_getpwent_r);
NSS_METHOD_PROTOTYPE(__nss_compat_setpwent);
NSS_METHOD_PROTOTYPE(__nss_compat_endpwent);

NSS_METHOD_PROTOTYPE(__nss_compat_gethostbyname);
NSS_METHOD_PROTOTYPE(__nss_compat_gethostbyname2);
NSS_METHOD_PROTOTYPE(__nss_compat_gethostbyaddr);

NSS_METHOD_PROTOTYPE(__nss_compat_getgroupmembership);

extern enum nss_status _nss_sss_getgrent_r(struct group *, char *, size_t,
int *);
extern enum nss_status _nss_sss_getgrnam_r(const char *, struct group *,
Expand Down Expand Up @@ -45,28 +63,10 @@ extern enum nss_status _nss_sss_getgroupmembership(const char *uname,
gid_t agroup, gid_t *groups,
int maxgrp, int *grpcnt);

NSS_METHOD_PROTOTYPE(__nss_compat_getgroupmembership);
NSS_METHOD_PROTOTYPE(__nss_compat_getgrnam_r);
NSS_METHOD_PROTOTYPE(__nss_compat_getgrgid_r);
NSS_METHOD_PROTOTYPE(__nss_compat_getgrent_r);
NSS_METHOD_PROTOTYPE(__nss_compat_setgrent);
NSS_METHOD_PROTOTYPE(__nss_compat_endgrent);

NSS_METHOD_PROTOTYPE(__nss_compat_getpwnam_r);
NSS_METHOD_PROTOTYPE(__nss_compat_getpwuid_r);
NSS_METHOD_PROTOTYPE(__nss_compat_getpwent_r);
NSS_METHOD_PROTOTYPE(__nss_compat_setpwent);
NSS_METHOD_PROTOTYPE(__nss_compat_endpwent);

NSS_METHOD_PROTOTYPE(__nss_compat_gethostbyname);
NSS_METHOD_PROTOTYPE(__nss_compat_gethostbyname2);
NSS_METHOD_PROTOTYPE(__nss_compat_gethostbyaddr);

static ns_mtab methods[] = {
{ NSDB_GROUP, "getgrnam_r", __nss_compat_getgrnam_r, _nss_sss_getgrnam_r },
{ NSDB_GROUP, "getgrgid_r", __nss_compat_getgrgid_r, _nss_sss_getgrgid_r },
{ NSDB_GROUP, "getgrent_r", __nss_compat_getgrent_r, _nss_sss_getgrent_r },
{ NSDB_GROUP, "getgroupmembership", __nss_compat_getgroupmembership, _nss_sss_getgroupmembership },
{ NSDB_GROUP, "setgrent", __nss_compat_setgrent, _nss_sss_setgrent },
{ NSDB_GROUP, "endgrent", __nss_compat_endgrent, _nss_sss_endgrent },

Expand All @@ -76,9 +76,9 @@ static ns_mtab methods[] = {
{ NSDB_PASSWD, "setpwent", __nss_compat_setpwent, _nss_sss_setpwent },
{ NSDB_PASSWD, "endpwent", __nss_compat_endpwent, _nss_sss_endpwent },

// { NSDB_HOSTS, "gethostbyname", __nss_compat_gethostbyname, _nss_sss_gethostbyname_r },
//{ NSDB_HOSTS, "gethostbyaddr", __nss_compat_gethostbyaddr, _nss_sss_gethostbyaddr_r },
//{ NSDB_HOSTS, "gethostbyname2", __nss_compat_gethostbyname2, _nss_sss_gethostbyname2_r },
{ NSDB_HOSTS, "gethostbyname", __nss_compat_gethostbyname, _nss_sss_gethostbyname_r },
{ NSDB_HOSTS, "gethostbyaddr", __nss_compat_gethostbyaddr, _nss_sss_gethostbyaddr_r },
{ NSDB_HOSTS, "gethostbyname2", __nss_compat_gethostbyname2, _nss_sss_gethostbyname2_r },

{ NSDB_GROUP_COMPAT, "getgrnam_r", __nss_compat_getgrnam_r, _nss_sss_getgrnam_r },
{ NSDB_GROUP_COMPAT, "getgrgid_r", __nss_compat_getgrgid_r, _nss_sss_getgrgid_r },
Expand All @@ -92,6 +92,8 @@ static ns_mtab methods[] = {
{ NSDB_PASSWD_COMPAT, "setpwent", __nss_compat_setpwent, _nss_sss_setpwent },
{ NSDB_PASSWD_COMPAT, "endpwent", __nss_compat_endpwent, _nss_sss_endpwent },

{ NSDB_GROUP, "getgroupmembership", __nss_compat_getgroupmembership, _nss_sss_getgroupmembership },

};


Expand Down
10 changes: 10 additions & 0 deletions security/sssd2/files/patch-src__lib__certmap__sss_certmap.exports
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- src/lib/certmap/sss_certmap.exports.orig 2024-01-12 12:05:40 UTC
+++ src/lib/certmap/sss_certmap.exports
@@ -2,7 +2,6 @@ SSS_CERTMAP_0.0 {
global:
sss_certmap_init;
sss_certmap_free_ctx;
- sss_certmap_err_msg;
sss_certmap_add_rule;
sss_certmap_match_cert;
sss_certmap_get_search_filter;
28 changes: 14 additions & 14 deletions security/sssd2/files/patch-src__sss_client__sss_nss.exports
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
--- src/sss_client/sss_nss.exports.orig 2023-06-05 03:42:12 UTC
--- src/sss_client/sss_nss.exports.orig 2024-01-12 12:05:40 UTC
+++ src/sss_client/sss_nss.exports
@@ -3,6 +3,7 @@ EXPORTED {
# public functions
Expand All @@ -15,21 +15,21 @@
+ _nss_sss_getgroupmembership;
_nss_sss_initgroups_dyn;
+
+ __nss_compat_getgrnam_r;
+ __nss_compat_getgrgid_r;
+ __nss_compat_getgrent_r;
+ __nss_compat_setgrent;
+ __nss_compat_endgrent;
+ #__nss_compat_getgrnam_r;
+ #__nss_compat_getgrgid_r;
+ #__nss_compat_getgrent_r;
+ #__nss_compat_setgrent;
+ #__nss_compat_endgrent;
+
+ __nss_compat_getpwnam_r;
+ __nss_compat_getpwuid_r;
+ __nss_compat_getpwent_r;
+ __nss_compat_setpwent;
+ __nss_compat_endpwent;
+ #__nss_compat_getpwnam_r;
+ #__nss_compat_getpwuid_r;
+ #__nss_compat_getpwent_r;
+ #__nss_compat_setpwent;
+ #__nss_compat_endpwent;
+
+ __nss_compat_gethostbyname;
+ __nss_compat_gethostbyname2;
+ __nss_compat_gethostbyaddr;
+ #__nss_compat_gethostbyname;
+ #__nss_compat_gethostbyname2;
+ #__nss_compat_gethostbyaddr;

#_nss_sss_getaliasbyname_r;
#_nss_sss_setaliasent;

0 comments on commit 28f442a

Please sign in to comment.