From 34ad19a1eb2875d99464a986bcd6d82dac34ca63 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 19 Sep 2026 23:22:02 +0100 Subject: [PATCH] box, serve s3: fix log messages with bad format strings The box backend logged an int64 with %q which printed %!q(int64=123) instead of the sequence ID. serve s3 passed the message from gofakes3 as the format string, so any % in it was interpreted as a formatting directive and the message was mangled. (cherry picked from commit 1c3e432c3fdbf98c5800c0390496d6944bac53b0) --- backend/box/box.go | 2 +- cmd/serve/s3/logger.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/box/box.go b/backend/box/box.go index 35ee52c27..7ad816ceb 100644 --- a/backend/box/box.go +++ b/backend/box/box.go @@ -1461,7 +1461,7 @@ func (f *Fs) changeNotifyRunner(ctx context.Context, notifyFunc func(string, fs. // Item in the cache has the same or newer SequenceID than // this event. Ignore this event, it must be old. f.itemMetaCacheMu.Unlock() - fs.Debugf(f, "%s ignored due to old SequenceID (%q)", eventDetails, itemMeta.SequenceID) + fs.Debugf(f, "%s ignored due to old SequenceID (%d)", eventDetails, itemMeta.SequenceID) continue } diff --git a/cmd/serve/s3/logger.go b/cmd/serve/s3/logger.go index cb0337f95..73afc5bdf 100644 --- a/cmd/serve/s3/logger.go +++ b/cmd/serve/s3/logger.go @@ -26,10 +26,10 @@ func (l logger) Print(level gofakes3.LogLevel, v ...any) { default: fallthrough case gofakes3.LogErr: - fs.Errorf("serve s3", s) + fs.Errorf("serve s3", "%s", s) case gofakes3.LogWarn: - fs.Infof("serve s3", s) + fs.Infof("serve s3", "%s", s) case gofakes3.LogInfo: - fs.Debugf("serve s3", s) + fs.Debugf("serve s3", "%s", s) } }