From d595e2a0a3d55589e432e7a5a1334293439455d0 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 1 Oct 2023 01:49:38 -0500 Subject: [PATCH] Add missing follow symlink check. --- toys/posix/tar.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/toys/posix/tar.c b/toys/posix/tar.c index 0f9b39c0..01578a5c 100644 --- a/toys/posix/tar.c +++ b/toys/posix/tar.c @@ -284,7 +284,8 @@ static int add_to_tar(struct dirtree *node) if (S_ISDIR(st->st_mode) && !node->again) { free(name); - return DIRTREE_BREADTH; + return DIRTREE_BREADTH|DIRTREE_SYMFOLLOW*FLAG(h); + } else if ((node->again&DIRTREE_BREADTH) && node->child) { struct dirtree *dt, **sort = xmalloc(sizeof(void *)*node->extra); -- 2.39.2