From b749c702ab1f1a950f0bfb90d87fdcecdc1ebc75 Mon Sep 17 00:00:00 2001 From: Noah Date: Tue, 3 May 2022 21:36:38 +0100 Subject: [PATCH] reduce verbosity of missing kernel support warning for secure symlink --- tool/tbot/botfs/fs_linux.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tool/tbot/botfs/fs_linux.go b/tool/tbot/botfs/fs_linux.go index c0e010569c40a..592c437586f1c 100644 --- a/tool/tbot/botfs/fs_linux.go +++ b/tool/tbot/botfs/fs_linux.go @@ -98,10 +98,13 @@ func openSymlinksMode(path string, symlinksMode SymlinksMode) (*os.File, error) case SymlinksTrySecure: file, err = openSecure(path) if err == unix.ENOSYS { - log.Warnf("Failed to write to %q securely due to missing "+ - "syscall; falling back to regular file write. Set "+ - "`symlinks: insecure` on this destination to disable this "+ - "warning.", path) + missingSyscallWarning.Do(func() { + log.Warnf("Failed to write to %q securely due to missing "+ + "syscall; falling back to regular file write. Set "+ + "`symlinks: insecure` on this destination to disable this "+ + "warning.", path) + }) + file, err = openStandard(path) if err != nil { return nil, trace.Wrap(err)