summaryrefslogtreecommitdiff
path: root/libexec/login_passwd
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-01-16 06:40:24 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-01-16 06:40:24 +0000
commit315054f4737a39489e0a14f3a92bff61f1592832 (patch)
tree62bf010653374ce09b6beb4dfa0414a91457233b /libexec/login_passwd
parent79e3d817585ca08a91e30ad14abe43e2ab70295f (diff)
Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
Diffstat (limited to 'libexec/login_passwd')
-rw-r--r--libexec/login_passwd/common.h4
-rw-r--r--libexec/login_passwd/login.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/libexec/login_passwd/common.h b/libexec/login_passwd/common.h
index 18eca80aad7..aeaee7b41e4 100644
--- a/libexec/login_passwd/common.h
+++ b/libexec/login_passwd/common.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: common.h,v 1.4 2012/06/01 01:43:19 dlg Exp $ */
+/* $OpenBSD: common.h,v 1.5 2015/01/16 06:39:50 deraadt Exp $ */
/*-
* Copyright (c) 2001 Hans Insulander <hin@openbsd.org>.
* All rights reserved.
@@ -30,7 +30,6 @@
#include <sys/types.h>
#include <sys/resource.h>
-#include <sys/param.h>
#include <signal.h>
#include <syslog.h>
@@ -43,6 +42,7 @@
#include <pwd.h>
#include <err.h>
#include <util.h>
+#include <limits.h>
#define MODE_LOGIN 0
diff --git a/libexec/login_passwd/login.c b/libexec/login_passwd/login.c
index 4f73489e463..6548178e001 100644
--- a/libexec/login_passwd/login.c
+++ b/libexec/login_passwd/login.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: login.c,v 1.10 2012/06/01 01:43:19 dlg Exp $ */
+/* $OpenBSD: login.c,v 1.11 2015/01/16 06:39:50 deraadt Exp $ */
/*-
* Copyright (c) 1995 Berkeley Software Design, Inc. All rights reserved.
@@ -45,7 +45,7 @@ main(int argc, char **argv)
char *username, *password = NULL;
char response[1024];
int arg_login = 0, arg_notickets = 0;
- char invokinguser[MAXLOGNAME];
+ char invokinguser[LOGIN_NAME_MAX];
char *wheel = NULL, *class = NULL;
invokinguser[0] = '\0';