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>
This commit is contained in:
Andrew Gregory 2013-06-19 01:23:20 -04:00 committed by Allan McRae
parent b36b87656e
commit 96ac9c5299
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}