From 96ac9c52995ff5be8c4ed9f71f1bf08d0d0f0872 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Wed, 19 Jun 2013 01:23:20 -0400 Subject: query_fileowner: resolve trailing . or .. in paths The full path needs to resolved any time it ends with "." or "..", not just when those are the entire path. This allows strange-but-valid paths such as: "/home/." to be queried. Signed-off-by: Andrew Gregory Signed-off-by: Allan McRae --- src/pacman/query.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pacman') diff --git a/src/pacman/query.c b/src/pacman/query.c index f27c5c29..c9c82b94 100644 --- a/src/pacman/query.c +++ b/src/pacman/query.c @@ -102,7 +102,7 @@ static char *lrealpath(const char *path, char *resolved_path) char *rpath = NULL, *dname = NULL; int success = 0; - if(strcmp(path, ".") == 0 || strcmp(path, "..") == 0) { + if(strcmp(bname, ".") == 0 || strcmp(bname, "..") == 0) { /* the entire path needs to be resolved */ return realpath(path, resolved_path); } -- cgit v1.2.3