From: deraadt Date: Thu, 15 Jan 2015 23:59:28 +0000 (+0000) Subject: switch to PATH_MAX X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b06f065dc1e7d3139e367d7c89ba29087d8fb34f;p=openbsd switch to PATH_MAX --- 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)) {