mirror of
https://github.com/minio/mc.git
synced 2025-11-09 02:22:18 +03:00
support missing role-arn and role-session-name (#4763)
This commit is contained in:
@@ -84,6 +84,9 @@ func max(a, b int) int {
|
||||
|
||||
// randString generates random names and prepends them with a known prefix.
|
||||
func randString(n int, src rand.Source, prefix string) string {
|
||||
if n == 0 {
|
||||
return prefix
|
||||
}
|
||||
b := make([]byte, n)
|
||||
// A rand.Int63() generates 63 random bits, enough for letterIdxMax letters!
|
||||
for i, cache, remain := n-1, src.Int63(), letterIdxMax; i >= 0; {
|
||||
@@ -97,7 +100,11 @@ func randString(n int, src rand.Source, prefix string) string {
|
||||
cache >>= letterIdxBits
|
||||
remain--
|
||||
}
|
||||
return prefix + string(b[0:30-len(prefix)])
|
||||
x := n / 2
|
||||
if x == 0 {
|
||||
x = 1
|
||||
}
|
||||
return prefix + string(b[0:x])
|
||||
}
|
||||
|
||||
// printTLSCertInfo prints some fields of the certificates received from the server.
|
||||
|
||||
Reference in New Issue
Block a user