summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2013-06-19 01:23:20 -0400
committerAllan McRae <allan@archlinux.org>2013-06-26 15:32:16 +1000
commit96ac9c52995ff5be8c4ed9f71f1bf08d0d0f0872 (patch)
tree53addf6908d768ed9b07ee9b89656dede4ecf2bb
parentb36b87656ef8e341dccc5c683ed9f814c0017c67 (diff)
downloadpacman-96ac9c52995ff5be8c4ed9f71f1bf08d0d0f0872.tar.xz
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 <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--src/pacman/query.c2
1 files changed, 1 insertions, 1 deletions
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);
}