From a0499bbd31ddcef0ac3fa8e3c4e5b8f2fc2342bd Mon Sep 17 00:00:00 2001 From: Benny Halevy Date: Wed, 26 Jun 2019 14:07:34 +0300 Subject: [PATCH] lister::guarantee_type: do not follow symlink Simliar to commit 9785754e0dada98ace5342359036306bb923ae3e lister::guarantee_type needs to check the entry's type, not the symlink it may point to. Fixes #4606 The nodetool_refresh_with_wrong_upload_modes_test dtest creates a broken symlink and following it fails, as it should, with the default follow_symlink::yes Signed-off-by: Benny Halevy Message-Id: <20190626110734.4558-1-bhalevy@scylladb.com> --- lister.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lister.cc b/lister.cc index 5ed74edc6f..aa70f0adb3 100644 --- a/lister.cc +++ b/lister.cc @@ -42,7 +42,7 @@ future lister::guarantee_type(directory_entry de) { if (de.type) { return make_ready_future(std::move(de)); } else { - auto f = engine().file_type((_dir / de.name.c_str()).native()); + auto f = engine().file_type((_dir / de.name.c_str()).native(), follow_symlink::no); return f.then([dir = _dir, de = std::move(de)] (std::optional t) mutable { // If some FS error occures - return an exceptional future if (!t) {