summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorChristian Weisgerber <naddy@cvs.openbsd.org>2022-02-05 22:59:59 +0000
committerChristian Weisgerber <naddy@cvs.openbsd.org>2022-02-05 22:59:59 +0000
commit59cd164b8aa2488b10fe10857c92804f4483adf5 (patch)
tree56141d9942b90092de61fbffa59459fff269c797 /usr.sbin
parente9d7da98ba40ee931f16bb7984ed0cb01b8eb01a (diff)
ypldap: fix -Wunused-but-set-variable warnings
* wrlen has been write-only since the code was imported * removing "dns_pid" mirrors ntpd/ntp.c 1.122 * ifdef out unfinished code in yp_check() ok millert@ deraadt@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ypldap/entries.c7
-rw-r--r--usr.sbin/ypldap/ldapclient.c6
-rw-r--r--usr.sbin/ypldap/yp.c4
3 files changed, 7 insertions, 10 deletions
diff --git a/usr.sbin/ypldap/entries.c b/usr.sbin/ypldap/entries.c
index 3e2cc672786..3d259e6e40d 100644
--- a/usr.sbin/ypldap/entries.c
+++ b/usr.sbin/ypldap/entries.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: entries.c,v 1.4 2017/07/12 23:18:24 jca Exp $ */
+/* $OpenBSD: entries.c,v 1.5 2022/02/05 22:59:58 naddy Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
*
@@ -38,7 +38,6 @@
void
flatten_entries(struct env *env)
{
- size_t wrlen;
size_t len;
char *linep;
char *endp;
@@ -54,7 +53,6 @@ flatten_entries(struct env *env)
*
* An extra octet is alloced to make space for an additional NUL.
*/
- wrlen = env->sc_user_line_len;
if ((linep = calloc(1, env->sc_user_line_len + 1)) == NULL) {
/*
* XXX: try allocating a smaller chunk of memory
@@ -76,7 +74,6 @@ flatten_entries(struct env *env)
free(ue->ue_line);
ue->ue_line = endp;
endp += len;
- wrlen -= len;
/*
* To save memory strdup(3) the netid_line which originally used
@@ -92,7 +89,6 @@ flatten_entries(struct env *env)
env->sc_user_lines = linep;
log_debug("done pushing users");
- wrlen = env->sc_group_line_len;
if ((linep = calloc(1, env->sc_group_line_len + 1)) == NULL) {
/*
* XXX: try allocating a smaller chunk of memory
@@ -113,7 +109,6 @@ flatten_entries(struct env *env)
free(ge->ge_line);
ge->ge_line = endp;
endp += len;
- wrlen -= len;
}
env->sc_group_lines = linep;
log_debug("done pushing groups");
diff --git a/usr.sbin/ypldap/ldapclient.c b/usr.sbin/ypldap/ldapclient.c
index 473986a8c5e..534f2d7c730 100644
--- a/usr.sbin/ypldap/ldapclient.c
+++ b/usr.sbin/ypldap/ldapclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldapclient.c,v 1.43 2019/06/28 13:32:52 deraadt Exp $ */
+/* $OpenBSD: ldapclient.c,v 1.44 2022/02/05 22:59:58 naddy Exp $ */
/*
* Copyright (c) 2008 Alexander Schrijver <aschrijver@openbsd.org>
@@ -357,7 +357,7 @@ client_shutdown(void)
pid_t
ldapclient(int pipe_main2client[2])
{
- pid_t pid, dns_pid;
+ pid_t pid;
int pipe_dns[2];
struct passwd *pw;
struct event ev_sigint;
@@ -382,7 +382,7 @@ ldapclient(int pipe_main2client[2])
if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, pipe_dns) == -1)
fatal("socketpair");
- dns_pid = ypldap_dns(pipe_dns, pw);
+ ypldap_dns(pipe_dns, pw);
close(pipe_dns[1]);
#ifndef DEBUG
diff --git a/usr.sbin/ypldap/yp.c b/usr.sbin/ypldap/yp.c
index 84b5d591020..1cca2a1352a 100644
--- a/usr.sbin/ypldap/yp.c
+++ b/usr.sbin/ypldap/yp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: yp.c,v 1.19 2017/12/07 05:21:57 zhuk Exp $ */
+/* $OpenBSD: yp.c,v 1.20 2022/02/05 22:59:58 naddy Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
*
@@ -268,12 +268,14 @@ yp_dispatch(struct svc_req *req, SVCXPRT *trans)
int
yp_check(struct svc_req *req)
{
+#ifdef notyet
struct sockaddr_in *caller;
caller = svc_getcaller(req->rq_xprt);
/*
* We might want to know who we allow here.
*/
+#endif
return (0);
}