Skip to content

Commit 8dee5dc

Browse files
committed
in_tail: rerun glob without GLOB_ERR if there is permission error
Signed-off-by: Kyosuke Kariya <[email protected]>
1 parent 42e29d6 commit 8dee5dc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

plugins/in_tail/tail_scan_glob.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,11 @@ static int tail_scan_path(const char *path, struct flb_tail_config *ctx)
205205

206206
/* Scan the given path */
207207
ret = do_glob(path, GLOB_TILDE | GLOB_ERR, NULL, &globbuf);
208+
if (ret == GLOB_ABORTED) {
209+
flb_plg_warn(ctx->ins, "read error, check permissions: %s", path);
210+
globfree(&globbuf);
211+
ret = do_glob(path, GLOB_TILDE, NULL, &globbuf);
212+
}
208213
if (ret != 0) {
209214
switch (ret) {
210215
case GLOB_NOSPACE:

0 commit comments

Comments
 (0)