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