mirror of
https://github.com/securego/gosec.git
synced 2024-12-26 12:35:52 +00:00
cf63541008
* fileperms: extract existing mode comparison logic * fileperms: add failing test * fileperms: bitwise permission comparison
15 lines
381 B
Go
15 lines
381 B
Go
package rules
|
|
|
|
import (
|
|
. "github.com/onsi/ginkgo/v2"
|
|
. "github.com/onsi/gomega"
|
|
)
|
|
|
|
var _ = Describe("modeIsSubset", func() {
|
|
It("it compares modes correctly", func() {
|
|
Expect(modeIsSubset(0o600, 0o600)).To(BeTrue())
|
|
Expect(modeIsSubset(0o400, 0o600)).To(BeTrue())
|
|
Expect(modeIsSubset(0o644, 0o600)).To(BeFalse())
|
|
Expect(modeIsSubset(0o466, 0o600)).To(BeFalse())
|
|
})
|
|
})
|