import slapi-nis-0.56.3-2.module+el8.1.0+4098+f286395e

This commit is contained in:
CentOS Sources 2019-11-05 14:42:22 -05:00 committed by Andrew Lukoshko
parent b42c7a8692
commit 15525bd1e0
8 changed files with 284 additions and 33 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/slapi-nis-0.56.2.tar.gz
SOURCES/slapi-nis-0.56.3.tar.gz

View File

@ -1 +1 @@
d10412b47dc4c4a3b2a6aa17c4a8e39822c3152c SOURCES/slapi-nis-0.56.2.tar.gz
7768900317e79929ee8ea49ae2018d296e6441fb SOURCES/slapi-nis-0.56.3.tar.gz

View File

@ -1,28 +0,0 @@
From 062c157013c5af8714d9015582de898b42d1a981 Mon Sep 17 00:00:00 2001
From: Alexander Bokovoy <abokovoy@redhat.com>
Date: Wed, 2 May 2018 08:56:15 +0300
Subject: [PATCH] support transition from libtirpc to libnsl in Fedora 28
libnsl2-devel in Fedora 28 depends on libtirpc-devel internally
so we can also reduce the dependency in spec
diff --git a/configure.ac b/configure.ac
index 184a9af..80f2ca2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -273,6 +273,12 @@ AC_ARG_WITH(tirpc,
])
if test $use_tirpc = yes ; then
PKG_CHECK_MODULES(TIRPC,libtirpc)
+fi
+
+PKG_CHECK_MODULES(NSL,libnsl,[use_libnsl=yes],[use_libnsl=no])
+if test "$use_libnsl" = yes ; then
+ RPC_CFLAGS="$NSL_CFLAGS"
+ RPC_LIBS="$NSL_LIBS"
else
RPC_CFLAGS=
RPC_LIBS=-lnsl
--
2.14.3

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,44 @@
From e34a1220d740490a78185fb65bf575766906e419 Mon Sep 17 00:00:00 2001
From: Thierry Bordaz <tbordaz@redhat.com>
Date: Thu, 1 Aug 2019 18:23:14 +0200
Subject: [PATCH 2/2] Bug 1725845: slapi-nis crashes when returning an entry
with invalid DN
Bug Description:
On a search on compat tree, slapi-nis prepared the set of entries to return.
It stores the entries into a hashtable, using the normalized DN as a key.
If the entry contains an invalid DN, the key is invalid and triggers
a crash while adding the entry in the hashtable
https://bugzilla.redhat.com/show_bug.cgi?id=1725845
---
src/back-sch.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/back-sch.c b/src/back-sch.c
index 3f7e30f..87fa24c 100644
--- a/src/back-sch.c
+++ b/src/back-sch.c
@@ -1525,16 +1525,17 @@ backend_entries_to_return_push(struct backend_search_cbdata *cbdata, Slapi_Entry
struct entries_to_send *e_to_send = NULL;
struct cached_entry *entry = NULL;
bool_t dont_cache = FALSE;
+ void *ndn_key = (void *) slapi_entry_get_ndn(e);
PLHashTable* ht = (PLHashTable*) cbdata->state->cached_entries;
- if ((cbdata == NULL) || (e == NULL)) return;
+ if ((cbdata == NULL) || (e == NULL) || (ndn_key == NULL)) return;
e_to_send = (struct entries_to_send *) slapi_ch_calloc(1, sizeof(struct entries_to_send));
dont_cache = cbdata->state->use_entry_cache ? FALSE : TRUE;
if (!wrap_rwlock_wrlock(cbdata->state->cached_entries_lock)) {
- entry = PL_HashTableLookup(ht, slapi_entry_get_ndn(e));
+ entry = PL_HashTableLookup(ht, ndn_key);
if (entry != NULL) {
/* There is an entry in the hash table but is it the same? */
char *e_modifyTimestamp = slapi_entry_attr_get_charptr(e, "modifyTimestamp");
--
2.21.0

View File

@ -0,0 +1,224 @@
From a8881e4cbb006fd317ecf89f006747c4dd1c84a4 Mon Sep 17 00:00:00 2001
From: Stanislav Levin <slev@altlinux.org>
Date: Tue, 11 Jun 2019 16:54:01 +0300
Subject: [PATCH 1/2] Fix some of compiler warnings
Signed-off-by: Stanislav Levin <slev@altlinux.org>
---
src/back-nis.c | 2 ++
src/back-sch-idview.c | 8 +++-----
src/back-sch.c | 9 ++-------
src/back-shr.c | 2 --
src/nis.c | 4 ++--
src/portmap.c | 15 ++++++++++++---
src/wrap.c | 5 +++--
tests/clients/Makefile.am | 2 +-
tests/clients/yp.c | 3 +--
yp/Makefile.am | 2 +-
10 files changed, 27 insertions(+), 25 deletions(-)
diff --git a/src/back-nis.c b/src/back-nis.c
index 244beba..adf378e 100644
--- a/src/back-nis.c
+++ b/src/back-nis.c
@@ -849,6 +849,8 @@ backend_update_params(Slapi_PBlock *pb, struct plugin_state *state)
request_set(state->request_info, RQ_DAEMON,
DEFAULT_TCPWRAP_NAME);
}
+#else
+ (void)tmp;
#endif
use_be_txns = backend_shr_get_vattr_boolean(state, our_entry,
"nsslapd-pluginbetxn",
diff --git a/src/back-sch-idview.c b/src/back-sch-idview.c
index e83fb1d..6769e8d 100644
--- a/src/back-sch-idview.c
+++ b/src/back-sch-idview.c
@@ -56,7 +56,7 @@ void
idview_get_overrides(struct backend_search_cbdata *cbdata)
{
char *dn = NULL;
- int ret = 0, result = 0;
+ int result = 0;
const Slapi_DN *suffix = NULL;
Slapi_PBlock *pb;
@@ -76,7 +76,7 @@ idview_get_overrides(struct backend_search_cbdata *cbdata)
slapi_search_internal_set_pb(pb, dn, LDAP_SCOPE_SUBTREE,
"(objectclass=ipaOverrideAnchor)", NULL, 0,
NULL, NULL, cbdata->state->plugin_identity, 0);
- ret = slapi_search_internal_pb(pb);
+ slapi_search_internal_pb(pb);
slapi_ch_free_string(&dn);
slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &result);
@@ -411,8 +411,6 @@ idview_replace_filter(struct backend_search_cbdata *cbdata)
{
struct backend_search_filter_config config =
{FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL, NULL, NULL};
- int res = 0;
-
if (cbdata->idview == NULL) {
return;
}
@@ -421,7 +419,7 @@ idview_replace_filter(struct backend_search_cbdata *cbdata)
config.callback_data = cbdata;
/* Ignore the return code as it will always be SLAPI_FILTER_SCAN_NO_MORE */
- res = backend_analyze_search_filter(cbdata->filter, &config);
+ (void)backend_analyze_search_filter(cbdata->filter, &config);
if (config.name != NULL) {
slapi_ch_free_string(&config.name);
diff --git a/src/back-sch.c b/src/back-sch.c
index f6211bc..3f7e30f 100644
--- a/src/back-sch.c
+++ b/src/back-sch.c
@@ -438,13 +438,8 @@ backend_set_operational_attributes(Slapi_Entry *e,
* plugin want to override the values using the configuration, they
* can. */
if (gmtime_r(&timestamp, &timestamp_tm) == &timestamp_tm) {
- sprintf(timestamp_str, "%04d%02d%02d%02d%02d%02dZ",
- timestamp_tm.tm_year + 1900,
- timestamp_tm.tm_mon + 1,
- timestamp_tm.tm_mday,
- timestamp_tm.tm_hour,
- timestamp_tm.tm_min,
- timestamp_tm.tm_sec);
+ strftime(timestamp_str, sizeof(timestamp_str),
+ "%Y%m%d%H%M%SZ", &timestamp_tm);
slapi_entry_add_string(e, "createTimestamp", timestamp_str);
slapi_entry_add_string(e, "modifyTimestamp", timestamp_str);
}
diff --git a/src/back-shr.c b/src/back-shr.c
index 472846a..0c29d1f 100644
--- a/src/back-shr.c
+++ b/src/back-shr.c
@@ -780,8 +780,6 @@ static void
backend_shr_data_initialize_thread(time_t when, void *arg)
{
struct backend_shr_data_init_cbdata *cbdata = (struct backend_shr_data_init_cbdata *)arg;
- PRThread *thread = NULL;
-
if (slapi_is_shutting_down()) {
return;
}
diff --git a/src/nis.c b/src/nis.c
index 82b4c63..845c9da 100644
--- a/src/nis.c
+++ b/src/nis.c
@@ -967,7 +967,7 @@ nis_process_request(struct plugin_state *state,
AUTH *request_auth, *reply_auth;
char auth_buf[MAX_AUTH_BYTES];
struct rpc_msg request, reply;
- int auth_flavor, auth_len;
+ int auth_flavor;
struct ypresp_val reply_val;
struct ypresp_key_val reply_key_val;
struct ypresp_all reply_all;
@@ -1057,7 +1057,7 @@ nis_process_request(struct plugin_state *state,
}
auth_marshall(reply_auth, &auth_xdrs);
auth_destroy(reply_auth);
- auth_len = xdr_getpos(&auth_xdrs);
+ (void)xdr_getpos(&auth_xdrs);
xdr_destroy(&auth_xdrs);
slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id,
"built reply authenticator\n");
diff --git a/src/portmap.c b/src/portmap.c
index f2e009e..bf700d9 100644
--- a/src/portmap.c
+++ b/src/portmap.c
@@ -77,7 +77,8 @@ slapi_log_error(int i, char *f, char *fmt, ...)
int
main(int argc, char **argv)
{
- int s, ret, port;
+ int s, port;
+ int ret __attribute__ ((unused));
s = socket(PF_INET, SOCK_DGRAM, 0);
if (s == -1) {
printf("error allocating socket\n");
@@ -94,8 +95,16 @@ main(int argc, char **argv)
printf("error creating portmap/rpcbind client socket\n");
return 1;
}
- setregid(2516, 2516);
- setreuid(2510, 2510);
+ if (setregid(2516, 2516) == -1) {
+ printf("error setting real and effective group id %s\n",
+ strerror(errno));
+ return 1;
+ }
+ if (setreuid(2510, 2510) == -1) {
+ printf("error setting real and effective user id %s\n",
+ strerror(errno));
+ return 1;
+ }
sleep(60);
portmap_unregister("portmap", &s, port, YPPROG, YPVERS,
AF_INET, IPPROTO_TCP, 0);
diff --git a/src/wrap.c b/src/wrap.c
index f8056a4..2905f84 100644
--- a/src/wrap.c
+++ b/src/wrap.c
@@ -153,13 +153,14 @@ void *
wrap_stop_thread(struct wrapped_thread *t)
{
void *returned = NULL;
+ int ret __attribute__ ((unused));
#ifdef USE_PTHREADS
- write(t->stopfd[1], "", 1);
+ ret = write(t->stopfd[1], "", 1);
close(t->stopfd[1]);
pthread_join(t->tid, &returned);
#endif
#ifdef USE_NSPR_THREADS
- write(t->stopfd[1], "", 1);
+ ret = write(t->stopfd[1], "", 1);
close(t->stopfd[1]);
PR_JoinThread(t->tid);
returned = t->args.result;
diff --git a/tests/clients/Makefile.am b/tests/clients/Makefile.am
index b5326da..6415d02 100644
--- a/tests/clients/Makefile.am
+++ b/tests/clients/Makefile.am
@@ -12,7 +12,7 @@ yp.h: ../../yp/yp.x
$(RPCGEN) -h -o $@ $^
yp_xdr.c: ../../yp/yp.x
$(RM) -f $@
- $(RPCGEN) -c -o $@ $^
+ $(RPCGEN) -c -i 0 -o $@ $^
yp_clnt.c: ../../yp/yp.x
$(RM) -f $@
$(RPCGEN) -l -o $@ $^
diff --git a/tests/clients/yp.c b/tests/clients/yp.c
index bc2da1f..88d2b81 100644
--- a/tests/clients/yp.c
+++ b/tests/clients/yp.c
@@ -164,8 +164,7 @@ writejunk(char *fd, char *data, int size)
static int
all(CLIENT *client, FILE *output, int argc, char **argv)
{
- ypresp_all *ret;
- int i, sock;
+ int sock;
ypreq_nokey nokey;
struct rpc_msg req, rep;
struct ypresp_all resp;
diff --git a/yp/Makefile.am b/yp/Makefile.am
index a75aa22..a4b4e4b 100644
--- a/yp/Makefile.am
+++ b/yp/Makefile.am
@@ -7,7 +7,7 @@ yp.h: yp.x
$(RPCGEN) -h -o $@ $^
yp_xdr.c: yp.x
$(RM) -f $@
- $(RPCGEN) -c -o $@ $^
+ $(RPCGEN) -c -i 0 -o $@ $^
yp_clnt.c: yp.x
$(RM) -f $@
$(RPCGEN) -l -o $@ $^
--
2.21.0

View File

@ -10,15 +10,17 @@
%endif
Name: slapi-nis
Version: 0.56.2
Release: 7%{?dist}
Version: 0.56.3
Release: 2%{?dist}
Summary: NIS Server and Schema Compatibility plugins for Directory Server
Group: System Environment/Daemons
License: GPLv2
URL: http://pagure.io/slapi-nis/
Source0: https://releases.pagure.org/slapi-nis/slapi-nis-%{version}.tar.gz
Source1: https://releases.pagure.org/slapi-nis/slapi-nis-%{version}.tar.gz.sig
Patch1: 0001-support-transition-from-libtirpc-to-libnsl-in-Fedora.patch
Patch1: slapi-nis-fix-some-of-compiler-warnings.patch
Patch2: slapi-nis-Bug-1725845-slapi-nis-crashes-when-returning-an-entr.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
@ -57,6 +59,7 @@ for attributes from multiple entries in the tree.
%prep
%setup -q
%patch1 -p1
%patch2 -p1
%build
autoconf --force
@ -85,6 +88,14 @@ make check
%{_sbindir}/nisserver-plugin-defs
%changelog
* Fri Aug 16 2019 Alexander Bokovoy <abokovoy@redhat.com> - 0.56.3-2
- Resolves rhbz#1741881
ns-slapd is crashing intermittently
* Wed Jun 05 2019 Alexander Bokovoy <abokovoy@redhat.com> - 0.56.3-1
- New upstream release
- Resolves rhbz#1684563
* Mon Jul 23 2018 Alexander Bokovoy <abokovoy@redhat.com> - 0.56.2-7
- 389-ds is not available on i686 architecture, don't build there