[pacman-dev] [PATCH] query_fileowner: remove trailing '/' from targets
Allan McRae
allan at archlinux.org
Thu Jul 26 01:45:55 EDT 2012
On 26/07/12 15:04, Andrew Gregory wrote:
> Trailing '/' in paths causes lstat to dereference symlinks to directories which
> causes it to break even though the symlink is a valid target.
>
> Signed-off-by: Andrew Gregory <andrew.gregory.8 at gmail.com>
> ---
> src/pacman/query.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/src/pacman/query.c b/src/pacman/query.c
> index 176f91c..d145707 100644
> --- a/src/pacman/query.c
> +++ b/src/pacman/query.c
> @@ -137,6 +137,12 @@ static int query_fileowner(alpm_list_t *targets)
>
> filename = strdup(t->data);
>
> + /* trailing '/' causes lstat to dereference directory symlinks */
> + size_t len = strlen(filename) - 1;
The current style is to declare all variables at the start of the
function. I made that adjustment and pushed to my working branch.
Allan
More information about the pacman-dev
mailing list