diff options
author | djm@openbsd.org <djm@openbsd.org> | 2018-11-16 03:26:01 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2018-11-16 14:37:33 +1100 |
commit | 2a35862e664afde774d4a72497d394fe7306ccb5 (patch) | |
tree | 501d6d170178b037829003b76cbd32e23e6080bb /servconf.c | |
parent | d0d1dfa55be1c5c0d77ab3096b198a64235f936d (diff) |
upstream: use path_absolute() for pathname checks; from Manoj Ampalam
OpenBSD-Commit-ID: 482ce71a5ea5c5f3bc4d00fd719481a6a584d925
Diffstat (limited to 'servconf.c')
-rw-r--r-- | servconf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/servconf.c b/servconf.c index 932d363bb..a8727c0fa 100644 --- a/servconf.c +++ b/servconf.c | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | ||
2 | /* $OpenBSD: servconf.c,v 1.342 2018/09/20 23:40:16 djm Exp $ */ | 2 | /* $OpenBSD: servconf.c,v 1.343 2018/11/16 03:26:01 djm Exp $ */ |
3 | /* | 3 | /* |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
5 | * All rights reserved | 5 | * All rights reserved |
@@ -702,7 +702,7 @@ derelativise_path(const char *path) | |||
702 | if (strcasecmp(path, "none") == 0) | 702 | if (strcasecmp(path, "none") == 0) |
703 | return xstrdup("none"); | 703 | return xstrdup("none"); |
704 | expanded = tilde_expand_filename(path, getuid()); | 704 | expanded = tilde_expand_filename(path, getuid()); |
705 | if (*expanded == '/') | 705 | if (path_absolute(expanded)) |
706 | return expanded; | 706 | return expanded; |
707 | if (getcwd(cwd, sizeof(cwd)) == NULL) | 707 | if (getcwd(cwd, sizeof(cwd)) == NULL) |
708 | fatal("%s: getcwd: %s", __func__, strerror(errno)); | 708 | fatal("%s: getcwd: %s", __func__, strerror(errno)); |