Re: [hackers] [quark] Fix dir-check in dirent || Laslo Hunhold

From: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Wed, 28 Jun 2017 09:53:56 +0200

On Wed, Jun 28, 2017 at 08:30:13AM +0200, git_AT_suckless.org wrote:
> commit 1e65a4848e04660ae4d4717777ef418993da6a7e
> Author: Laslo Hunhold <dev_AT_frign.de>
> AuthorDate: Wed Jun 28 08:29:31 2017 +0200
> Commit: Laslo Hunhold <dev_AT_frign.de>
> CommitDate: Wed Jun 28 08:29:31 2017 +0200
>
> Fix dir-check in dirent
>
> We cannot do this, as it falsely added a / to a link pointing to a
> socket.
>
> diff --git a/quark.c b/quark.c
> index 3c80be1..49cef68 100644
> --- a/quark.c
> +++ b/quark.c
> _AT_@ -387,7 +387,7 @@ senddir(int fd, char *name, struct request *r)
> /* entry line */
> if (dprintf(fd, "<br />\n\t\t<a href=\"%s%s\">%s%s</a>",
> e[i]->d_name,
> - (e[i]->d_type & DT_DIR ? "/" : ""),
> + (e[i]->d_type == DT_DIR) ? "/" : "",
> e[i]->d_name,
> filetype(e[i]->d_type)) < 0) {
> s = S_REQUEST_TIMEOUT;
>

Sorry, *puppyeyes*.

Nice catch :)

-- 
Kind regards,
Hiltjo
Received on Wed Jun 28 2017 - 09:53:56 CEST

This archive was generated by hypermail 2.3.0 : Wed Jun 28 2017 - 10:00:21 CEST