summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2018-11-16 03:26:01 +0000
committerDamien Miller <djm@mindrot.org>2018-11-16 14:37:33 +1100
commit2a35862e664afde774d4a72497d394fe7306ccb5 (patch)
tree501d6d170178b037829003b76cbd32e23e6080bb /session.c
parentd0d1dfa55be1c5c0d77ab3096b198a64235f936d (diff)
upstream: use path_absolute() for pathname checks; from Manoj Ampalam
OpenBSD-Commit-ID: 482ce71a5ea5c5f3bc4d00fd719481a6a584d925
Diffstat (limited to 'session.c')
-rw-r--r--session.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/session.c b/session.c
index 2d0958d11..a3f0b3562 100644
--- a/session.c
+++ b/session.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: session.c,v 1.307 2018/10/04 00:10:11 djm Exp $ */ 1/* $OpenBSD: session.c,v 1.308 2018/11/16 03:26:01 djm 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
@@ -1334,7 +1334,7 @@ safely_chroot(const char *path, uid_t uid)
1334 char component[PATH_MAX]; 1334 char component[PATH_MAX];
1335 struct stat st; 1335 struct stat st;
1336 1336
1337 if (*path != '/') 1337 if (!path_absolute(path))
1338 fatal("chroot path does not begin at root"); 1338 fatal("chroot path does not begin at root");
1339 if (strlen(path) >= sizeof(component)) 1339 if (strlen(path) >= sizeof(component))
1340 fatal("chroot path too long"); 1340 fatal("chroot path too long");