summaryrefslogtreecommitdiffstats
path: root/usr.sbin/authpf
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-01-15 23:59:28 +0000
committerderaadt <deraadt@openbsd.org>2015-01-15 23:59:28 +0000
commitb06f065dc1e7d3139e367d7c89ba29087d8fb34f (patch)
treee420f54f268f2825a09c70950bf0dd875d11c5d6 /usr.sbin/authpf
parentinclude <sys/syslimits.h> and switch to use of LOGIN_NAME_MAX, making (diff)
downloadwireguard-openbsd-b06f065dc1e7d3139e367d7c89ba29087d8fb34f.tar.xz
wireguard-openbsd-b06f065dc1e7d3139e367d7c89ba29087d8fb34f.zip
switch to PATH_MAX
Diffstat (limited to 'usr.sbin/authpf')
-rw-r--r--usr.sbin/authpf/authpf.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/usr.sbin/authpf/authpf.c b/usr.sbin/authpf/authpf.c
index 7b7fba83eed..93cc3e4c2b8 100644
--- a/usr.sbin/authpf/authpf.c
+++ b/usr.sbin/authpf/authpf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: authpf.c,v 1.121 2014/10/08 02:11:54 deraadt Exp $ */
+/* $OpenBSD: authpf.c,v 1.122 2015/01/15 23:59:28 deraadt Exp $ */
/*
* Copyright (C) 1998 - 2007 Bob Beck (beck@openbsd.org).
@@ -54,15 +54,15 @@ static void authpf_kill_states(void);
int dev; /* pf device */
char anchorname[PF_ANCHOR_NAME_SIZE] = "authpf";
-char rulesetname[MAXPATHLEN - PF_ANCHOR_NAME_SIZE - 2];
+char rulesetname[PATH_MAX - PF_ANCHOR_NAME_SIZE - 2];
char tablename[PF_TABLE_NAME_SIZE] = "authpf_users";
int user_ip = 1; /* controls whether $user_ip is set */
FILE *pidfp;
int pidfd = -1;
-char luser[MAXLOGNAME]; /* username */
+char luser[LOGIN_NAME_MAX]; /* username */
char ipsrc[256]; /* ip as a string */
-char pidfile[MAXPATHLEN]; /* we save pid in this file. */
+char pidfile[PATH_MAX]; /* we save pid in this file. */
struct timeval Tstart, Tend; /* start and end times of session */
@@ -213,7 +213,7 @@ main(int argc, char *argv[])
do {
int save_errno, otherpid = -1;
- char otherluser[MAXLOGNAME];
+ char otherluser[LOGIN_NAME_MAX];
if ((pidfd = open(pidfile, O_RDWR|O_CREAT, 0644)) == -1 ||
(pidfp = fdopen(pidfd, "r+")) == NULL) {
@@ -491,8 +491,8 @@ allowed_luser(struct passwd *pw)
* "public" gateway, such as it is, so let
* everyone use it.
*/
- int gl_init = 0, ngroups = NGROUPS + 1;
- gid_t groups[NGROUPS + 1];
+ int gl_init = 0, ngroups = NGROUPS_MAX + 1;
+ gid_t groups[NGROUPS_MAX + 1];
lbuf = NULL;
matched = 0;
@@ -582,7 +582,7 @@ check_luser(char *luserdir, char *luser)
{
FILE *f;
int n;
- char tmp[MAXPATHLEN];
+ char tmp[PATH_MAX];
n = snprintf(tmp, sizeof(tmp), "%s/%s", luserdir, luser);
if (n < 0 || (u_int)n >= sizeof(tmp)) {