Skip to content

Commit 0ab22ba

Browse files
Merge branch 'main' into copilot/fix-cve-2025-68121-crypto-tls
2 parents 1e701b2 + 326642f commit 0ab22ba

File tree

9 files changed

+50
-33
lines changed

9 files changed

+50
-33
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ component/azstorage/logfile.txt
2626
logfile.txt
2727
**/logfile.txt
2828
**/logfile.txt.*
29+
# Test trace files
30+
*/_tmp_*.trace
31+
_tmp_*.trace
2932
# Emacs backup and auto-save files
3033
*~
3134
\#*\#

cmd/gen-config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ var generatedConfig = &cobra.Command{
113113

114114
sb.WriteString("\ncomponents:\n")
115115
for _, component := range pipeline {
116-
sb.WriteString(fmt.Sprintf(" - %s\n", component))
116+
fmt.Fprintf(&sb, " - %s\n", component)
117117
}
118118

119119
for _, component := range pipeline {

component/attr_cache/attr_cache.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ func (ac *AttrCache) GenConfig() string {
137137
log.Info("AttrCache::Configure : config generation started")
138138

139139
var sb strings.Builder
140-
sb.WriteString(fmt.Sprintf("\n%s:", ac.Name()))
141-
sb.WriteString(fmt.Sprintf("\n timeout-sec: %v", defaultAttrCacheTimeout))
140+
fmt.Fprintf(&sb, "\n%s:", ac.Name())
141+
fmt.Fprintf(&sb, "\n timeout-sec: %v", defaultAttrCacheTimeout)
142142

143143
return sb.String()
144144
}

component/azstorage/policies_test.go

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,32 @@ import (
4141

4242
"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
4343
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
44+
"github.com/Azure/azure-storage-fuse/v2/common"
45+
"github.com/Azure/azure-storage-fuse/v2/common/log"
4446
"github.com/stretchr/testify/assert"
4547
"github.com/stretchr/testify/suite"
4648
)
4749

50+
type mockTransport struct{}
51+
52+
func (m *mockTransport) Do(req *http.Request) (*http.Response, error) {
53+
return &http.Response{StatusCode: 200}, nil
54+
}
55+
4856
type policiesTestSuite struct {
4957
suite.Suite
5058
}
5159

52-
type mockTransport struct{}
60+
func (s *policiesTestSuite) SetupTest() {
61+
// Initialize the logger
62+
err := log.SetDefaultLogger("silent", common.LogConfig{Level: common.ELogLevel.LOG_DEBUG()})
63+
if err != nil {
64+
panic("Unable to set silent logger as default.")
65+
}
66+
}
5367

54-
func (m *mockTransport) Do(req *http.Request) (*http.Response, error) {
55-
return &http.Response{StatusCode: 200}, nil
68+
func (s *policiesTestSuite) TearDownTest() {
69+
_ = log.Destroy()
5670
}
5771

5872
func (s *policiesTestSuite) TestRateLimitingPolicy_OpsLimit() {

component/block_cache/block_cache.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,19 +199,19 @@ func (bc *BlockCache) GenConfig() string {
199199
}
200200

201201
var sb strings.Builder
202-
sb.WriteString(fmt.Sprintf("\n%s:", bc.Name()))
202+
fmt.Fprintf(&sb, "\n%s:", bc.Name())
203203

204-
sb.WriteString(fmt.Sprintf("\n block-size-mb: %v", defaultBlockSize))
205-
sb.WriteString(fmt.Sprintf("\n mem-size-mb: %v", memSize))
206-
sb.WriteString(fmt.Sprintf("\n prefetch: %v", prefetch))
207-
sb.WriteString(fmt.Sprintf("\n parallelism: %v", uint32(3*runtime.NumCPU())))
204+
fmt.Fprintf(&sb, "\n block-size-mb: %v", defaultBlockSize)
205+
fmt.Fprintf(&sb, "\n mem-size-mb: %v", memSize)
206+
fmt.Fprintf(&sb, "\n prefetch: %v", prefetch)
207+
fmt.Fprintf(&sb, "\n parallelism: %v", uint32(3*runtime.NumCPU()))
208208

209209
var tmpPath = ""
210210
_ = config.UnmarshalKey("tmp-path", &tmpPath)
211211
if tmpPath != "" {
212-
sb.WriteString(fmt.Sprintf("\n path: %v", tmpPath))
213-
sb.WriteString(fmt.Sprintf("\n disk-size-mb: %v", bc.getDefaultDiskSize(tmpPath)))
214-
sb.WriteString(fmt.Sprintf("\n disk-timeout-sec: %v", defaultTimeout))
212+
fmt.Fprintf(&sb, "\n path: %v", tmpPath)
213+
fmt.Fprintf(&sb, "\n disk-size-mb: %v", bc.getDefaultDiskSize(tmpPath))
214+
fmt.Fprintf(&sb, "\n disk-timeout-sec: %v", defaultTimeout)
215215
}
216216

217217
return sb.String()

component/file_cache/file_cache.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ func (fc *FileCache) GenConfig() string {
191191
log.Info("FileCache::Configure : config generation started")
192192

193193
var sb strings.Builder
194-
sb.WriteString(fmt.Sprintf("\n%s:", fc.Name()))
194+
fmt.Fprintf(&sb, "\n%s:", fc.Name())
195195

196196
tmpPath := ""
197197
_ = config.UnmarshalKey("tmp-path", &tmpPath)
@@ -204,8 +204,8 @@ func (fc *FileCache) GenConfig() string {
204204
timeout = 0
205205
}
206206

207-
sb.WriteString(fmt.Sprintf("\n path: %v", common.ExpandPath(tmpPath)))
208-
sb.WriteString(fmt.Sprintf("\n timeout-sec: %v", timeout))
207+
fmt.Fprintf(&sb, "\n path: %v", common.ExpandPath(tmpPath))
208+
fmt.Fprintf(&sb, "\n timeout-sec: %v", timeout)
209209

210210
return sb.String()
211211
}

component/libfuse/libfuse.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,17 +268,17 @@ func (lf *Libfuse) GenConfig() string {
268268
_ = config.UnmarshalKey("direct-io", &directIO)
269269

270270
var sb strings.Builder
271-
sb.WriteString(fmt.Sprintf("\n%s:", lf.Name()))
271+
fmt.Fprintf(&sb, "\n%s:", lf.Name())
272272

273273
timeout := defaultEntryExpiration
274274
if directIO {
275275
timeout = 0
276276
sb.WriteString("\n direct-io: true")
277277
}
278278

279-
sb.WriteString(fmt.Sprintf("\n attribute-expiration-sec: %v", timeout))
280-
sb.WriteString(fmt.Sprintf("\n entry-expiration-sec: %v", timeout))
281-
sb.WriteString(fmt.Sprintf("\n negative-entry-expiration-sec: %v", timeout))
279+
fmt.Fprintf(&sb, "\n attribute-expiration-sec: %v", timeout)
280+
fmt.Fprintf(&sb, "\n entry-expiration-sec: %v", timeout)
281+
fmt.Fprintf(&sb, "\n negative-entry-expiration-sec: %v", timeout)
282282

283283
return sb.String()
284284
}

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ require (
3535
github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0 // indirect
3636
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
3737
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
38-
github.com/golang-jwt/jwt/v5 v5.3.0 // indirect
38+
github.com/golang-jwt/jwt/v5 v5.3.1 // indirect
3939
github.com/google/uuid v1.6.0 // indirect
4040
github.com/inconshreveable/mousetrap v1.1.0 // indirect
4141
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect
@@ -50,8 +50,8 @@ require (
5050
github.com/spf13/cast v1.10.0 // indirect
5151
github.com/subosito/gotenv v1.6.0 // indirect
5252
go.yaml.in/yaml/v3 v3.0.4 // indirect
53-
golang.org/x/crypto v0.47.0 // indirect
54-
golang.org/x/net v0.49.0 // indirect
53+
golang.org/x/crypto v0.48.0 // indirect
54+
golang.org/x/net v0.50.0 // indirect
5555
golang.org/x/sys v0.41.0
56-
golang.org/x/text v0.33.0 // indirect
56+
golang.org/x/text v0.34.0 // indirect
5757
)

go.sum

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S
3131
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
3232
github.com/go-viper/mapstructure/v2 v2.5.0 h1:vM5IJoUAy3d7zRSVtIwQgBj7BiWtMPfmPEgAXnvj1Ro=
3333
github.com/go-viper/mapstructure/v2 v2.5.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
34-
github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo=
35-
github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE=
34+
github.com/golang-jwt/jwt/v5 v5.3.1 h1:kYf81DTWFe7t+1VvL7eS+jKFVWaUnK9cB1qbwn63YCY=
35+
github.com/golang-jwt/jwt/v5 v5.3.1/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE=
3636
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
3737
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
3838
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
@@ -107,14 +107,14 @@ go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
107107
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
108108
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
109109
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
110-
golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8=
111-
golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A=
110+
golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts=
111+
golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos=
112112
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
113113
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
114114
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
115115
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
116-
golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o=
117-
golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8=
116+
golang.org/x/net v0.50.0 h1:ucWh9eiCGyDR3vtzso0WMQinm2Dnt8cFMuQa9K33J60=
117+
golang.org/x/net v0.50.0/go.mod h1:UgoSli3F/pBgdJBHCTc+tp3gmrU4XswgGRgtnwWTfyM=
118118
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
119119
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
120120
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -128,8 +128,8 @@ golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
128128
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
129129
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
130130
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
131-
golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE=
132-
golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8=
131+
golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk=
132+
golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA=
133133
golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=
134134
golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
135135
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=

0 commit comments

Comments
 (0)