summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorderaadt@openbsd.org <deraadt@openbsd.org>2015-01-16 06:40:12 +0000
committerDamien Miller <djm@mindrot.org>2015-01-16 18:24:48 +1100
commit2ae4f337b2a5fb2841b6b0053b49496fef844d1c (patch)
tree59aac6ef59be3975eb3a1251abb0be330c008cdd /session.c
parent3c4726f4c24118e8f1bb80bf75f1456c76df072c (diff)
upstream commit
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 'session.c')
-rw-r--r--session.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/session.c b/session.c
index fbb921bea..54bac36a8 100644
--- a/session.c
+++ b/session.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: session.c,v 1.276 2015/01/14 20:05:27 djm Exp $ */ 1/* $OpenBSD: session.c,v 1.277 2015/01/16 06:40:12 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4 * All rights reserved 4 * All rights reserved
@@ -60,6 +60,7 @@
60#include <stdlib.h> 60#include <stdlib.h>
61#include <string.h> 61#include <string.h>
62#include <unistd.h> 62#include <unistd.h>
63#include <limits.h>
63 64
64#include "openbsd-compat/sys-queue.h" 65#include "openbsd-compat/sys-queue.h"
65#include "xmalloc.h" 66#include "xmalloc.h"
@@ -1437,7 +1438,7 @@ static void
1437safely_chroot(const char *path, uid_t uid) 1438safely_chroot(const char *path, uid_t uid)
1438{ 1439{
1439 const char *cp; 1440 const char *cp;
1440 char component[MAXPATHLEN]; 1441 char component[PATH_MAX];
1441 struct stat st; 1442 struct stat st;
1442 1443
1443 if (*path != '/') 1444 if (*path != '/')