Skip to content

Commit

Permalink
reduce verbosity of missing kernel support warning for secure symlink (
Browse files Browse the repository at this point in the history
  • Loading branch information
strideynet committed May 4, 2022
1 parent 06d4b9b commit 29b3f3d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tool/tbot/botfs/fs_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 29b3f3d

Please sign in to comment.