Compare commits

..

6 Commits

Author SHA1 Message Date
Tian Teng
9fa9fef47b
Merge 2ac84ddd382d4459632fe59f0919551e78e6170e into d75fcd4c9ab260e5225de590f1f0f8c0e0e12d11 2026-06-02 22:40:07 +02:00
Herrtian
2ac84ddd38 refactor: cover directory setup helper 2026-05-22 13:35:04 +02:00
Herrtian
eea9cbc48e test: avoid partial coverage in dir helper 2026-05-22 13:29:52 +02:00
Herrtian
ca0bc54ee1 test: improve upload permission coverage 2026-05-22 13:09:13 +02:00
Herrtian
a3e91a0053 test: cover uploaded file directory permissions 2026-05-22 13:02:47 +02:00
tengtian
6cfac86ae7 fix: skip chmod on existing directories in SaveUploadedFile
SaveUploadedFile called os.Chmod on the target directory even if it
already existed. This breaks when saving to system directories like
/tmp where the process lacks permission to chmod.

Now only newly created directories get chmod'd. Existing directories
are left as-is, which is the correct behavior since the caller should
not modify permissions of directories they don't own.

Fixes #4622
2026-04-15 20:02:50 +02:00
2 changed files with 3 additions and 3 deletions

2
go.mod
View File

@ -12,7 +12,7 @@ require (
github.com/mattn/go-isatty v0.0.20
github.com/modern-go/reflect2 v1.0.2
github.com/pelletier/go-toml/v2 v2.2.4
github.com/quic-go/quic-go v0.59.1
github.com/quic-go/quic-go v0.59.0
github.com/stretchr/testify v1.11.1
github.com/ugorji/go/codec v1.3.1
go.mongodb.org/mongo-driver/v2 v2.5.0

4
go.sum
View File

@ -52,8 +52,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/quic-go/qpack v0.6.0 h1:g7W+BMYynC1LbYLSqRt8PBg5Tgwxn214ZZR34VIOjz8=
github.com/quic-go/qpack v0.6.0/go.mod h1:lUpLKChi8njB4ty2bFLX2x4gzDqXwUpaO1DP9qMDZII=
github.com/quic-go/quic-go v0.59.1 h1:0Gmua0HW1Tv7ANR7hUYwRyD0MG5OJfgvYSZasGZzBic=
github.com/quic-go/quic-go v0.59.1/go.mod h1:upnsH4Ju1YkqpLXC305eW3yDZ4NfnNbmQRCMWS58IKU=
github.com/quic-go/quic-go v0.59.0 h1:OLJkp1Mlm/aS7dpKgTc6cnpynnD2Xg7C1pwL6vy/SAw=
github.com/quic-go/quic-go v0.59.0/go.mod h1:upnsH4Ju1YkqpLXC305eW3yDZ4NfnNbmQRCMWS58IKU=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=