-/* $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).
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 */
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) {
* "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;
{
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)) {