diff --git a/go.mod b/go.mod index eaec9732..ae4269de 100644 --- a/go.mod +++ b/go.mod @@ -9,32 +9,33 @@ require ( github.com/bitrise-io/go-android v0.0.0-20210517091621-72f0eb7a5197 github.com/bitrise-io/go-steputils v1.0.5 github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.20 - github.com/bitrise-io/go-utils v1.0.9 - github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.19 - github.com/bitrise-io/go-xcode v1.0.16 + github.com/bitrise-io/go-utils v1.0.11 + github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.20 + github.com/bitrise-io/go-xcode v1.0.18 + github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.41 github.com/google/go-cmp v0.5.9 github.com/gorilla/mux v1.8.0 github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.8.4 - howett.net/plist v1.0.0 + howett.net/plist v1.0.1 ) require ( - github.com/bitrise-io/go-pkcs12 v0.0.0-20230815095624-feb898696e02 // indirect + github.com/bitrise-io/go-pkcs12 v0.0.0-20230913085202-b40653eb06c7 // indirect github.com/bitrise-io/goinp v0.0.0-20211005113137-305e91b481f4 // indirect github.com/bitrise-io/stepman v0.0.0-20220808095634-6e12d2726f30 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-retryablehttp v0.7.1 // indirect + github.com/hashicorp/go-retryablehttp v0.7.4 // indirect github.com/hashicorp/go-version v1.6.0 // indirect github.com/klauspost/compress v1.12.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/ryanuber/go-glob v1.0.0 // indirect - github.com/stretchr/objx v0.5.0 // indirect - golang.org/x/crypto v0.17.0 // indirect - golang.org/x/sys v0.15.0 // indirect - golang.org/x/term v0.15.0 // indirect + github.com/stretchr/objx v0.5.1 // indirect + golang.org/x/crypto v0.19.0 // indirect + golang.org/x/sys v0.17.0 // indirect + golang.org/x/term v0.17.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 26ff1b68..5875d0cc 100644 --- a/go.sum +++ b/go.sum @@ -19,8 +19,8 @@ github.com/bitrise-io/envman v0.0.0-20220401145857-d11e00a5dc55 h1:uU2j30ndTLUdt github.com/bitrise-io/envman v0.0.0-20220401145857-d11e00a5dc55/go.mod h1:L4WQyg88d87Z4dxNwrYEa0Cwd9/W0gSfXsibw30r8Vw= github.com/bitrise-io/go-android v0.0.0-20210517091621-72f0eb7a5197 h1:rdMOrZ6f5T8evFF8o+lBj9p5dPiwm+t7yCwHBGD3qZI= github.com/bitrise-io/go-android v0.0.0-20210517091621-72f0eb7a5197/go.mod h1:vcNcrAM6B5gDdgDZ9n51FTLT/kTHmiWatjCkJcstCNY= -github.com/bitrise-io/go-pkcs12 v0.0.0-20230815095624-feb898696e02 h1:DoXD85rP+di4sJplai0Fyvvt0HBK7umrqVHTGBnkaaQ= -github.com/bitrise-io/go-pkcs12 v0.0.0-20230815095624-feb898696e02/go.mod h1:R3yKQBGvbDTB/B173ZV/MnRfn6AERDUVeWxH8ZtwXcY= +github.com/bitrise-io/go-pkcs12 v0.0.0-20230913085202-b40653eb06c7 h1:UgbAP2//OniQV9K5tHg7jnPfSYAy5ujXyH6E7L7CTBQ= +github.com/bitrise-io/go-pkcs12 v0.0.0-20230913085202-b40653eb06c7/go.mod h1:fly5xmzjteedkhq4NJiEFbtC6KjvFdNeFxaTw2yF//k= github.com/bitrise-io/go-steputils v0.0.0-20210514150206-5b6261447e77/go.mod h1:H0iZjgsAR5NA6pnlD/zKB6AbxEsskq55pwJ9klVmP8w= github.com/bitrise-io/go-steputils v1.0.5 h1:OBH7CPXeqIWFWJw6BOUMQnUb8guspwKr2RhYBhM9tfc= github.com/bitrise-io/go-steputils v1.0.5/go.mod h1:YIUaQnIAyK4pCvQG0hYHVkSzKNT9uL2FWmkFNW4mfNI= @@ -31,13 +31,15 @@ github.com/bitrise-io/go-utils v0.0.0-20210505121718-07411d72e36e/go.mod h1:nhda github.com/bitrise-io/go-utils v0.0.0-20210507100250-37de47dfa6ce/go.mod h1:15EZZf02noI5nWFqXMZEoyb1CyqYRXTMz5Fyu4CWFzI= github.com/bitrise-io/go-utils v1.0.1/go.mod h1:ZY1DI+fEpZuFpO9szgDeICM4QbqoWVt0RSY3tRI1heY= github.com/bitrise-io/go-utils v1.0.2/go.mod h1:ZY1DI+fEpZuFpO9szgDeICM4QbqoWVt0RSY3tRI1heY= -github.com/bitrise-io/go-utils v1.0.9 h1:wy7FewUpseNSTZr41BbGH0csfFqzptFt4zy2pOAEOg0= -github.com/bitrise-io/go-utils v1.0.9/go.mod h1:ZY1DI+fEpZuFpO9szgDeICM4QbqoWVt0RSY3tRI1heY= +github.com/bitrise-io/go-utils v1.0.11 h1:NJ9rRWif4C6nhdh/v6Y/sJZU1UJ+yj0mDgnxsDr71ho= +github.com/bitrise-io/go-utils v1.0.11/go.mod h1:ZY1DI+fEpZuFpO9szgDeICM4QbqoWVt0RSY3tRI1heY= github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.10/go.mod h1:Ta/ards3Ih/3Q6X8tBtcj6zTHcNf1hRSXv1E8lPgIYk= -github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.19 h1:55as5Iv0N4btuRP3YwRzN+BCMtKO210MnJ8mpxmeI7o= -github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.19/go.mod h1:Laih4ji980SQkRgdnMCH0g4u2GZI/5nnbqmYT9UfKFQ= -github.com/bitrise-io/go-xcode v1.0.16 h1:G1IItfD2dvPNm7MLIWXFQHNPcafMVnw83M1lqCUH5L4= -github.com/bitrise-io/go-xcode v1.0.16/go.mod h1:9OwsvrhZ4A2JxHVoEY7CPcABAKA+OE7FQqFfBfvbFuY= +github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.20 h1:R+xJRWsuHhF/Pnx0gjI1+HH4Y0YSFVI+U/CbLpSx4sU= +github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.20/go.mod h1:Laih4ji980SQkRgdnMCH0g4u2GZI/5nnbqmYT9UfKFQ= +github.com/bitrise-io/go-xcode v1.0.18 h1:guFywV/AwcZuexqIQkL1ixc3QThpbJvA4voa9MqvPto= +github.com/bitrise-io/go-xcode v1.0.18/go.mod h1:9OwsvrhZ4A2JxHVoEY7CPcABAKA+OE7FQqFfBfvbFuY= +github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.41 h1:c2+CAi77gqQzs7IfXXeN1zzM2kgl+xxkaDmD68rci9c= +github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.41/go.mod h1:Y3K7ay6Q+znVKFmGGvr4jijnN8QmTBxB5+CatRtBl30= github.com/bitrise-io/goinp v0.0.0-20210504152833-8559b0680ab1/go.mod h1:iRbd8zAXLeNy+0gic0eqNCxXvDGe8ZEY/uYX2CCeAoo= github.com/bitrise-io/goinp v0.0.0-20211005113137-305e91b481f4 h1:ytUxnO7iSGHlNpbdjhDUefEM5WRy1kD2ElGfBA7r1PE= github.com/bitrise-io/goinp v0.0.0-20211005113137-305e91b481f4/go.mod h1:iRbd8zAXLeNy+0gic0eqNCxXvDGe8ZEY/uYX2CCeAoo= @@ -65,8 +67,8 @@ github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxC github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-retryablehttp v0.7.1 h1:sUiuQAnLlbvmExtFQs72iFW/HXeUn8Z1aJLQ4LJJbTQ= -github.com/hashicorp/go-retryablehttp v0.7.1/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= +github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA= +github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.4.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= @@ -96,14 +98,16 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.1 h1:4VhoImhV/Bm0ToFkXFi8hXNXwpDRZ/ynw3amt82mzq0= +github.com/stretchr/objx v0.5.1/go.mod h1:/iHQpkQwBD6DLUmQ4pE+s1TXdob1mORJ4/UFdrifcy0= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/urfave/cli v1.21.0/go.mod h1:lxDj6qX9Q6lWQxIrbrT0nwecwUtRnhVZAJjJZrVUZZQ= @@ -116,10 +120,8 @@ golang.org/x/crypto v0.0.0-20210503195802-e9a32991a82e/go.mod h1:P+XmwS30IXTQdn5 golang.org/x/crypto v0.0.0-20211202192323-5770296d904e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= -golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -139,17 +141,13 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220712014510-0a85c31ab51e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0= -golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= -golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= -golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= +golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -171,5 +169,5 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -howett.net/plist v1.0.0 h1:7CrbWYbPPO/PyNy38b2EB/+gYbjCe2DXBxgtOOZbSQM= -howett.net/plist v1.0.0/go.mod h1:lqaXoTrLY4hg8tnEzNru53gicrbv7rrk+2xJA/7hw9g= +howett.net/plist v1.0.1 h1:37GdZ8tP09Q35o9ych3ehygcsL+HqKSwzctveSlarvM= +howett.net/plist v1.0.1/go.mod h1:lqaXoTrLY4hg8tnEzNru53gicrbv7rrk+2xJA/7hw9g= diff --git a/uploaders/ipauploader.go b/uploaders/ipauploader.go index f57460f8..b28317e2 100644 --- a/uploaders/ipauploader.go +++ b/uploaders/ipauploader.go @@ -4,32 +4,38 @@ import ( "fmt" "github.com/bitrise-io/go-utils/log" + logV2 "github.com/bitrise-io/go-utils/v2/log" "github.com/bitrise-io/go-xcode/exportoptions" - "github.com/bitrise-io/go-xcode/ipa" - "github.com/bitrise-io/go-xcode/plistutil" - "github.com/bitrise-io/go-xcode/profileutil" + "github.com/bitrise-io/go-xcode/v2/zip" "github.com/bitrise-steplib/steps-deploy-to-bitrise-io/deployment" ) // DeployIPA ... func DeployIPA(item deployment.DeployableItem, buildURL, token, notifyUserGroups, notifyEmails string, isEnablePublicPage bool) (ArtifactURLs, error) { pth := item.Path - infoPlistPth, err := ipa.UnwrapEmbeddedInfoPlist(pth) + + reader, err := zip.NewReader(pth, logV2.NewLogger()) if err != nil { - return ArtifactURLs{}, fmt.Errorf("failed to unwrap Info.plist from ipa, error: %s", err) + return ArtifactURLs{}, fmt.Errorf("failed to open ipa file %s, error: %s", pth, err) } - - infoPlistData, err := plistutil.NewPlistDataFromFile(infoPlistPth) + defer func() { + if err := reader.Close(); err != nil { + log.Warnf("Failed to close archive: %s", pth) + } + }() + + ipaReader := zip.NewIPAReader(*reader) + infoPlist, err := ipaReader.AppInfoPlist() if err != nil { - return ArtifactURLs{}, fmt.Errorf("failed to parse Info.plist, error: %s", err) + return ArtifactURLs{}, fmt.Errorf("failed to unwrap Info.plist from ipa, error: %s", err) } - appTitle, _ := infoPlistData.GetString("CFBundleName") - bundleID, _ := infoPlistData.GetString("CFBundleIdentifier") - version, _ := infoPlistData.GetString("CFBundleShortVersionString") - buildNumber, _ := infoPlistData.GetString("CFBundleVersion") - minOSVersion, _ := infoPlistData.GetString("MinimumOSVersion") - deviceFamilyList, _ := infoPlistData.GetUInt64Array("UIDeviceFamily") + appTitle, _ := infoPlist.GetString("CFBundleName") + bundleID, _ := infoPlist.GetString("CFBundleIdentifier") + version, _ := infoPlist.GetString("CFBundleShortVersionString") + buildNumber, _ := infoPlist.GetString("CFBundleVersion") + minOSVersion, _ := infoPlist.GetString("MinimumOSVersion") + deviceFamilyList, _ := infoPlist.GetUInt64Array("UIDeviceFamily") appInfo := map[string]interface{}{ "app_title": appTitle, @@ -43,15 +49,9 @@ func DeployIPA(item deployment.DeployableItem, buildURL, token, notifyUserGroups log.Printf("ipa infos: %v", appInfo) // --- - - provisioningProfilePth, err := ipa.UnwrapEmbeddedMobileProvision(pth) - if err != nil { - return ArtifactURLs{}, fmt.Errorf("failed to unwrap embedded.mobilprovision from ipa, error: %s", err) - } - - provisioningProfileInfo, err := profileutil.NewProvisioningProfileInfoFromFile(provisioningProfilePth) + provisioningProfileInfo, err := ipaReader.ProvisioningProfileInfo() if err != nil { - return ArtifactURLs{}, fmt.Errorf("failed to parse embedded.mobilprovision, error: %s", err) + return ArtifactURLs{}, fmt.Errorf("failed to read profile info: %w", err) } teamName := provisioningProfileInfo.TeamName diff --git a/uploaders/xcarchiveuploader.go b/uploaders/xcarchiveuploader.go index 972074b9..7c21d5ad 100644 --- a/uploaders/xcarchiveuploader.go +++ b/uploaders/xcarchiveuploader.go @@ -2,43 +2,51 @@ package uploaders import ( "fmt" - "path/filepath" "github.com/bitrise-io/go-utils/log" - "github.com/bitrise-io/go-utils/pathutil" - "github.com/bitrise-io/go-xcode/xcarchive" + logV2 "github.com/bitrise-io/go-utils/v2/log" + "github.com/bitrise-io/go-xcode/v2/zip" "github.com/bitrise-steplib/steps-deploy-to-bitrise-io/deployment" ) // DeployXcarchive ... func DeployXcarchive(item deployment.DeployableItem, buildURL, token string) (ArtifactURLs, error) { pth := item.Path - unzippedPth, err := xcarchive.UnzipXcarchive(pth) + + reader, err := zip.NewReader(pth, logV2.NewLogger()) if err != nil { - return ArtifactURLs{}, err + return ArtifactURLs{}, fmt.Errorf("failed to open ipa file %s, error: %s", pth, err) } + defer func() { + if err := reader.Close(); err != nil { + log.Warnf("Failed to close archive: %s", pth) + } + }() - archivePth := filepath.Join(unzippedPth, pathutil.GetFileName(pth)) - isMacos, err := xcarchive.IsMacOS(archivePth) - if err != nil { - return ArtifactURLs{}, fmt.Errorf("could not check if given project is macOS or not, error: %s", err) - } else if isMacos { - log.Warnf("macOS archive deployment is not supported, skipping file: %s", archivePth) + xcarchiveReader := zip.NewXCArchiveReader(*reader) + isMacos := xcarchiveReader.IsMacOS() + if isMacos { + log.Warnf("macOS archive deployment is not supported, skipping file: %s", pth) return ArtifactURLs{}, nil // MacOS project is not supported, so won't be deployed. } + archiveInfoPlist, err := xcarchiveReader.InfoPlist() + if err != nil { + return ArtifactURLs{}, fmt.Errorf("failed to parse archive Info.plist from %s: %s", pth, err) + } - iosArchive, err := xcarchive.NewIosArchive(archivePth) + iosXCArchiveReader := zip.NewIOSXCArchiveReader(*reader) + appInfoPlist, err := iosXCArchiveReader.AppInfoPlist() if err != nil { - return ArtifactURLs{}, fmt.Errorf("failed to parse iOS XcArchive from %s. Error: %s", archivePth, err) + return ArtifactURLs{}, fmt.Errorf("failed to parse application Info.plist from %s: %s", pth, err) } - appTitle, _ := iosArchive.Application.InfoPlist.GetString("CFBundleName") - bundleID := iosArchive.Application.BundleIdentifier() - version, _ := iosArchive.Application.InfoPlist.GetString("CFBundleShortVersionString") - buildNumber, _ := iosArchive.Application.InfoPlist.GetString("CFBundleVersion") - minOSVersion, _ := iosArchive.Application.InfoPlist.GetString("MinimumOSVersion") - deviceFamilyList, _ := iosArchive.Application.InfoPlist.GetUInt64Array("UIDeviceFamily") - scheme, _ := iosArchive.InfoPlist.GetString("SchemeName") + appTitle, _ := appInfoPlist.GetString("CFBundleName") + bundleID, _ := appInfoPlist.GetString("CFBundleIdentifier") + version, _ := appInfoPlist.GetString("CFBundleShortVersionString") + buildNumber, _ := appInfoPlist.GetString("CFBundleVersion") + minOSVersion, _ := appInfoPlist.GetString("MinimumOSVersion") + deviceFamilyList, _ := appInfoPlist.GetUInt64Array("UIDeviceFamily") + scheme, _ := archiveInfoPlist.GetString("SchemeName") appInfo := map[string]interface{}{ "app_title": appTitle, diff --git a/vendor/github.com/bitrise-io/go-pkcs12/.gitignore b/vendor/github.com/bitrise-io/go-pkcs12/.gitignore index 8339fd61..ba836dc7 100644 --- a/vendor/github.com/bitrise-io/go-pkcs12/.gitignore +++ b/vendor/github.com/bitrise-io/go-pkcs12/.gitignore @@ -1,2 +1,3 @@ # Add no patterns to .hgignore except for files generated by the build. last-change +.idea diff --git a/vendor/github.com/bitrise-io/go-pkcs12/bitrise.yml b/vendor/github.com/bitrise-io/go-pkcs12/bitrise.yml new file mode 100644 index 00000000..cee305d1 --- /dev/null +++ b/vendor/github.com/bitrise-io/go-pkcs12/bitrise.yml @@ -0,0 +1,15 @@ +format_version: "13" +default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git + +workflows: + ci: + before_run: + - test + + test: + steps: + - git::https://github.com/bitrise-steplib/steps-check.git: + title: Lint + inputs: + - workflow: unit_test + - skip_step_yml_validation: "yes" diff --git a/vendor/github.com/bitrise-io/go-pkcs12/pkcs12.go b/vendor/github.com/bitrise-io/go-pkcs12/pkcs12.go index f2f2d8df..4d3f2b20 100644 --- a/vendor/github.com/bitrise-io/go-pkcs12/pkcs12.go +++ b/vendor/github.com/bitrise-io/go-pkcs12/pkcs12.go @@ -403,6 +403,122 @@ func DecodeTrustStore(pfxData []byte, password string) (certs []*x509.Certificat return } +var IncorrectAliasError = errors.New("pkcs12: incorrect key alias") +var IncorrectKeystorePasswordError = errors.New("pkcs12: incorrect keystore password") +var IncorrectKeyPasswordError = errors.New("pkcs12: incorrect key password") + +func DecodeKeystore(pfxData []byte, storepass, alias, keypass string) (privateKey interface{}, certificate *x509.Certificate, err error) { + encodedPassword, err := bmpStringZeroTerminated(storepass) + if err != nil { + return nil, nil, err + } + + encodedPrivateKeyPassword, err := bmpStringZeroTerminated(keypass) + if err != nil { + return nil, nil, err + } + + expectedNumberOfBags := 2 + bags, encodedPassword, err := getSafeContents(pfxData, encodedPassword, expectedNumberOfBags) + if err != nil { + if err == ErrIncorrectPassword { + return nil, nil, IncorrectKeystorePasswordError + } + return nil, nil, err + } + + if len(bags) != expectedNumberOfBags { + return nil, nil, fmt.Errorf("unexpected number of bags (%d), expected: %d", len(bags), expectedNumberOfBags) + } + + certAlias := "" + privateKeyAlias := "" + + for _, bag := range bags { + switch { + case bag.Id.Equal(oidCertBag): + certAlias, err = getAlias(bag) + if err != nil { + return nil, nil, fmt.Errorf("pkcs12: failed to get alias for the cert bag: %s", err) + } + + certsData, err := decodeCertBag(bag.Value.Bytes) + if err != nil { + return nil, nil, err + } + cert, err := x509.ParseCertificate(certsData) + if err != nil { + return nil, nil, err + } + + certificate = cert + case bag.Id.Equal(oidPKCS8ShroundedKeyBag): + privateKeyAlias, err = getAlias(bag) + if err != nil { + return nil, nil, fmt.Errorf("pkcs12: failed to get alias for the key bag: %s", err) + } + + key, err := decodePkcs8ShroudedKeyBag(bag.Value.Bytes, encodedPrivateKeyPassword) + if err != nil { + if err.Error() == "pkcs12: error decrypting PKCS#8 shrouded key bag: pkcs12: decryption error, incorrect padding" { + return nil, nil, IncorrectKeyPasswordError + } + return nil, nil, err + } + + privateKey = key + } + } + + if certificate == nil { + return nil, nil, errors.New("pkcs12: expected a certificate in the keystore") + } + if privateKey == nil { + return nil, nil, errors.New("pkcs12: expected a private key in the keystore") + } + if certAlias != privateKeyAlias { + return nil, nil, errors.New("pkcs12: expected same alias for the certificate and private key") + } + if certAlias != alias { + return nil, nil, IncorrectAliasError + } + + return +} + +func getAlias(bag safeBag) (string, error) { + if len(bag.Attributes) == 0 { + return "", errors.New("no attributes") + } + + var aliasAttribute *pkcs12Attribute + for _, attribute := range bag.Attributes { + if attribute.Id.Equal(oidFriendlyName) { + aliasAttribute = &attribute + break + } + } + + if aliasAttribute == nil { + return "", errors.New("alias attribute not found") + } + + if err := unmarshal(aliasAttribute.Value.Bytes, &aliasAttribute.Value); err != nil { + return "", err + } + + alias, err := decodeBMPString(aliasAttribute.Value.Bytes) + if err != nil { + return "", err + } + + if alias == "" { + return "", errors.New("empty alias") + } + + return alias, nil +} + func getSafeContents(p12Data, password []byte, expectedItems int) (bags []safeBag, updatedPassword []byte, err error) { pfx := new(pfxPdu) if err := unmarshal(p12Data, pfx); err != nil { diff --git a/vendor/github.com/bitrise-io/go-utils/command/command.go b/vendor/github.com/bitrise-io/go-utils/command/command.go index c068490e..3dcdac50 100644 --- a/vendor/github.com/bitrise-io/go-utils/command/command.go +++ b/vendor/github.com/bitrise-io/go-utils/command/command.go @@ -2,10 +2,10 @@ package command import ( "errors" + "fmt" "io" "os" "os/exec" - "strconv" "strings" ) @@ -125,7 +125,7 @@ func (m Model) PrintableCommandArgs() string { func PrintableCommandArgs(isQuoteFirst bool, fullCommandArgs []string) string { cmdArgsDecorated := []string{} for idx, anArg := range fullCommandArgs { - quotedArg := strconv.Quote(anArg) + quotedArg := fmt.Sprintf("\"%s\"", anArg) if idx == 0 && !isQuoteFirst { quotedArg = anArg } diff --git a/vendor/github.com/bitrise-io/go-utils/v2/command/command.go b/vendor/github.com/bitrise-io/go-utils/v2/command/command.go index 4206c2b3..5672ef69 100644 --- a/vendor/github.com/bitrise-io/go-utils/v2/command/command.go +++ b/vendor/github.com/bitrise-io/go-utils/v2/command/command.go @@ -5,7 +5,6 @@ import ( "fmt" "io" "os/exec" - "strconv" "strings" "github.com/bitrise-io/go-utils/v2/env" @@ -156,7 +155,7 @@ func (c command) Wait() error { func printableCommandArgs(isQuoteFirst bool, fullCommandArgs []string) string { var cmdArgsDecorated []string for idx, anArg := range fullCommandArgs { - quotedArg := strconv.Quote(anArg) + quotedArg := fmt.Sprintf("\"%s\"", anArg) if idx == 0 && !isQuoteFirst { quotedArg = anArg } diff --git a/vendor/github.com/bitrise-io/go-xcode/ipa/ipa.go b/vendor/github.com/bitrise-io/go-xcode/ipa/ipa.go deleted file mode 100644 index 7ca859e2..00000000 --- a/vendor/github.com/bitrise-io/go-xcode/ipa/ipa.go +++ /dev/null @@ -1,34 +0,0 @@ -package ipa - -import ( - "path/filepath" - - "github.com/bitrise-io/go-utils/pathutil" - "github.com/bitrise-io/go-utils/ziputil" - "github.com/bitrise-io/go-xcode/utility" -) - -func unwrapFileEmbeddedInPayloadAppDir(ipaPth, fileName string) (string, error) { - tmpDir, err := pathutil.NormalizedOSTempDirPath("__ipa__") - if err != nil { - return "", err - } - - if err := ziputil.UnZip(ipaPth, tmpDir); err != nil { - return "", err - } - - appDir := filepath.Join(tmpDir, "Payload") - - return utility.FindFileInAppDir(appDir, fileName) -} - -// UnwrapEmbeddedMobileProvision ... -func UnwrapEmbeddedMobileProvision(ipaPth string) (string, error) { - return unwrapFileEmbeddedInPayloadAppDir(ipaPth, "embedded.mobileprovision") -} - -// UnwrapEmbeddedInfoPlist ... -func UnwrapEmbeddedInfoPlist(ipaPth string) (string, error) { - return unwrapFileEmbeddedInPayloadAppDir(ipaPth, "Info.plist") -} diff --git a/vendor/github.com/bitrise-io/go-xcode/models/models.go b/vendor/github.com/bitrise-io/go-xcode/models/models.go deleted file mode 100644 index 42ea3721..00000000 --- a/vendor/github.com/bitrise-io/go-xcode/models/models.go +++ /dev/null @@ -1,8 +0,0 @@ -package models - -// XcodebuildVersionModel ... -type XcodebuildVersionModel struct { - Version string - BuildVersion string - MajorVersion int64 -} diff --git a/vendor/github.com/bitrise-io/go-xcode/utility/path.go b/vendor/github.com/bitrise-io/go-xcode/utility/path.go deleted file mode 100644 index 99db9138..00000000 --- a/vendor/github.com/bitrise-io/go-xcode/utility/path.go +++ /dev/null @@ -1,39 +0,0 @@ -package utility - -import ( - "fmt" - "path/filepath" - - "github.com/bitrise-io/go-utils/pathutil" -) - -// FindFileInAppDir ... -func FindFileInAppDir(appDir, fileName string) (string, error) { - filePth := filepath.Join(appDir, fileName) - if exist, err := pathutil.IsPathExists(filePth); err != nil { - return "", err - } else if exist { - return filePth, nil - } - // --- - - // It's somewhere else - let's find it! - apps, err := pathutil.ListEntries(appDir, pathutil.ExtensionFilter(".app", true)) - if err != nil { - return "", err - } - - for _, app := range apps { - pths, err := pathutil.ListEntries(app, pathutil.BaseFilter(fileName, true)) - if err != nil { - return "", err - } - - if len(pths) > 0 { - return pths[0], nil - } - } - // --- - - return "", fmt.Errorf("failed to find %s", fileName) -} diff --git a/vendor/github.com/bitrise-io/go-xcode/utility/utility.go b/vendor/github.com/bitrise-io/go-xcode/utility/utility.go deleted file mode 100644 index 8d942de7..00000000 --- a/vendor/github.com/bitrise-io/go-xcode/utility/utility.go +++ /dev/null @@ -1,72 +0,0 @@ -package utility - -import ( - "fmt" - "strconv" - "strings" - - "github.com/bitrise-io/go-utils/command" - "github.com/bitrise-io/go-xcode/models" -) - -// GetXcodeVersion ... -func GetXcodeVersion() (models.XcodebuildVersionModel, error) { - cmd := command.New("xcodebuild", "-version") - outStr, err := cmd.RunAndReturnTrimmedCombinedOutput() - if err != nil { - return models.XcodebuildVersionModel{}, fmt.Errorf("xcodebuild -version failed, err: %s, details: %s", err, outStr) - } - return getXcodeVersionFromXcodebuildOutput(outStr) -} - -func getXcodeVersionFromXcodebuildOutput(outStr string) (models.XcodebuildVersionModel, error) { - split := strings.Split(outStr, "\n") - if len(split) == 0 { - return models.XcodebuildVersionModel{}, fmt.Errorf("failed to parse xcodebuild version output (%s)", outStr) - } - - filteredOutput, err := filterXcodeWarnings(split) - if err != nil { - return models.XcodebuildVersionModel{}, err - } - - xcodebuildVersion := filteredOutput[0] - buildVersion := filteredOutput[1] - - split = strings.Split(xcodebuildVersion, " ") - if len(split) != 2 { - return models.XcodebuildVersionModel{}, fmt.Errorf("failed to parse xcodebuild version output (%s)", outStr) - } - - version := split[1] - - split = strings.Split(version, ".") - majorVersionStr := split[0] - - majorVersion, err := strconv.ParseInt(majorVersionStr, 10, 32) - if err != nil { - return models.XcodebuildVersionModel{}, fmt.Errorf("failed to parse xcodebuild version output (%s), error: %s", outStr, err) - } - - return models.XcodebuildVersionModel{ - Version: xcodebuildVersion, - BuildVersion: buildVersion, - MajorVersion: majorVersion, - }, nil -} - -func filterXcodeWarnings(cmdOutputLines []string) ([]string, error) { - firstLineIndex := -1 - for i, line := range cmdOutputLines { - if strings.HasPrefix(line, "Xcode ") { - firstLineIndex = i - break - } - } - - if firstLineIndex < 0 { - return []string{}, fmt.Errorf("couldn't find Xcode version in output: %s", cmdOutputLines) - } - - return cmdOutputLines[firstLineIndex:], nil -} diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/LICENSE b/vendor/github.com/bitrise-io/go-xcode/v2/LICENSE new file mode 100644 index 00000000..cdfcf1f7 --- /dev/null +++ b/vendor/github.com/bitrise-io/go-xcode/v2/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Bitrise + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/internals/zip/file.go b/vendor/github.com/bitrise-io/go-xcode/v2/internals/zip/file.go new file mode 100644 index 00000000..7cddbe2c --- /dev/null +++ b/vendor/github.com/bitrise-io/go-xcode/v2/internals/zip/file.go @@ -0,0 +1,30 @@ +package zip + +import ( + "archive/zip" + "io" +) + +// File ... +type File interface { + Name() string + Open() (io.ReadCloser, error) +} + +type defaultFile struct { + file *zip.File +} + +func newDefaultFile(file *zip.File) File { + return defaultFile{file: file} +} + +// Name ... +func (file defaultFile) Name() string { + return file.file.Name +} + +// Open ... +func (file defaultFile) Open() (io.ReadCloser, error) { + return file.file.Open() +} diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/internals/zip/reader.go b/vendor/github.com/bitrise-io/go-xcode/v2/internals/zip/reader.go new file mode 100644 index 00000000..6672197b --- /dev/null +++ b/vendor/github.com/bitrise-io/go-xcode/v2/internals/zip/reader.go @@ -0,0 +1,42 @@ +package zip + +import ( + "archive/zip" + "fmt" +) + +// ReadCloser ... +type ReadCloser interface { + Files() []File + Close() error +} + +type defaultReadCloser struct { + zipReader *zip.ReadCloser +} + +// NewDefaultReadCloser ... +func NewDefaultReadCloser(archivePath string) (ReadCloser, error) { + zipReader, err := zip.OpenReader(archivePath) + if err != nil { + return nil, fmt.Errorf("failed to open archive %s: %w", archivePath, err) + } + + return defaultReadCloser{ + zipReader: zipReader, + }, nil +} + +// Files ... +func (readCloser defaultReadCloser) Files() []File { + var files []File + for _, file := range readCloser.zipReader.File { + files = append(files, newDefaultFile(file)) + } + return files +} + +// Close ... +func (readCloser defaultReadCloser) Close() error { + return readCloser.zipReader.Close() +} diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/zip/ios_xcarchive_reader.go b/vendor/github.com/bitrise-io/go-xcode/v2/zip/ios_xcarchive_reader.go new file mode 100644 index 00000000..853ce71b --- /dev/null +++ b/vendor/github.com/bitrise-io/go-xcode/v2/zip/ios_xcarchive_reader.go @@ -0,0 +1,23 @@ +package zip + +import "github.com/bitrise-io/go-xcode/plistutil" + +// IOSXCArchiveReader ... +type IOSXCArchiveReader struct { + zipReader Reader +} + +// NewIOSXCArchiveReader ... +func NewIOSXCArchiveReader(reader Reader) IOSXCArchiveReader { + return IOSXCArchiveReader{zipReader: reader} +} + +// AppInfoPlist ... +func (reader IOSXCArchiveReader) AppInfoPlist() (plistutil.PlistData, error) { + b, err := reader.zipReader.ReadFile("*.xcarchive/Products/Applications/*.app/Info.plist") + if err != nil { + return nil, err + } + + return plistutil.NewPlistDataFromContent(string(b)) +} diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/zip/ipa_reader.go b/vendor/github.com/bitrise-io/go-xcode/v2/zip/ipa_reader.go new file mode 100644 index 00000000..6ba9a7a6 --- /dev/null +++ b/vendor/github.com/bitrise-io/go-xcode/v2/zip/ipa_reader.go @@ -0,0 +1,48 @@ +package zip + +import ( + "fmt" + + "github.com/bitrise-io/go-xcode/plistutil" + "github.com/bitrise-io/go-xcode/profileutil" +) + +// IPAReader ... +type IPAReader struct { + zipReader Reader +} + +// NewIPAReader ... +func NewIPAReader(zipReader Reader) IPAReader { + return IPAReader{zipReader: zipReader} +} + +// ProvisioningProfileInfo ... +func (reader IPAReader) ProvisioningProfileInfo() (*profileutil.ProvisioningProfileInfoModel, error) { + b, err := reader.zipReader.ReadFile("Payload/*.app/embedded.mobileprovision") + if err != nil { + return nil, err + } + + profilePKCS7, err := profileutil.ProvisioningProfileFromContent(b) + if err != nil { + return nil, fmt.Errorf("failed to parse embedded.mobilprovision: %w", err) + } + + provisioningProfileInfo, err := profileutil.NewProvisioningProfileInfo(*profilePKCS7) + if err != nil { + return nil, fmt.Errorf("failed to read profile info: %w", err) + } + + return &provisioningProfileInfo, nil +} + +// AppInfoPlist ... +func (reader IPAReader) AppInfoPlist() (plistutil.PlistData, error) { + b, err := reader.zipReader.ReadFile("Payload/*.app/Info.plist") + if err != nil { + return nil, err + } + + return plistutil.NewPlistDataFromContent(string(b)) +} diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/zip/xcarchive_reader.go b/vendor/github.com/bitrise-io/go-xcode/v2/zip/xcarchive_reader.go new file mode 100644 index 00000000..79f3a58d --- /dev/null +++ b/vendor/github.com/bitrise-io/go-xcode/v2/zip/xcarchive_reader.go @@ -0,0 +1,28 @@ +package zip + +import "github.com/bitrise-io/go-xcode/plistutil" + +// XCArchiveReader ... +type XCArchiveReader struct { + zipReader Reader +} + +// NewXCArchiveReader ... +func NewXCArchiveReader(reader Reader) XCArchiveReader { + return XCArchiveReader{zipReader: reader} +} + +// InfoPlist ... +func (reader XCArchiveReader) InfoPlist() (plistutil.PlistData, error) { + b, err := reader.zipReader.ReadFile("*.xcarchive/Info.plist") + if err != nil { + return nil, err + } + + return plistutil.NewPlistDataFromContent(string(b)) +} + +// IsMacOS ... +func (reader XCArchiveReader) IsMacOS() bool { + return reader.zipReader.IsFileOrDirExistsInZipArchive("*.xcarchive/Products/Applications/*.app/Contents/*") +} diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/zip/zip_reader.go b/vendor/github.com/bitrise-io/go-xcode/v2/zip/zip_reader.go new file mode 100644 index 00000000..b58aa1f6 --- /dev/null +++ b/vendor/github.com/bitrise-io/go-xcode/v2/zip/zip_reader.go @@ -0,0 +1,82 @@ +package zip + +import ( + "fmt" + "io" + "sort" + + "github.com/bitrise-io/go-utils/v2/log" + "github.com/bitrise-io/go-xcode/v2/internals/zip" + "github.com/ryanuber/go-glob" +) + +// Reader ... +type Reader struct { + zipReader zip.ReadCloser + logger log.Logger +} + +// NewReader ... +func NewReader(archivePath string, logger log.Logger) (*Reader, error) { + zipReader, err := zip.NewDefaultReadCloser(archivePath) + if err != nil { + return nil, fmt.Errorf("failed to open archive %s: %w", archivePath, err) + } + + return &Reader{ + zipReader: zipReader, + logger: logger, + }, nil +} + +// Close ... +func (reader Reader) Close() error { + return reader.zipReader.Close() +} + +// ReadFile ... +func (reader Reader) ReadFile(targetPathGlob string) ([]byte, error) { + var files []zip.File + for _, file := range reader.zipReader.Files() { + name := file.Name() + if glob.Glob(targetPathGlob, name) { + files = append(files, file) + } + } + + sort.Slice(files, func(i, j int) bool { + return len(files[i].Name()) < len(files[j].Name()) + }) + + if len(files) == 0 { + return nil, fmt.Errorf("no file found with pattern: %s", targetPathGlob) + } + + file := files[0] + r, err := file.Open() + if err != nil { + return nil, fmt.Errorf("failed to open archive file %s: %w", file.Name(), err) + } + defer func() { + if err := r.Close(); err != nil { + reader.logger.Warnf("failed to close archive file %s: %s", file.Name(), err) + } + }() + + b, err := io.ReadAll(r) + if err != nil { + return nil, fmt.Errorf("failed to read archive file %s: %w", file.Name(), err) + } + + return b, nil +} + +// IsFileOrDirExistsInZipArchive ... +func (reader Reader) IsFileOrDirExistsInZipArchive(targetPathGlob string) bool { + for _, file := range reader.zipReader.Files() { + if glob.Glob(targetPathGlob, file.Name()) { + return true + } + } + return false +} diff --git a/vendor/github.com/bitrise-io/go-xcode/xcarchive/entitlements.go b/vendor/github.com/bitrise-io/go-xcode/xcarchive/entitlements.go deleted file mode 100644 index 7908e5cc..00000000 --- a/vendor/github.com/bitrise-io/go-xcode/xcarchive/entitlements.go +++ /dev/null @@ -1,46 +0,0 @@ -package xcarchive - -import ( - "fmt" - "path/filepath" - - "github.com/bitrise-io/go-utils/command" - "github.com/bitrise-io/go-xcode/plistutil" -) - -func executableNameFromInfoPlist(infoPlist plistutil.PlistData) string { - if name, ok := infoPlist.GetString("CFBundleExecutable"); ok { - return name - } - return "" -} - -func getEntitlements(basePath, executableRelativePath string) (plistutil.PlistData, error) { - entitlements, err := entitlementsFromExecutable(basePath, executableRelativePath) - if err != nil { - return plistutil.PlistData{}, err - } - - if entitlements != nil { - return *entitlements, nil - } - - return plistutil.PlistData{}, nil -} - -func entitlementsFromExecutable(basePath, executableRelativePath string) (*plistutil.PlistData, error) { - fmt.Printf("Fetching entitlements from executable") - - cmd := command.New("codesign", "--display", "--entitlements", ":-", filepath.Join(basePath, executableRelativePath)) - entitlementsString, err := cmd.RunAndReturnTrimmedOutput() - if err != nil { - return nil, err - } - - plist, err := plistutil.NewPlistDataFromContent(entitlementsString) - if err != nil { - return nil, err - } - - return &plist, nil -} diff --git a/vendor/github.com/bitrise-io/go-xcode/xcarchive/ios.go b/vendor/github.com/bitrise-io/go-xcode/xcarchive/ios.go deleted file mode 100644 index e9787037..00000000 --- a/vendor/github.com/bitrise-io/go-xcode/xcarchive/ios.go +++ /dev/null @@ -1,384 +0,0 @@ -package xcarchive - -import ( - "errors" - "fmt" - "path/filepath" - - "github.com/bitrise-io/go-utils/pathutil" - "github.com/bitrise-io/go-xcode/plistutil" - "github.com/bitrise-io/go-xcode/profileutil" -) - -// IosBaseApplication ... -type IosBaseApplication struct { - Path string - InfoPlist plistutil.PlistData - Entitlements plistutil.PlistData - ProvisioningProfile profileutil.ProvisioningProfileInfoModel -} - -// BundleIdentifier ... -func (app IosBaseApplication) BundleIdentifier() string { - bundleID, _ := app.InfoPlist.GetString("CFBundleIdentifier") - return bundleID -} - -// NewIosBaseApplication ... -func NewIosBaseApplication(path string) (IosBaseApplication, error) { - infoPlist := plistutil.PlistData{} - { - infoPlistPath := filepath.Join(path, "Info.plist") - if exist, err := pathutil.IsPathExists(infoPlistPath); err != nil { - return IosBaseApplication{}, fmt.Errorf("failed to check if Info.plist exists at: %s, error: %s", infoPlistPath, err) - } else if !exist { - return IosBaseApplication{}, fmt.Errorf("Info.plist not exists at: %s", infoPlistPath) - } - plist, err := plistutil.NewPlistDataFromFile(infoPlistPath) - if err != nil { - return IosBaseApplication{}, err - } - infoPlist = plist - } - - provisioningProfile := profileutil.ProvisioningProfileInfoModel{} - { - provisioningProfilePath := filepath.Join(path, "embedded.mobileprovision") - if exist, err := pathutil.IsPathExists(provisioningProfilePath); err != nil { - return IosBaseApplication{}, fmt.Errorf("failed to check if profile exists at: %s, error: %s", provisioningProfilePath, err) - } else if !exist { - return IosBaseApplication{}, fmt.Errorf("profile not exists at: %s", provisioningProfilePath) - } - - profile, err := profileutil.NewProvisioningProfileInfoFromFile(provisioningProfilePath) - if err != nil { - return IosBaseApplication{}, err - } - provisioningProfile = profile - } - - executable := executableNameFromInfoPlist(infoPlist) - entitlements, err := getEntitlements(path, executable) - if err != nil { - return IosBaseApplication{}, err - } - - return IosBaseApplication{ - Path: path, - InfoPlist: infoPlist, - Entitlements: entitlements, - ProvisioningProfile: provisioningProfile, - }, nil -} - -// IosExtension ... -type IosExtension struct { - IosBaseApplication -} - -// NewIosExtension ... -func NewIosExtension(path string) (IosExtension, error) { - baseApp, err := NewIosBaseApplication(path) - if err != nil { - return IosExtension{}, err - } - - return IosExtension{ - baseApp, - }, nil -} - -// IosWatchApplication ... -type IosWatchApplication struct { - IosBaseApplication - Extensions []IosExtension -} - -// IosClipApplication ... -type IosClipApplication struct { - IosBaseApplication -} - -// NewIosWatchApplication ... -func NewIosWatchApplication(path string) (IosWatchApplication, error) { - baseApp, err := NewIosBaseApplication(path) - if err != nil { - return IosWatchApplication{}, err - } - - extensions := []IosExtension{} - pattern := filepath.Join(pathutil.EscapeGlobPath(path), "PlugIns/*.appex") - pths, err := filepath.Glob(pattern) - if err != nil { - return IosWatchApplication{}, fmt.Errorf("failed to search for watch application's extensions using pattern: %s, error: %s", pattern, err) - } - for _, pth := range pths { - extension, err := NewIosExtension(pth) - if err != nil { - return IosWatchApplication{}, err - } - - extensions = append(extensions, extension) - } - - return IosWatchApplication{ - IosBaseApplication: baseApp, - Extensions: extensions, - }, nil -} - -// NewIosClipApplication ... -func NewIosClipApplication(path string) (IosClipApplication, error) { - baseApp, err := NewIosBaseApplication(path) - if err != nil { - return IosClipApplication{}, err - } - - return IosClipApplication{ - IosBaseApplication: baseApp, - }, nil -} - -// IosApplication ... -type IosApplication struct { - IosBaseApplication - WatchApplication *IosWatchApplication - ClipApplication *IosClipApplication - Extensions []IosExtension -} - -// NewIosApplication ... -func NewIosApplication(path string) (IosApplication, error) { - baseApp, err := NewIosBaseApplication(path) - if err != nil { - return IosApplication{}, err - } - - var watchApp *IosWatchApplication - { - pattern := filepath.Join(pathutil.EscapeGlobPath(path), "Watch/*.app") - pths, err := filepath.Glob(pattern) - if err != nil { - return IosApplication{}, err - } - if len(pths) > 0 { - watchPath := pths[0] - app, err := NewIosWatchApplication(watchPath) - if err != nil { - return IosApplication{}, err - } - watchApp = &app - } - } - - var clipApp *IosClipApplication - { - pattern := filepath.Join(pathutil.EscapeGlobPath(path), "AppClips/*.app") - pths, err := filepath.Glob(pattern) - if err != nil { - return IosApplication{}, err - } - if len(pths) > 0 { - clipPath := pths[0] - app, err := NewIosClipApplication(clipPath) - if err != nil { - return IosApplication{}, err - } - clipApp = &app - } - } - - extensions := []IosExtension{} - { - pattern := filepath.Join(pathutil.EscapeGlobPath(path), "PlugIns/*.appex") - pths, err := filepath.Glob(pattern) - if err != nil { - return IosApplication{}, fmt.Errorf("failed to search for watch application's extensions using pattern: %s, error: %s", pattern, err) - } - for _, pth := range pths { - extension, err := NewIosExtension(pth) - if err != nil { - return IosApplication{}, err - } - - extensions = append(extensions, extension) - } - } - - return IosApplication{ - IosBaseApplication: baseApp, - WatchApplication: watchApp, - ClipApplication: clipApp, - Extensions: extensions, - }, nil -} - -// IosArchive ... -type IosArchive struct { - Path string - InfoPlist plistutil.PlistData - Application IosApplication -} - -// NewIosArchive ... -func NewIosArchive(path string) (IosArchive, error) { - infoPlist := plistutil.PlistData{} - { - infoPlistPath := filepath.Join(path, "Info.plist") - if exist, err := pathutil.IsPathExists(infoPlistPath); err != nil { - return IosArchive{}, fmt.Errorf("failed to check if Info.plist exists at: %s, error: %s", infoPlistPath, err) - } else if !exist { - return IosArchive{}, fmt.Errorf("Info.plist not exists at: %s", infoPlistPath) - } - plist, err := plistutil.NewPlistDataFromFile(infoPlistPath) - if err != nil { - return IosArchive{}, err - } - infoPlist = plist - } - - application := IosApplication{} - { - appPath := "" - if appRelativePathToProducts, found := applicationFromPlist(infoPlist); found { - appPath = filepath.Join(path, "Products", appRelativePathToProducts) - } else { - var err error - if appPath, err = applicationFromArchive(path); err != nil { - return IosArchive{}, err - } - } - if exist, err := pathutil.IsPathExists(appPath); err != nil { - return IosArchive{}, fmt.Errorf("failed to check if app exists, path: %s, error: %s", appPath, err) - } else if !exist { - return IosArchive{}, fmt.Errorf("application not found on path: %s, error: %s", appPath, err) - } - - app, err := NewIosApplication(appPath) - if err != nil { - return IosArchive{}, err - } - application = app - } - - return IosArchive{ - Path: path, - InfoPlist: infoPlist, - Application: application, - }, nil -} - -func applicationFromPlist(InfoPlist plistutil.PlistData) (string, bool) { - if properties, found := InfoPlist.GetMapStringInterface("ApplicationProperties"); found { - return properties.GetString("ApplicationPath") - } - return "", false -} - -func applicationFromArchive(path string) (string, error) { - pattern := filepath.Join(pathutil.EscapeGlobPath(path), "Products/Applications/*.app") - pths, err := filepath.Glob(pattern) - if err != nil { - return "", err - } - if len(pths) == 0 { - return "", fmt.Errorf("failed to find main app, using pattern: %s", pattern) - } - return pths[0], nil -} - -// IsXcodeManaged ... -func (archive IosArchive) IsXcodeManaged() bool { - return archive.Application.ProvisioningProfile.IsXcodeManaged() -} - -// SigningIdentity ... -func (archive IosArchive) SigningIdentity() string { - if properties, found := archive.InfoPlist.GetMapStringInterface("ApplicationProperties"); found { - identity, _ := properties.GetString("SigningIdentity") - return identity - } - return "" -} - -// BundleIDEntitlementsMap ... -func (archive IosArchive) BundleIDEntitlementsMap() map[string]plistutil.PlistData { - bundleIDEntitlementsMap := map[string]plistutil.PlistData{} - - bundleID := archive.Application.BundleIdentifier() - bundleIDEntitlementsMap[bundleID] = archive.Application.Entitlements - - for _, plugin := range archive.Application.Extensions { - bundleID := plugin.BundleIdentifier() - bundleIDEntitlementsMap[bundleID] = plugin.Entitlements - } - - if archive.Application.WatchApplication != nil { - watchApplication := *archive.Application.WatchApplication - - bundleID := watchApplication.BundleIdentifier() - bundleIDEntitlementsMap[bundleID] = watchApplication.Entitlements - - for _, plugin := range watchApplication.Extensions { - bundleID := plugin.BundleIdentifier() - bundleIDEntitlementsMap[bundleID] = plugin.Entitlements - } - } - - if archive.Application.ClipApplication != nil { - clipApplication := *archive.Application.ClipApplication - - bundleID := clipApplication.BundleIdentifier() - bundleIDEntitlementsMap[bundleID] = clipApplication.Entitlements - } - - return bundleIDEntitlementsMap -} - -// BundleIDProfileInfoMap ... -func (archive IosArchive) BundleIDProfileInfoMap() map[string]profileutil.ProvisioningProfileInfoModel { - bundleIDProfileMap := map[string]profileutil.ProvisioningProfileInfoModel{} - - bundleID := archive.Application.BundleIdentifier() - bundleIDProfileMap[bundleID] = archive.Application.ProvisioningProfile - - for _, plugin := range archive.Application.Extensions { - bundleID := plugin.BundleIdentifier() - bundleIDProfileMap[bundleID] = plugin.ProvisioningProfile - } - - if archive.Application.WatchApplication != nil { - watchApplication := *archive.Application.WatchApplication - - bundleID := watchApplication.BundleIdentifier() - bundleIDProfileMap[bundleID] = watchApplication.ProvisioningProfile - - for _, plugin := range watchApplication.Extensions { - bundleID := plugin.BundleIdentifier() - bundleIDProfileMap[bundleID] = plugin.ProvisioningProfile - } - } - - if archive.Application.ClipApplication != nil { - clipApplication := *archive.Application.ClipApplication - - bundleID := clipApplication.BundleIdentifier() - bundleIDProfileMap[bundleID] = clipApplication.ProvisioningProfile - } - - return bundleIDProfileMap -} - -// FindDSYMs ... -func (archive IosArchive) FindDSYMs() ([]string, []string, error) { - return findDSYMs(archive.Path) -} - -// TeamID ... -func (archive IosArchive) TeamID() (string, error) { - bundleIDProfileInfoMap := archive.BundleIDProfileInfoMap() - for _, profileInfo := range bundleIDProfileInfoMap { - return profileInfo.TeamID, nil - } - return "", errors.New("team id not found") -} diff --git a/vendor/github.com/bitrise-io/go-xcode/xcarchive/macos.go b/vendor/github.com/bitrise-io/go-xcode/xcarchive/macos.go deleted file mode 100644 index 27e81e58..00000000 --- a/vendor/github.com/bitrise-io/go-xcode/xcarchive/macos.go +++ /dev/null @@ -1,231 +0,0 @@ -package xcarchive - -import ( - "fmt" - "path/filepath" - - "github.com/bitrise-io/go-xcode/plistutil" - "github.com/bitrise-io/go-xcode/profileutil" - - "github.com/bitrise-io/go-utils/pathutil" -) - -type macosBaseApplication struct { - Path string - InfoPlist plistutil.PlistData - Entitlements plistutil.PlistData - ProvisioningProfile *profileutil.ProvisioningProfileInfoModel -} - -// BundleIdentifier ... -func (app macosBaseApplication) BundleIdentifier() string { - bundleID, _ := app.InfoPlist.GetString("CFBundleIdentifier") - return bundleID -} - -func newMacosBaseApplication(path string) (macosBaseApplication, error) { - infoPlist := plistutil.PlistData{} - { - infoPlistPath := filepath.Join(path, "Contents/Info.plist") - if exist, err := pathutil.IsPathExists(infoPlistPath); err != nil { - return macosBaseApplication{}, fmt.Errorf("failed to check if Info.plist exists at: %s, error: %s", infoPlistPath, err) - } else if !exist { - return macosBaseApplication{}, fmt.Errorf("Info.plist not exists at: %s", infoPlistPath) - } - plist, err := plistutil.NewPlistDataFromFile(infoPlistPath) - if err != nil { - return macosBaseApplication{}, err - } - infoPlist = plist - } - - var provisioningProfile *profileutil.ProvisioningProfileInfoModel - { - provisioningProfilePath := filepath.Join(path, "Contents/embedded.provisionprofile") - if exist, err := pathutil.IsPathExists(provisioningProfilePath); err != nil { - return macosBaseApplication{}, fmt.Errorf("failed to check if profile exists at: %s, error: %s", provisioningProfilePath, err) - } else if exist { - profile, err := profileutil.NewProvisioningProfileInfoFromFile(provisioningProfilePath) - if err != nil { - return macosBaseApplication{}, err - } - provisioningProfile = &profile - } - } - - executable := filepath.Join("/Contents/MacOS/", executableNameFromInfoPlist(infoPlist)) - entitlements, err := getEntitlements(path, executable) - if err != nil { - return macosBaseApplication{}, err - } - - return macosBaseApplication{ - Path: path, - InfoPlist: infoPlist, - Entitlements: entitlements, - ProvisioningProfile: provisioningProfile, - }, nil -} - -// MacosExtension ... -type MacosExtension struct { - macosBaseApplication -} - -// NewMacosExtension ... -func NewMacosExtension(path string) (MacosExtension, error) { - baseApp, err := newMacosBaseApplication(path) - if err != nil { - return MacosExtension{}, err - } - - return MacosExtension{ - baseApp, - }, nil -} - -// MacosApplication ... -type MacosApplication struct { - macosBaseApplication - Extensions []MacosExtension -} - -// NewMacosApplication ... -func NewMacosApplication(path string) (MacosApplication, error) { - baseApp, err := newMacosBaseApplication(path) - if err != nil { - return MacosApplication{}, err - } - - extensions := []MacosExtension{} - { - pattern := filepath.Join(pathutil.EscapeGlobPath(path), "Contents/PlugIns/*.appex") - pths, err := filepath.Glob(pattern) - if err != nil { - return MacosApplication{}, fmt.Errorf("failed to search for watch application's extensions using pattern: %s, error: %s", pattern, err) - } - for _, pth := range pths { - extension, err := NewMacosExtension(pth) - if err != nil { - return MacosApplication{}, err - } - - extensions = append(extensions, extension) - } - } - - return MacosApplication{ - macosBaseApplication: baseApp, - Extensions: extensions, - }, nil -} - -// MacosArchive ... -type MacosArchive struct { - Path string - InfoPlist plistutil.PlistData - Application MacosApplication -} - -// NewMacosArchive ... -func NewMacosArchive(path string) (MacosArchive, error) { - infoPlist := plistutil.PlistData{} - { - infoPlistPath := filepath.Join(path, "Info.plist") - if exist, err := pathutil.IsPathExists(infoPlistPath); err != nil { - return MacosArchive{}, fmt.Errorf("failed to check if Info.plist exists at: %s, error: %s", infoPlistPath, err) - } else if !exist { - return MacosArchive{}, fmt.Errorf("Info.plist not exists at: %s", infoPlistPath) - } - plist, err := plistutil.NewPlistDataFromFile(infoPlistPath) - if err != nil { - return MacosArchive{}, err - } - infoPlist = plist - } - - application := MacosApplication{} - { - pattern := filepath.Join(pathutil.EscapeGlobPath(path), "Products/Applications/*.app") - pths, err := filepath.Glob(pattern) - if err != nil { - return MacosArchive{}, err - } - - appPath := "" - if len(pths) > 0 { - appPath = pths[0] - } else { - return MacosArchive{}, fmt.Errorf("failed to find main app, using pattern: %s", pattern) - } - - app, err := NewMacosApplication(appPath) - if err != nil { - return MacosArchive{}, err - } - application = app - } - - return MacosArchive{ - Path: path, - InfoPlist: infoPlist, - Application: application, - }, nil -} - -// IsXcodeManaged ... -func (archive MacosArchive) IsXcodeManaged() bool { - if archive.Application.ProvisioningProfile != nil { - return archive.Application.ProvisioningProfile.IsXcodeManaged() - } - return false -} - -// SigningIdentity ... -func (archive MacosArchive) SigningIdentity() string { - properties, found := archive.InfoPlist.GetMapStringInterface("ApplicationProperties") - if found { - identity, _ := properties.GetString("SigningIdentity") - return identity - } - return "" -} - -// BundleIDEntitlementsMap ... -func (archive MacosArchive) BundleIDEntitlementsMap() map[string]plistutil.PlistData { - bundleIDEntitlementsMap := map[string]plistutil.PlistData{} - - bundleID := archive.Application.BundleIdentifier() - bundleIDEntitlementsMap[bundleID] = archive.Application.Entitlements - - for _, plugin := range archive.Application.Extensions { - bundleID := plugin.BundleIdentifier() - bundleIDEntitlementsMap[bundleID] = plugin.Entitlements - } - - return bundleIDEntitlementsMap -} - -// BundleIDProfileInfoMap ... -func (archive MacosArchive) BundleIDProfileInfoMap() map[string]profileutil.ProvisioningProfileInfoModel { - bundleIDProfileMap := map[string]profileutil.ProvisioningProfileInfoModel{} - - if archive.Application.ProvisioningProfile != nil { - bundleID := archive.Application.BundleIdentifier() - bundleIDProfileMap[bundleID] = *archive.Application.ProvisioningProfile - } - - for _, plugin := range archive.Application.Extensions { - if plugin.ProvisioningProfile != nil { - bundleID := plugin.BundleIdentifier() - bundleIDProfileMap[bundleID] = *plugin.ProvisioningProfile - } - } - - return bundleIDProfileMap -} - -// FindDSYMs ... -func (archive MacosArchive) FindDSYMs() ([]string, []string, error) { - return findDSYMs(archive.Path) -} diff --git a/vendor/github.com/bitrise-io/go-xcode/xcarchive/xcarchive.go b/vendor/github.com/bitrise-io/go-xcode/xcarchive/xcarchive.go deleted file mode 100644 index 9565ceef..00000000 --- a/vendor/github.com/bitrise-io/go-xcode/xcarchive/xcarchive.go +++ /dev/null @@ -1,88 +0,0 @@ -package xcarchive - -import ( - "path/filepath" - "strings" - - "github.com/bitrise-io/go-utils/log" - "github.com/bitrise-io/go-utils/pathutil" - "github.com/bitrise-io/go-utils/ziputil" - "github.com/bitrise-io/go-xcode/plistutil" - "github.com/bitrise-io/go-xcode/utility" -) - -// IsMacOS try to find the Contents dir under the .app/. -// If its finds it the archive is MacOs. If it does not the archive is iOS. -func IsMacOS(archPath string) (bool, error) { - log.Debugf("Checking archive is MacOS or iOS") - infoPlistPath := filepath.Join(archPath, "Info.plist") - - plist, err := plistutil.NewPlistDataFromFile(infoPlistPath) - if err != nil { - return false, err - } - - appProperties, found := plist.GetMapStringInterface("ApplicationProperties") - if !found { - return false, err - } - - applicationPath, found := appProperties.GetString("ApplicationPath") - if !found { - return false, err - } - - applicationPath = filepath.Join(archPath, "Products", applicationPath) - contentsPath := filepath.Join(applicationPath, "Contents") - - exist, err := pathutil.IsDirExists(contentsPath) - if err != nil { - return false, err - } - - return exist, nil -} - -// UnzipXcarchive ... -func UnzipXcarchive(xcarchivePth string) (string, error) { - tmpDir, err := pathutil.NormalizedOSTempDirPath("__xcarhive__") - if err != nil { - return "", err - } - - return tmpDir, ziputil.UnZip(xcarchivePth, tmpDir) -} - -// GetEmbeddedMobileProvisionPath ... -func GetEmbeddedMobileProvisionPath(xcarchivePth string) (string, error) { - return utility.FindFileInAppDir(getAppSubfolder(xcarchivePth), "embedded.mobileprovision") -} - -// GetEmbeddedInfoPlistPath ... -func GetEmbeddedInfoPlistPath(xcarchivePth string) (string, error) { - return utility.FindFileInAppDir(getAppSubfolder(xcarchivePth), "Info.plist") -} - -func getAppSubfolder(basepth string) string { - return filepath.Join(basepth, "Products", "Applications") -} - -func findDSYMs(archivePath string) ([]string, []string, error) { - dsymsDirPth := filepath.Join(archivePath, "dSYMs") - dsyms, err := pathutil.ListEntries(dsymsDirPth, pathutil.ExtensionFilter(".dsym", true)) - if err != nil { - return []string{}, []string{}, err - } - - appDSYMs := []string{} - frameworkDSYMs := []string{} - for _, dsym := range dsyms { - if strings.HasSuffix(dsym, ".app.dSYM") { - appDSYMs = append(appDSYMs, dsym) - } else { - frameworkDSYMs = append(frameworkDSYMs, dsym) - } - } - - return appDSYMs, frameworkDSYMs, nil -} diff --git a/vendor/github.com/hashicorp/go-retryablehttp/CHANGELOG.md b/vendor/github.com/hashicorp/go-retryablehttp/CHANGELOG.md new file mode 100644 index 00000000..33686e4d --- /dev/null +++ b/vendor/github.com/hashicorp/go-retryablehttp/CHANGELOG.md @@ -0,0 +1,9 @@ +## 0.7.4 (Jun 6, 2023) + +BUG FIXES + +- client: fixing an issue where the Content-Type header wouldn't be sent with an empty payload when using HTTP/2 [GH-194] + +## 0.7.3 (May 15, 2023) + +Initial release diff --git a/vendor/github.com/hashicorp/go-retryablehttp/CODEOWNERS b/vendor/github.com/hashicorp/go-retryablehttp/CODEOWNERS new file mode 100644 index 00000000..f8389c99 --- /dev/null +++ b/vendor/github.com/hashicorp/go-retryablehttp/CODEOWNERS @@ -0,0 +1 @@ +* @hashicorp/release-engineering \ No newline at end of file diff --git a/vendor/github.com/hashicorp/go-retryablehttp/LICENSE b/vendor/github.com/hashicorp/go-retryablehttp/LICENSE index e87a115e..f4f97ee5 100644 --- a/vendor/github.com/hashicorp/go-retryablehttp/LICENSE +++ b/vendor/github.com/hashicorp/go-retryablehttp/LICENSE @@ -1,3 +1,5 @@ +Copyright (c) 2015 HashiCorp, Inc. + Mozilla Public License, version 2.0 1. Definitions diff --git a/vendor/github.com/hashicorp/go-retryablehttp/README.md b/vendor/github.com/hashicorp/go-retryablehttp/README.md index 09f5eaf2..8943becf 100644 --- a/vendor/github.com/hashicorp/go-retryablehttp/README.md +++ b/vendor/github.com/hashicorp/go-retryablehttp/README.md @@ -45,25 +45,6 @@ The returned response object is an `*http.Response`, the same thing you would usually get from `net/http`. Had the request failed one or more times, the above call would block and retry with exponential backoff. -## Retrying cases that fail after a seeming success - -It's possible for a request to succeed in the sense that the expected response headers are received, but then to encounter network-level errors while reading the response body. In go-retryablehttp's most basic usage, this error would not be retryable, due to the out-of-band handling of the response body. In some cases it may be desirable to handle the response body as part of the retryable operation. - -A toy example (which will retry the full request and succeed on the second attempt) is shown below: - -```go -c := retryablehttp.NewClient() -r := retryablehttp.NewRequest("GET", "://foo", nil) -handlerShouldRetry := true -r.SetResponseHandler(func(*http.Response) error { - if !handlerShouldRetry { - return nil - } - handlerShouldRetry = false - return errors.New("retryable error") -}) -``` - ## Getting a stdlib `*http.Client` with retries It's possible to convert a `*retryablehttp.Client` directly to a `*http.Client`. diff --git a/vendor/github.com/hashicorp/go-retryablehttp/client.go b/vendor/github.com/hashicorp/go-retryablehttp/client.go index 57116e96..cad96bd9 100644 --- a/vendor/github.com/hashicorp/go-retryablehttp/client.go +++ b/vendor/github.com/hashicorp/go-retryablehttp/client.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + // Package retryablehttp provides a familiar HTTP client interface with // automatic retries and exponential backoff. It is a thin wrapper over the // standard net/http client library and exposes nearly the same public API. @@ -80,8 +83,15 @@ var ( type ReaderFunc func() (io.Reader, error) // ResponseHandlerFunc is a type of function that takes in a Response, and does something with it. -// It only runs if the initial part of the request was successful. -// If an error is returned, the client's retry policy will be used to determine whether to retry the whole request. +// The ResponseHandlerFunc is called when the HTTP client successfully receives a response and the +// CheckRetry function indicates that a retry of the base request is not necessary. +// If an error is returned from this function, the CheckRetry policy will be used to determine +// whether to retry the whole request (including this handler). +// +// Make sure to check status codes! Even if the request was completed it may have a non-2xx status code. +// +// The response body is not automatically closed. It must be closed either by the ResponseHandlerFunc or +// by the caller out-of-band. Failure to do so will result in a memory leak. type ResponseHandlerFunc func(*http.Response) error // LenReader is an interface implemented by many in-memory io.Reader's. Used @@ -250,10 +260,17 @@ func getBodyReaderAndContentLength(rawBody interface{}) (ReaderFunc, int64, erro if err != nil { return nil, 0, err } - bodyReader = func() (io.Reader, error) { - return bytes.NewReader(buf), nil + if len(buf) == 0 { + bodyReader = func() (io.Reader, error) { + return http.NoBody, nil + } + contentLength = 0 + } else { + bodyReader = func() (io.Reader, error) { + return bytes.NewReader(buf), nil + } + contentLength = int64(len(buf)) } - contentLength = int64(len(buf)) // No body provided, nothing to do case nil: diff --git a/vendor/github.com/hashicorp/go-retryablehttp/roundtripper.go b/vendor/github.com/hashicorp/go-retryablehttp/roundtripper.go index 8f3ee358..8c407adb 100644 --- a/vendor/github.com/hashicorp/go-retryablehttp/roundtripper.go +++ b/vendor/github.com/hashicorp/go-retryablehttp/roundtripper.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package retryablehttp import ( diff --git a/vendor/github.com/stretchr/objx/README.md b/vendor/github.com/stretchr/objx/README.md index 246660b2..736e1eb5 100644 --- a/vendor/github.com/stretchr/objx/README.md +++ b/vendor/github.com/stretchr/objx/README.md @@ -4,20 +4,20 @@ [![Maintainability](https://api.codeclimate.com/v1/badges/1d64bc6c8474c2074f2b/maintainability)](https://codeclimate.com/github/stretchr/objx/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/1d64bc6c8474c2074f2b/test_coverage)](https://codeclimate.com/github/stretchr/objx/test_coverage) [![Sourcegraph](https://sourcegraph.com/github.com/stretchr/objx/-/badge.svg)](https://sourcegraph.com/github.com/stretchr/objx) -[![GoDoc](https://godoc.org/github.com/stretchr/objx?status.svg)](https://godoc.org/github.com/stretchr/objx) +[![GoDoc](https://pkg.go.dev/badge/github.com/stretchr/objx?utm_source=godoc)](https://pkg.go.dev/github.com/stretchr/objx) Objx - Go package for dealing with maps, slices, JSON and other data. Get started: - Install Objx with [one line of code](#installation), or [update it with another](#staying-up-to-date) -- Check out the API Documentation http://godoc.org/github.com/stretchr/objx +- Check out the API Documentation http://pkg.go.dev/github.com/stretchr/objx ## Overview Objx provides the `objx.Map` type, which is a `map[string]interface{}` that exposes a powerful `Get` method (among others) that allows you to easily and quickly get access to data within the map, without having to worry too much about type assertions, missing data, default values etc. ### Pattern -Objx uses a preditable pattern to make access data from within `map[string]interface{}` easy. Call one of the `objx.` functions to create your `objx.Map` to get going: +Objx uses a predictable pattern to make access data from within `map[string]interface{}` easy. Call one of the `objx.` functions to create your `objx.Map` to get going: m, err := objx.FromJSON(json) @@ -74,7 +74,7 @@ To update Objx to the latest version, run: go get -u github.com/stretchr/objx ### Supported go versions -We support the lastest three major Go versions, which are 1.10, 1.11 and 1.12 at the moment. +We currently support the most recent major Go versions from 1.13 onward. ## Contributing Please feel free to submit issues, fork the repository and send pull requests! diff --git a/vendor/github.com/stretchr/objx/Taskfile.yml b/vendor/github.com/stretchr/objx/Taskfile.yml index 7746f516..39f49d5a 100644 --- a/vendor/github.com/stretchr/objx/Taskfile.yml +++ b/vendor/github.com/stretchr/objx/Taskfile.yml @@ -1,8 +1,5 @@ version: '2' -env: - GOFLAGS: -mod=vendor - tasks: default: deps: [test] diff --git a/vendor/github.com/stretchr/objx/accessors.go b/vendor/github.com/stretchr/objx/accessors.go index 4c604558..72f1d1c1 100644 --- a/vendor/github.com/stretchr/objx/accessors.go +++ b/vendor/github.com/stretchr/objx/accessors.go @@ -14,17 +14,17 @@ const ( // For example, `location.address.city` PathSeparator string = "." - // arrayAccesRegexString is the regex used to extract the array number + // arrayAccessRegexString is the regex used to extract the array number // from the access path - arrayAccesRegexString = `^(.+)\[([0-9]+)\]$` + arrayAccessRegexString = `^(.+)\[([0-9]+)\]$` // mapAccessRegexString is the regex used to extract the map key // from the access path mapAccessRegexString = `^([^\[]*)\[([^\]]+)\](.*)$` ) -// arrayAccesRegex is the compiled arrayAccesRegexString -var arrayAccesRegex = regexp.MustCompile(arrayAccesRegexString) +// arrayAccessRegex is the compiled arrayAccessRegexString +var arrayAccessRegex = regexp.MustCompile(arrayAccessRegexString) // mapAccessRegex is the compiled mapAccessRegexString var mapAccessRegex = regexp.MustCompile(mapAccessRegexString) @@ -37,11 +37,11 @@ var mapAccessRegex = regexp.MustCompile(mapAccessRegexString) // // Get can only operate directly on map[string]interface{} and []interface. // -// Example +// # Example // // To access the title of the third chapter of the second book, do: // -// o.Get("books[1].chapters[2].title") +// o.Get("books[1].chapters[2].title") func (m Map) Get(selector string) *Value { rawObj := access(m, selector, nil, false) return &Value{data: rawObj} @@ -52,26 +52,26 @@ func (m Map) Get(selector string) *Value { // // Set can only operate directly on map[string]interface{} and []interface // -// Example +// # Example // // To set the title of the third chapter of the second book, do: // -// o.Set("books[1].chapters[2].title","Time to Go") +// o.Set("books[1].chapters[2].title","Time to Go") func (m Map) Set(selector string, value interface{}) Map { access(m, selector, value, true) return m } -// getIndex returns the index, which is hold in s by two braches. -// It also returns s withour the index part, e.g. name[1] will return (1, name). +// getIndex returns the index, which is hold in s by two branches. +// It also returns s without the index part, e.g. name[1] will return (1, name). // If no index is found, -1 is returned func getIndex(s string) (int, string) { - arrayMatches := arrayAccesRegex.FindStringSubmatch(s) + arrayMatches := arrayAccessRegex.FindStringSubmatch(s) if len(arrayMatches) > 0 { // Get the key into the map selector := arrayMatches[1] // Get the index into the array at the key - // We know this cannt fail because arrayMatches[2] is an int for sure + // We know this can't fail because arrayMatches[2] is an int for sure index, _ := strconv.Atoi(arrayMatches[2]) return index, selector } diff --git a/vendor/github.com/stretchr/objx/conversions.go b/vendor/github.com/stretchr/objx/conversions.go index 080aa46e..01c63d7d 100644 --- a/vendor/github.com/stretchr/objx/conversions.go +++ b/vendor/github.com/stretchr/objx/conversions.go @@ -15,7 +15,7 @@ import ( const SignatureSeparator = "_" // URLValuesSliceKeySuffix is the character that is used to -// specify a suffic for slices parsed by URLValues. +// specify a suffix for slices parsed by URLValues. // If the suffix is set to "[i]", then the index of the slice // is used in place of i // Ex: Suffix "[]" would have the form a[]=b&a[]=c @@ -30,7 +30,7 @@ const ( ) // SetURLValuesSliceKeySuffix sets the character that is used to -// specify a suffic for slices parsed by URLValues. +// specify a suffix for slices parsed by URLValues. // If the suffix is set to "[i]", then the index of the slice // is used in place of i // Ex: Suffix "[]" would have the form a[]=b&a[]=c diff --git a/vendor/github.com/stretchr/objx/doc.go b/vendor/github.com/stretchr/objx/doc.go index 6d6af1a8..b170af74 100644 --- a/vendor/github.com/stretchr/objx/doc.go +++ b/vendor/github.com/stretchr/objx/doc.go @@ -1,19 +1,19 @@ /* -Objx - Go package for dealing with maps, slices, JSON and other data. +Package objx provides utilities for dealing with maps, slices, JSON and other data. -Overview +# Overview Objx provides the `objx.Map` type, which is a `map[string]interface{}` that exposes a powerful `Get` method (among others) that allows you to easily and quickly get access to data within the map, without having to worry too much about type assertions, missing data, default values etc. -Pattern +# Pattern -Objx uses a preditable pattern to make access data from within `map[string]interface{}` easy. +Objx uses a predictable pattern to make access data from within `map[string]interface{}` easy. Call one of the `objx.` functions to create your `objx.Map` to get going: - m, err := objx.FromJSON(json) + m, err := objx.FromJSON(json) NOTE: Any methods or functions with the `Must` prefix will panic if something goes wrong, the rest will be optimistic and try to figure things out without panicking. @@ -21,46 +21,46 @@ the rest will be optimistic and try to figure things out without panicking. Use `Get` to access the value you're interested in. You can use dot and array notation too: - m.Get("places[0].latlng") + m.Get("places[0].latlng") Once you have sought the `Value` you're interested in, you can use the `Is*` methods to determine its type. - if m.Get("code").IsStr() { // Your code... } + if m.Get("code").IsStr() { // Your code... } Or you can just assume the type, and use one of the strong type methods to extract the real value: - m.Get("code").Int() + m.Get("code").Int() If there's no value there (or if it's the wrong type) then a default value will be returned, or you can be explicit about the default value. - Get("code").Int(-1) + Get("code").Int(-1) If you're dealing with a slice of data as a value, Objx provides many useful methods for iterating, manipulating and selecting that data. You can find out more by exploring the index below. -Reading data +# Reading data A simple example of how to use Objx: - // Use MustFromJSON to make an objx.Map from some JSON - m := objx.MustFromJSON(`{"name": "Mat", "age": 30}`) + // Use MustFromJSON to make an objx.Map from some JSON + m := objx.MustFromJSON(`{"name": "Mat", "age": 30}`) - // Get the details - name := m.Get("name").Str() - age := m.Get("age").Int() + // Get the details + name := m.Get("name").Str() + age := m.Get("age").Int() - // Get their nickname (or use their name if they don't have one) - nickname := m.Get("nickname").Str(name) + // Get their nickname (or use their name if they don't have one) + nickname := m.Get("nickname").Str(name) -Ranging +# Ranging Since `objx.Map` is a `map[string]interface{}` you can treat it as such. For example, to `range` the data, do what you would expect: - m := objx.MustFromJSON(json) - for key, value := range m { - // Your code... - } + m := objx.MustFromJSON(json) + for key, value := range m { + // Your code... + } */ package objx diff --git a/vendor/github.com/stretchr/objx/map.go b/vendor/github.com/stretchr/objx/map.go index a64712a0..ab9f9ae6 100644 --- a/vendor/github.com/stretchr/objx/map.go +++ b/vendor/github.com/stretchr/objx/map.go @@ -47,17 +47,16 @@ func New(data interface{}) Map { // // The arguments follow a key, value pattern. // -// // Returns nil if any key argument is non-string or if there are an odd number of arguments. // -// Example +// # Example // // To easily create Maps: // -// m := objx.MSI("name", "Mat", "age", 29, "subobj", objx.MSI("active", true)) +// m := objx.MSI("name", "Mat", "age", 29, "subobj", objx.MSI("active", true)) // -// // creates an Map equivalent to -// m := objx.Map{"name": "Mat", "age": 29, "subobj": objx.Map{"active": true}} +// // creates an Map equivalent to +// m := objx.Map{"name": "Mat", "age": 29, "subobj": objx.Map{"active": true}} func MSI(keyAndValuePairs ...interface{}) Map { newMap := Map{} keyAndValuePairsLen := len(keyAndValuePairs) diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh index 6202638b..fdcaa974 100644 --- a/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -248,6 +248,7 @@ struct ltchars { #include #include #include +#include #include #include #include @@ -283,10 +284,6 @@ struct ltchars { #include #endif -#ifndef MSG_FASTOPEN -#define MSG_FASTOPEN 0x20000000 -#endif - #ifndef PTRACE_GETREGS #define PTRACE_GETREGS 0xc #endif @@ -295,14 +292,6 @@ struct ltchars { #define PTRACE_SETREGS 0xd #endif -#ifndef SOL_NETLINK -#define SOL_NETLINK 270 -#endif - -#ifndef SOL_SMC -#define SOL_SMC 286 -#endif - #ifdef SOL_BLUETOOTH // SPARC includes this in /usr/include/sparc64-linux-gnu/bits/socket.h // but it is already in bluetooth_linux.go @@ -319,10 +308,23 @@ struct ltchars { #undef TIPC_WAIT_FOREVER #define TIPC_WAIT_FOREVER 0xffffffff -// Copied from linux/l2tp.h -// Including linux/l2tp.h here causes conflicts between linux/in.h -// and netinet/in.h included via net/route.h above. -#define IPPROTO_L2TP 115 +// Copied from linux/netfilter/nf_nat.h +// Including linux/netfilter/nf_nat.h here causes conflicts between linux/in.h +// and netinet/in.h. +#define NF_NAT_RANGE_MAP_IPS (1 << 0) +#define NF_NAT_RANGE_PROTO_SPECIFIED (1 << 1) +#define NF_NAT_RANGE_PROTO_RANDOM (1 << 2) +#define NF_NAT_RANGE_PERSISTENT (1 << 3) +#define NF_NAT_RANGE_PROTO_RANDOM_FULLY (1 << 4) +#define NF_NAT_RANGE_PROTO_OFFSET (1 << 5) +#define NF_NAT_RANGE_NETMAP (1 << 6) +#define NF_NAT_RANGE_PROTO_RANDOM_ALL \ + (NF_NAT_RANGE_PROTO_RANDOM | NF_NAT_RANGE_PROTO_RANDOM_FULLY) +#define NF_NAT_RANGE_MASK \ + (NF_NAT_RANGE_MAP_IPS | NF_NAT_RANGE_PROTO_SPECIFIED | \ + NF_NAT_RANGE_PROTO_RANDOM | NF_NAT_RANGE_PERSISTENT | \ + NF_NAT_RANGE_PROTO_RANDOM_FULLY | NF_NAT_RANGE_PROTO_OFFSET | \ + NF_NAT_RANGE_NETMAP) // Copied from linux/hid.h. // Keep in sync with the size of the referenced fields. @@ -582,7 +584,7 @@ ccflags="$@" $2 ~ /^KEY_(SPEC|REQKEY_DEFL)_/ || $2 ~ /^KEYCTL_/ || $2 ~ /^PERF_/ || - $2 ~ /^SECCOMP_MODE_/ || + $2 ~ /^SECCOMP_/ || $2 ~ /^SEEK_/ || $2 ~ /^SCHED_/ || $2 ~ /^SPLICE_/ || @@ -603,6 +605,9 @@ ccflags="$@" $2 ~ /^FSOPT_/ || $2 ~ /^WDIO[CFS]_/ || $2 ~ /^NFN/ || + $2 !~ /^NFT_META_IIFTYPE/ && + $2 ~ /^NFT_/ || + $2 ~ /^NF_NAT_/ || $2 ~ /^XDP_/ || $2 ~ /^RWF_/ || $2 ~ /^(HDIO|WIN|SMART)_/ || diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go index c73cfe2f..36bf8399 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -1785,6 +1785,8 @@ const ( LANDLOCK_ACCESS_FS_REMOVE_FILE = 0x20 LANDLOCK_ACCESS_FS_TRUNCATE = 0x4000 LANDLOCK_ACCESS_FS_WRITE_FILE = 0x2 + LANDLOCK_ACCESS_NET_BIND_TCP = 0x1 + LANDLOCK_ACCESS_NET_CONNECT_TCP = 0x2 LANDLOCK_CREATE_RULESET_VERSION = 0x1 LINUX_REBOOT_CMD_CAD_OFF = 0x0 LINUX_REBOOT_CMD_CAD_ON = 0x89abcdef @@ -2127,6 +2129,60 @@ const ( NFNL_SUBSYS_QUEUE = 0x3 NFNL_SUBSYS_ULOG = 0x4 NFS_SUPER_MAGIC = 0x6969 + NFT_CHAIN_FLAGS = 0x7 + NFT_CHAIN_MAXNAMELEN = 0x100 + NFT_CT_MAX = 0x17 + NFT_DATA_RESERVED_MASK = 0xffffff00 + NFT_DATA_VALUE_MAXLEN = 0x40 + NFT_EXTHDR_OP_MAX = 0x4 + NFT_FIB_RESULT_MAX = 0x3 + NFT_INNER_MASK = 0xf + NFT_LOGLEVEL_MAX = 0x8 + NFT_NAME_MAXLEN = 0x100 + NFT_NG_MAX = 0x1 + NFT_OBJECT_CONNLIMIT = 0x5 + NFT_OBJECT_COUNTER = 0x1 + NFT_OBJECT_CT_EXPECT = 0x9 + NFT_OBJECT_CT_HELPER = 0x3 + NFT_OBJECT_CT_TIMEOUT = 0x7 + NFT_OBJECT_LIMIT = 0x4 + NFT_OBJECT_MAX = 0xa + NFT_OBJECT_QUOTA = 0x2 + NFT_OBJECT_SECMARK = 0x8 + NFT_OBJECT_SYNPROXY = 0xa + NFT_OBJECT_TUNNEL = 0x6 + NFT_OBJECT_UNSPEC = 0x0 + NFT_OBJ_MAXNAMELEN = 0x100 + NFT_OSF_MAXGENRELEN = 0x10 + NFT_QUEUE_FLAG_BYPASS = 0x1 + NFT_QUEUE_FLAG_CPU_FANOUT = 0x2 + NFT_QUEUE_FLAG_MASK = 0x3 + NFT_REG32_COUNT = 0x10 + NFT_REG32_SIZE = 0x4 + NFT_REG_MAX = 0x4 + NFT_REG_SIZE = 0x10 + NFT_REJECT_ICMPX_MAX = 0x3 + NFT_RT_MAX = 0x4 + NFT_SECMARK_CTX_MAXLEN = 0x100 + NFT_SET_MAXNAMELEN = 0x100 + NFT_SOCKET_MAX = 0x3 + NFT_TABLE_F_MASK = 0x3 + NFT_TABLE_MAXNAMELEN = 0x100 + NFT_TRACETYPE_MAX = 0x3 + NFT_TUNNEL_F_MASK = 0x7 + NFT_TUNNEL_MAX = 0x1 + NFT_TUNNEL_MODE_MAX = 0x2 + NFT_USERDATA_MAXLEN = 0x100 + NFT_XFRM_KEY_MAX = 0x6 + NF_NAT_RANGE_MAP_IPS = 0x1 + NF_NAT_RANGE_MASK = 0x7f + NF_NAT_RANGE_NETMAP = 0x40 + NF_NAT_RANGE_PERSISTENT = 0x8 + NF_NAT_RANGE_PROTO_OFFSET = 0x20 + NF_NAT_RANGE_PROTO_RANDOM = 0x4 + NF_NAT_RANGE_PROTO_RANDOM_ALL = 0x14 + NF_NAT_RANGE_PROTO_RANDOM_FULLY = 0x10 + NF_NAT_RANGE_PROTO_SPECIFIED = 0x2 NILFS_SUPER_MAGIC = 0x3434 NL0 = 0x0 NL1 = 0x100 @@ -2411,6 +2467,7 @@ const ( PR_MCE_KILL_GET = 0x22 PR_MCE_KILL_LATE = 0x0 PR_MCE_KILL_SET = 0x1 + PR_MDWE_NO_INHERIT = 0x2 PR_MDWE_REFUSE_EXEC_GAIN = 0x1 PR_MPX_DISABLE_MANAGEMENT = 0x2c PR_MPX_ENABLE_MANAGEMENT = 0x2b @@ -2615,8 +2672,9 @@ const ( RTAX_FEATURES = 0xc RTAX_FEATURE_ALLFRAG = 0x8 RTAX_FEATURE_ECN = 0x1 - RTAX_FEATURE_MASK = 0xf + RTAX_FEATURE_MASK = 0x1f RTAX_FEATURE_SACK = 0x2 + RTAX_FEATURE_TCP_USEC_TS = 0x10 RTAX_FEATURE_TIMESTAMP = 0x4 RTAX_HOPLIMIT = 0xa RTAX_INITCWND = 0xb @@ -2859,9 +2917,38 @@ const ( SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x1d SC_LOG_FLUSH = 0x100000 + SECCOMP_ADDFD_FLAG_SEND = 0x2 + SECCOMP_ADDFD_FLAG_SETFD = 0x1 + SECCOMP_FILTER_FLAG_LOG = 0x2 + SECCOMP_FILTER_FLAG_NEW_LISTENER = 0x8 + SECCOMP_FILTER_FLAG_SPEC_ALLOW = 0x4 + SECCOMP_FILTER_FLAG_TSYNC = 0x1 + SECCOMP_FILTER_FLAG_TSYNC_ESRCH = 0x10 + SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV = 0x20 + SECCOMP_GET_ACTION_AVAIL = 0x2 + SECCOMP_GET_NOTIF_SIZES = 0x3 + SECCOMP_IOCTL_NOTIF_RECV = 0xc0502100 + SECCOMP_IOCTL_NOTIF_SEND = 0xc0182101 + SECCOMP_IOC_MAGIC = '!' SECCOMP_MODE_DISABLED = 0x0 SECCOMP_MODE_FILTER = 0x2 SECCOMP_MODE_STRICT = 0x1 + SECCOMP_RET_ACTION = 0x7fff0000 + SECCOMP_RET_ACTION_FULL = 0xffff0000 + SECCOMP_RET_ALLOW = 0x7fff0000 + SECCOMP_RET_DATA = 0xffff + SECCOMP_RET_ERRNO = 0x50000 + SECCOMP_RET_KILL = 0x0 + SECCOMP_RET_KILL_PROCESS = 0x80000000 + SECCOMP_RET_KILL_THREAD = 0x0 + SECCOMP_RET_LOG = 0x7ffc0000 + SECCOMP_RET_TRACE = 0x7ff00000 + SECCOMP_RET_TRAP = 0x30000 + SECCOMP_RET_USER_NOTIF = 0x7fc00000 + SECCOMP_SET_MODE_FILTER = 0x1 + SECCOMP_SET_MODE_STRICT = 0x0 + SECCOMP_USER_NOTIF_FD_SYNC_WAKE_UP = 0x1 + SECCOMP_USER_NOTIF_FLAG_CONTINUE = 0x1 SECRETMEM_MAGIC = 0x5345434d SECURITYFS_MAGIC = 0x73636673 SEEK_CUR = 0x1 @@ -3021,6 +3108,7 @@ const ( SOL_TIPC = 0x10f SOL_TLS = 0x11a SOL_UDP = 0x11 + SOL_VSOCK = 0x11f SOL_X25 = 0x106 SOL_XDP = 0x11b SOMAXCONN = 0x1000 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go index 4920821c..42ff8c3c 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go @@ -281,6 +281,9 @@ const ( SCM_TIMESTAMPNS = 0x23 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SECCOMP_IOCTL_NOTIF_ADDFD = 0x40182103 + SECCOMP_IOCTL_NOTIF_ID_VALID = 0x40082102 + SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x40082104 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x800 SIOCATMARK = 0x8905 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go index a0c1e411..dca43600 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go @@ -282,6 +282,9 @@ const ( SCM_TIMESTAMPNS = 0x23 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SECCOMP_IOCTL_NOTIF_ADDFD = 0x40182103 + SECCOMP_IOCTL_NOTIF_ID_VALID = 0x40082102 + SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x40082104 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x800 SIOCATMARK = 0x8905 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go index c6398556..5cca668a 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go @@ -288,6 +288,9 @@ const ( SCM_TIMESTAMPNS = 0x23 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SECCOMP_IOCTL_NOTIF_ADDFD = 0x40182103 + SECCOMP_IOCTL_NOTIF_ID_VALID = 0x40082102 + SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x40082104 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x800 SIOCATMARK = 0x8905 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go index 47cc62e2..d8cae6d1 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go @@ -278,6 +278,9 @@ const ( SCM_TIMESTAMPNS = 0x23 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SECCOMP_IOCTL_NOTIF_ADDFD = 0x40182103 + SECCOMP_IOCTL_NOTIF_ID_VALID = 0x40082102 + SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x40082104 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x800 SIOCATMARK = 0x8905 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go index 27ac4a09..28e39afd 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go @@ -275,6 +275,9 @@ const ( SCM_TIMESTAMPNS = 0x23 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SECCOMP_IOCTL_NOTIF_ADDFD = 0x40182103 + SECCOMP_IOCTL_NOTIF_ID_VALID = 0x40082102 + SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x40082104 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x800 SIOCATMARK = 0x8905 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go index 54694642..cd66e92c 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go @@ -281,6 +281,9 @@ const ( SCM_TIMESTAMPNS = 0x23 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SECCOMP_IOCTL_NOTIF_ADDFD = 0x80182103 + SECCOMP_IOCTL_NOTIF_ID_VALID = 0x80082102 + SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x80082104 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x80 SIOCATMARK = 0x40047307 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go index 3adb81d7..c1595eba 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go @@ -281,6 +281,9 @@ const ( SCM_TIMESTAMPNS = 0x23 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SECCOMP_IOCTL_NOTIF_ADDFD = 0x80182103 + SECCOMP_IOCTL_NOTIF_ID_VALID = 0x80082102 + SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x80082104 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x80 SIOCATMARK = 0x40047307 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go index 2dfe98f0..ee9456b0 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go @@ -281,6 +281,9 @@ const ( SCM_TIMESTAMPNS = 0x23 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SECCOMP_IOCTL_NOTIF_ADDFD = 0x80182103 + SECCOMP_IOCTL_NOTIF_ID_VALID = 0x80082102 + SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x80082104 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x80 SIOCATMARK = 0x40047307 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go index f5398f84..8cfca81e 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go @@ -281,6 +281,9 @@ const ( SCM_TIMESTAMPNS = 0x23 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SECCOMP_IOCTL_NOTIF_ADDFD = 0x80182103 + SECCOMP_IOCTL_NOTIF_ID_VALID = 0x80082102 + SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x80082104 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x80 SIOCATMARK = 0x40047307 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go index c54f152d..60b0deb3 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go @@ -336,6 +336,9 @@ const ( SCM_TIMESTAMPNS = 0x23 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SECCOMP_IOCTL_NOTIF_ADDFD = 0x80182103 + SECCOMP_IOCTL_NOTIF_ID_VALID = 0x80082102 + SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x80082104 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x800 SIOCATMARK = 0x8905 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go index 76057dc7..f90aa728 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go @@ -340,6 +340,9 @@ const ( SCM_TIMESTAMPNS = 0x23 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SECCOMP_IOCTL_NOTIF_ADDFD = 0x80182103 + SECCOMP_IOCTL_NOTIF_ID_VALID = 0x80082102 + SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x80082104 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x800 SIOCATMARK = 0x8905 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go index e0c3725e..ba9e0150 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go @@ -340,6 +340,9 @@ const ( SCM_TIMESTAMPNS = 0x23 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SECCOMP_IOCTL_NOTIF_ADDFD = 0x80182103 + SECCOMP_IOCTL_NOTIF_ID_VALID = 0x80082102 + SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x80082104 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x800 SIOCATMARK = 0x8905 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go index 18f2813e..07cdfd6e 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go @@ -272,6 +272,9 @@ const ( SCM_TIMESTAMPNS = 0x23 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SECCOMP_IOCTL_NOTIF_ADDFD = 0x40182103 + SECCOMP_IOCTL_NOTIF_ID_VALID = 0x40082102 + SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x40082104 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x800 SIOCATMARK = 0x8905 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go index 11619d4e..2f1dd214 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go @@ -344,6 +344,9 @@ const ( SCM_TIMESTAMPNS = 0x23 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SECCOMP_IOCTL_NOTIF_ADDFD = 0x40182103 + SECCOMP_IOCTL_NOTIF_ID_VALID = 0x40082102 + SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x40082104 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x800 SIOCATMARK = 0x8905 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go index 396d994d..f40519d9 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go @@ -335,6 +335,9 @@ const ( SCM_TIMESTAMPNS = 0x21 SCM_TXTIME = 0x3f SCM_WIFI_STATUS = 0x25 + SECCOMP_IOCTL_NOTIF_ADDFD = 0x80182103 + SECCOMP_IOCTL_NOTIF_ID_VALID = 0x80082102 + SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x80082104 SFD_CLOEXEC = 0x400000 SFD_NONBLOCK = 0x4000 SF_FP = 0x38 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go index a1d06159..9dc42410 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go @@ -2297,5 +2297,3 @@ func unveil(path *byte, flags *byte) (err error) { var libc_unveil_trampoline_addr uintptr //go:cgo_import_dynamic libc_unveil unveil "libc.so" - - diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go index 5b2a7409..0d3a0751 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go @@ -2297,5 +2297,3 @@ func unveil(path *byte, flags *byte) (err error) { var libc_unveil_trampoline_addr uintptr //go:cgo_import_dynamic libc_unveil unveil "libc.so" - - diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go index f6eda134..c39f7776 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go @@ -2297,5 +2297,3 @@ func unveil(path *byte, flags *byte) (err error) { var libc_unveil_trampoline_addr uintptr //go:cgo_import_dynamic libc_unveil unveil "libc.so" - - diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go index 55df20ae..57571d07 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go @@ -2297,5 +2297,3 @@ func unveil(path *byte, flags *byte) (err error) { var libc_unveil_trampoline_addr uintptr //go:cgo_import_dynamic libc_unveil unveil "libc.so" - - diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go index 8c1155cb..e62963e6 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go @@ -2297,5 +2297,3 @@ func unveil(path *byte, flags *byte) (err error) { var libc_unveil_trampoline_addr uintptr //go:cgo_import_dynamic libc_unveil unveil "libc.so" - - diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go index 7cc80c58..00831354 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go @@ -2297,5 +2297,3 @@ func unveil(path *byte, flags *byte) (err error) { var libc_unveil_trampoline_addr uintptr //go:cgo_import_dynamic libc_unveil unveil "libc.so" - - diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go index 0688737f..79029ed5 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go @@ -2297,5 +2297,3 @@ func unveil(path *byte, flags *byte) (err error) { var libc_unveil_trampoline_addr uintptr //go:cgo_import_dynamic libc_unveil unveil "libc.so" - - diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go index fcf3ecbd..0cc3ce49 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go @@ -448,4 +448,8 @@ const ( SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 SYS_FCHMODAT2 = 452 + SYS_MAP_SHADOW_STACK = 453 + SYS_FUTEX_WAKE = 454 + SYS_FUTEX_WAIT = 455 + SYS_FUTEX_REQUEUE = 456 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go index f56dc250..856d92d6 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go @@ -371,4 +371,7 @@ const ( SYS_CACHESTAT = 451 SYS_FCHMODAT2 = 452 SYS_MAP_SHADOW_STACK = 453 + SYS_FUTEX_WAKE = 454 + SYS_FUTEX_WAIT = 455 + SYS_FUTEX_REQUEUE = 456 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go index 974bf246..8d467094 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go @@ -412,4 +412,8 @@ const ( SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 SYS_FCHMODAT2 = 452 + SYS_MAP_SHADOW_STACK = 453 + SYS_FUTEX_WAKE = 454 + SYS_FUTEX_WAIT = 455 + SYS_FUTEX_REQUEUE = 456 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go index 39a2739e..edc17324 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go @@ -315,4 +315,8 @@ const ( SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 SYS_FCHMODAT2 = 452 + SYS_MAP_SHADOW_STACK = 453 + SYS_FUTEX_WAKE = 454 + SYS_FUTEX_WAIT = 455 + SYS_FUTEX_REQUEUE = 456 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go index cf9c9d77..445eba20 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go @@ -309,4 +309,8 @@ const ( SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 SYS_FCHMODAT2 = 452 + SYS_MAP_SHADOW_STACK = 453 + SYS_FUTEX_WAKE = 454 + SYS_FUTEX_WAIT = 455 + SYS_FUTEX_REQUEUE = 456 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go index 10b7362e..adba01bc 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go @@ -432,4 +432,8 @@ const ( SYS_SET_MEMPOLICY_HOME_NODE = 4450 SYS_CACHESTAT = 4451 SYS_FCHMODAT2 = 4452 + SYS_MAP_SHADOW_STACK = 4453 + SYS_FUTEX_WAKE = 4454 + SYS_FUTEX_WAIT = 4455 + SYS_FUTEX_REQUEUE = 4456 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go index cd4d8b4f..014c4e9c 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go @@ -362,4 +362,8 @@ const ( SYS_SET_MEMPOLICY_HOME_NODE = 5450 SYS_CACHESTAT = 5451 SYS_FCHMODAT2 = 5452 + SYS_MAP_SHADOW_STACK = 5453 + SYS_FUTEX_WAKE = 5454 + SYS_FUTEX_WAIT = 5455 + SYS_FUTEX_REQUEUE = 5456 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go index 2c0efca8..ccc97d74 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go @@ -362,4 +362,8 @@ const ( SYS_SET_MEMPOLICY_HOME_NODE = 5450 SYS_CACHESTAT = 5451 SYS_FCHMODAT2 = 5452 + SYS_MAP_SHADOW_STACK = 5453 + SYS_FUTEX_WAKE = 5454 + SYS_FUTEX_WAIT = 5455 + SYS_FUTEX_REQUEUE = 5456 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go index a72e31d3..ec2b64a9 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go @@ -432,4 +432,8 @@ const ( SYS_SET_MEMPOLICY_HOME_NODE = 4450 SYS_CACHESTAT = 4451 SYS_FCHMODAT2 = 4452 + SYS_MAP_SHADOW_STACK = 4453 + SYS_FUTEX_WAKE = 4454 + SYS_FUTEX_WAIT = 4455 + SYS_FUTEX_REQUEUE = 4456 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go index c7d1e374..21a839e3 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go @@ -439,4 +439,8 @@ const ( SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 SYS_FCHMODAT2 = 452 + SYS_MAP_SHADOW_STACK = 453 + SYS_FUTEX_WAKE = 454 + SYS_FUTEX_WAIT = 455 + SYS_FUTEX_REQUEUE = 456 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go index f4d4838c..c11121ec 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go @@ -411,4 +411,8 @@ const ( SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 SYS_FCHMODAT2 = 452 + SYS_MAP_SHADOW_STACK = 453 + SYS_FUTEX_WAKE = 454 + SYS_FUTEX_WAIT = 455 + SYS_FUTEX_REQUEUE = 456 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go index b64f0e59..909b631f 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go @@ -411,4 +411,8 @@ const ( SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 SYS_FCHMODAT2 = 452 + SYS_MAP_SHADOW_STACK = 453 + SYS_FUTEX_WAKE = 454 + SYS_FUTEX_WAIT = 455 + SYS_FUTEX_REQUEUE = 456 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go index 95711195..e49bed16 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go @@ -316,4 +316,8 @@ const ( SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 SYS_FCHMODAT2 = 452 + SYS_MAP_SHADOW_STACK = 453 + SYS_FUTEX_WAKE = 454 + SYS_FUTEX_WAIT = 455 + SYS_FUTEX_REQUEUE = 456 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go index f94e943b..66017d2d 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go @@ -377,4 +377,8 @@ const ( SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 SYS_FCHMODAT2 = 452 + SYS_MAP_SHADOW_STACK = 453 + SYS_FUTEX_WAKE = 454 + SYS_FUTEX_WAIT = 455 + SYS_FUTEX_REQUEUE = 456 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go index ba0c2bc5..47bab18d 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go @@ -390,4 +390,8 @@ const ( SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 SYS_FCHMODAT2 = 452 + SYS_MAP_SHADOW_STACK = 453 + SYS_FUTEX_WAKE = 454 + SYS_FUTEX_WAIT = 455 + SYS_FUTEX_REQUEUE = 456 ) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go index bbf8399f..dc0c955e 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -174,7 +174,8 @@ type FscryptPolicyV2 struct { Contents_encryption_mode uint8 Filenames_encryption_mode uint8 Flags uint8 - _ [4]uint8 + Log2_data_unit_size uint8 + _ [3]uint8 Master_key_identifier [16]uint8 } @@ -455,60 +456,63 @@ type Ucred struct { } type TCPInfo struct { - State uint8 - Ca_state uint8 - Retransmits uint8 - Probes uint8 - Backoff uint8 - Options uint8 - Rto uint32 - Ato uint32 - Snd_mss uint32 - Rcv_mss uint32 - Unacked uint32 - Sacked uint32 - Lost uint32 - Retrans uint32 - Fackets uint32 - Last_data_sent uint32 - Last_ack_sent uint32 - Last_data_recv uint32 - Last_ack_recv uint32 - Pmtu uint32 - Rcv_ssthresh uint32 - Rtt uint32 - Rttvar uint32 - Snd_ssthresh uint32 - Snd_cwnd uint32 - Advmss uint32 - Reordering uint32 - Rcv_rtt uint32 - Rcv_space uint32 - Total_retrans uint32 - Pacing_rate uint64 - Max_pacing_rate uint64 - Bytes_acked uint64 - Bytes_received uint64 - Segs_out uint32 - Segs_in uint32 - Notsent_bytes uint32 - Min_rtt uint32 - Data_segs_in uint32 - Data_segs_out uint32 - Delivery_rate uint64 - Busy_time uint64 - Rwnd_limited uint64 - Sndbuf_limited uint64 - Delivered uint32 - Delivered_ce uint32 - Bytes_sent uint64 - Bytes_retrans uint64 - Dsack_dups uint32 - Reord_seen uint32 - Rcv_ooopack uint32 - Snd_wnd uint32 - Rcv_wnd uint32 - Rehash uint32 + State uint8 + Ca_state uint8 + Retransmits uint8 + Probes uint8 + Backoff uint8 + Options uint8 + Rto uint32 + Ato uint32 + Snd_mss uint32 + Rcv_mss uint32 + Unacked uint32 + Sacked uint32 + Lost uint32 + Retrans uint32 + Fackets uint32 + Last_data_sent uint32 + Last_ack_sent uint32 + Last_data_recv uint32 + Last_ack_recv uint32 + Pmtu uint32 + Rcv_ssthresh uint32 + Rtt uint32 + Rttvar uint32 + Snd_ssthresh uint32 + Snd_cwnd uint32 + Advmss uint32 + Reordering uint32 + Rcv_rtt uint32 + Rcv_space uint32 + Total_retrans uint32 + Pacing_rate uint64 + Max_pacing_rate uint64 + Bytes_acked uint64 + Bytes_received uint64 + Segs_out uint32 + Segs_in uint32 + Notsent_bytes uint32 + Min_rtt uint32 + Data_segs_in uint32 + Data_segs_out uint32 + Delivery_rate uint64 + Busy_time uint64 + Rwnd_limited uint64 + Sndbuf_limited uint64 + Delivered uint32 + Delivered_ce uint32 + Bytes_sent uint64 + Bytes_retrans uint64 + Dsack_dups uint32 + Reord_seen uint32 + Rcv_ooopack uint32 + Snd_wnd uint32 + Rcv_wnd uint32 + Rehash uint32 + Total_rto uint16 + Total_rto_recoveries uint16 + Total_rto_time uint32 } type CanFilter struct { @@ -551,7 +555,7 @@ const ( SizeofIPv6MTUInfo = 0x20 SizeofICMPv6Filter = 0x20 SizeofUcred = 0xc - SizeofTCPInfo = 0xf0 + SizeofTCPInfo = 0xf8 SizeofCanFilter = 0x8 SizeofTCPRepairOpt = 0x8 ) @@ -3399,7 +3403,7 @@ const ( DEVLINK_PORT_FN_ATTR_STATE = 0x2 DEVLINK_PORT_FN_ATTR_OPSTATE = 0x3 DEVLINK_PORT_FN_ATTR_CAPS = 0x4 - DEVLINK_PORT_FUNCTION_ATTR_MAX = 0x4 + DEVLINK_PORT_FUNCTION_ATTR_MAX = 0x5 ) type FsverityDigest struct { @@ -4183,7 +4187,8 @@ const ( ) type LandlockRulesetAttr struct { - Access_fs uint64 + Access_fs uint64 + Access_net uint64 } type LandlockPathBeneathAttr struct { @@ -5134,7 +5139,7 @@ const ( NL80211_FREQUENCY_ATTR_GO_CONCURRENT = 0xf NL80211_FREQUENCY_ATTR_INDOOR_ONLY = 0xe NL80211_FREQUENCY_ATTR_IR_CONCURRENT = 0xf - NL80211_FREQUENCY_ATTR_MAX = 0x1b + NL80211_FREQUENCY_ATTR_MAX = 0x1c NL80211_FREQUENCY_ATTR_MAX_TX_POWER = 0x6 NL80211_FREQUENCY_ATTR_NO_10MHZ = 0x11 NL80211_FREQUENCY_ATTR_NO_160MHZ = 0xc @@ -5547,7 +5552,7 @@ const ( NL80211_REGDOM_TYPE_CUSTOM_WORLD = 0x2 NL80211_REGDOM_TYPE_INTERSECTION = 0x3 NL80211_REGDOM_TYPE_WORLD = 0x1 - NL80211_REG_RULE_ATTR_MAX = 0x7 + NL80211_REG_RULE_ATTR_MAX = 0x8 NL80211_REKEY_DATA_AKM = 0x4 NL80211_REKEY_DATA_KCK = 0x2 NL80211_REKEY_DATA_KEK = 0x1 diff --git a/vendor/golang.org/x/sys/windows/env_windows.go b/vendor/golang.org/x/sys/windows/env_windows.go index b8ad1925..d4577a42 100644 --- a/vendor/golang.org/x/sys/windows/env_windows.go +++ b/vendor/golang.org/x/sys/windows/env_windows.go @@ -37,14 +37,17 @@ func (token Token) Environ(inheritExisting bool) (env []string, err error) { return nil, err } defer DestroyEnvironmentBlock(block) - blockp := unsafe.Pointer(block) - for { - entry := UTF16PtrToString((*uint16)(blockp)) - if len(entry) == 0 { - break + size := unsafe.Sizeof(*block) + for *block != 0 { + // find NUL terminator + end := unsafe.Pointer(block) + for *(*uint16)(end) != 0 { + end = unsafe.Add(end, size) } - env = append(env, entry) - blockp = unsafe.Add(blockp, 2*(len(entry)+1)) + + entry := unsafe.Slice(block, (uintptr(end)-uintptr(unsafe.Pointer(block)))/size) + env = append(env, UTF16ToString(entry)) + block = (*uint16)(unsafe.Add(end, size)) } return env, nil } diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go index 47dc5796..6395a031 100644 --- a/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/vendor/golang.org/x/sys/windows/syscall_windows.go @@ -125,8 +125,7 @@ func UTF16PtrToString(p *uint16) string { for ptr := unsafe.Pointer(p); *(*uint16)(ptr) != 0; n++ { ptr = unsafe.Pointer(uintptr(ptr) + unsafe.Sizeof(*p)) } - - return string(utf16.Decode(unsafe.Slice(p, n))) + return UTF16ToString(unsafe.Slice(p, n)) } func Getpagesize() int { return 4096 } @@ -194,6 +193,7 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys GetComputerName(buf *uint16, n *uint32) (err error) = GetComputerNameW //sys GetComputerNameEx(nametype uint32, buf *uint16, n *uint32) (err error) = GetComputerNameExW //sys SetEndOfFile(handle Handle) (err error) +//sys SetFileValidData(handle Handle, validDataLength int64) (err error) //sys GetSystemTimeAsFileTime(time *Filetime) //sys GetSystemTimePreciseAsFileTime(time *Filetime) //sys GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, err error) [failretval==0xffffffff] diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/zsyscall_windows.go index 146a1f01..e8791c82 100644 --- a/vendor/golang.org/x/sys/windows/zsyscall_windows.go +++ b/vendor/golang.org/x/sys/windows/zsyscall_windows.go @@ -342,6 +342,7 @@ var ( procSetDefaultDllDirectories = modkernel32.NewProc("SetDefaultDllDirectories") procSetDllDirectoryW = modkernel32.NewProc("SetDllDirectoryW") procSetEndOfFile = modkernel32.NewProc("SetEndOfFile") + procSetFileValidData = modkernel32.NewProc("SetFileValidData") procSetEnvironmentVariableW = modkernel32.NewProc("SetEnvironmentVariableW") procSetErrorMode = modkernel32.NewProc("SetErrorMode") procSetEvent = modkernel32.NewProc("SetEvent") @@ -2988,6 +2989,14 @@ func SetEndOfFile(handle Handle) (err error) { return } +func SetFileValidData(handle Handle, validDataLength int64) (err error) { + r1, _, e1 := syscall.Syscall(procSetFileValidData.Addr(), 2, uintptr(handle), uintptr(validDataLength), 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func SetEnvironmentVariable(name *uint16, value *uint16) (err error) { r1, _, e1 := syscall.Syscall(procSetEnvironmentVariableW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(value)), 0) if r1 == 0 { diff --git a/vendor/howett.net/plist/bplist_parser.go b/vendor/howett.net/plist/bplist_parser.go index 1825b570..8bb164e1 100644 --- a/vendor/howett.net/plist/bplist_parser.go +++ b/vendor/howett.net/plist/bplist_parser.go @@ -137,7 +137,10 @@ func (p *bplistParser) parseSizedInteger(off offset, nbytes int) (lo uint64, hi case 16: lo, hi = binary.BigEndian.Uint64(p.buffer[off+8:]), binary.BigEndian.Uint64(p.buffer[off:]) default: - panic(errors.New("illegal integer size")) + if nbytes > 8 { + panic(errors.New("illegal integer size")) + } + lo, hi = binary.BigEndian.Uint64(p.buffer[off-(8-offset(nbytes)):]) & ((1<