mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Remove CodeQL errors
This commit is contained in:
parent
e0a0fdc984
commit
4032d4f66a
@ -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)
|
||||
|
@ -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()
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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())
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user