From 06971c39b9a02fc25c5f53091460ad9f1b768328 Mon Sep 17 00:00:00 2001 From: deraadt Date: Thu, 2 Sep 2021 20:57:58 +0000 Subject: [PATCH] remove sys/param.h use, by replacing MAXLOGNAME -> LOGIN_NAME_MAX and MAXHOSTNAMELEN -> HOST_NAME_MAX+1 --- libexec/login_ldap/login_ldap.c | 6 +++--- libexec/login_ldap/util.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libexec/login_ldap/login_ldap.c b/libexec/login_ldap/login_ldap.c index 8f16d198d3a..83de3b94529 100644 --- a/libexec/login_ldap/login_ldap.c +++ b/libexec/login_ldap/login_ldap.c @@ -1,5 +1,5 @@ /* - * $OpenBSD: login_ldap.c,v 1.2 2020/09/12 17:14:23 martijn Exp $ + * $OpenBSD: login_ldap.c,v 1.3 2021/09/02 20:57:58 deraadt Exp $ * Copyright (c) 2002 Institute for Open Systems Technology Australia (IFOST) * Copyright (c) 2007 Michael Erdely * Copyright (c) 2019 Martijn van Duren @@ -29,7 +29,6 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include #include @@ -40,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -119,7 +119,7 @@ main(int argc, char **argv) usage(); } - if (strlen(username) >= MAXLOGNAME) { + if (strlen(username) >= LOGIN_NAME_MAX) { dlog(0, "username too long"); return 1; } diff --git a/libexec/login_ldap/util.c b/libexec/login_ldap/util.c index 11d6c5ed028..bc19a843126 100644 --- a/libexec/login_ldap/util.c +++ b/libexec/login_ldap/util.c @@ -1,5 +1,5 @@ /* - * $OpenBSD: util.c,v 1.2 2020/09/14 08:00:57 martijn Exp $ + * $OpenBSD: util.c,v 1.3 2021/09/02 20:57:58 deraadt Exp $ * Copyright (c) 2002 Institute for Open Systems Technology Australia (IFOST) * Copyright (c) 2007 Michael Erdely * Copyright (c) 2019 Martijn van Duren @@ -28,7 +28,7 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include + #include #include #include @@ -462,7 +462,7 @@ char * parse_filter(struct auth_ctx *ctx, const char *str) { char tmp[PATH_MAX]; - char hostname[MAXHOSTNAMELEN]; + char hostname[HOST_NAME_MAX+1]; const char *p; char *q; -- 2.20.1