Remove CodeQL errors

dependabot/go_modules/go.uber.org/atomic-1.10.0
Marek Siarkowicz 2022-01-12 16:24:54 +01:00
parent e0a0fdc984
commit 4032d4f66a
4 changed files with 6 additions and 3 deletions

View File

@ -60,7 +60,7 @@ func printcURL(req *http.Request) error {
command += fmt.Sprintf(" -d %q", string(b))
}
fmt.Fprintf(os.Stderr, "cURL Command: %s\n", command)
fmt.Fprintf(os.Stderr, "cURL Command: %q\n", command)
// reset body
body := bytes.NewBuffer(b)

View File

@ -286,7 +286,6 @@ func saveDB(lg *zap.Logger, destDB, srcDB string, idx uint64, term uint64, desir
case src = <-ch:
case <-time.After(time.Second):
lg.Fatal("timed out waiting to acquire lock on", zap.String("srcDB", srcDB))
src = <-ch
}
defer src.Close()

View File

@ -122,7 +122,7 @@ func authUsersDecoder(k, v []byte) {
if err != nil {
panic(err)
}
fmt.Printf("user=%q, roles=%q, password=%q, option=%v\n", user.Name, user.Roles, string(user.Password), user.Options)
fmt.Printf("user=%q, roles=%q, option=%v\n", user.Name, user.Roles, user.Options)
}
func iterateBucket(dbPath, bucket string, limit uint64, decode bool) (err error) {

View File

@ -232,6 +232,10 @@ type EntryPrinter func(e raftpb.Entry)
func printInternalRaftRequest(entry raftpb.Entry) {
var rr etcdserverpb.InternalRaftRequest
if err := rr.Unmarshal(entry.Data); err == nil {
// Ensure we don't log user password
if rr.AuthUserChangePassword != nil && rr.AuthUserChangePassword.Password != "" {
rr.AuthUserChangePassword.Password = "<value removed>"
}
fmt.Printf("%4d\t%10d\tnorm\t%s", entry.Term, entry.Index, rr.String())
}
}