mirror of
https://github.com/moparisthebest/pacman
synced 2025-02-28 09:21:53 -05:00
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:
parent
b36b87656e
commit
96ac9c5299
@ -102,7 +102,7 @@ static char *lrealpath(const char *path, char *resolved_path)
|
|||||||
char *rpath = NULL, *dname = NULL;
|
char *rpath = NULL, *dname = NULL;
|
||||||
int success = 0;
|
int success = 0;
|
||||||
|
|
||||||
if(strcmp(path, ".") == 0 || strcmp(path, "..") == 0) {
|
if(strcmp(bname, ".") == 0 || strcmp(bname, "..") == 0) {
|
||||||
/* the entire path needs to be resolved */
|
/* the entire path needs to be resolved */
|
||||||
return realpath(path, resolved_path);
|
return realpath(path, resolved_path);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user