mirror of
https://github.com/securego/gosec.git
synced 2024-12-28 21:08:22 +02:00
cf63541008
* fileperms: extract existing mode comparison logic * fileperms: add failing test * fileperms: bitwise permission comparison
16 lines
381 B
Go
16 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())
|
|
})
|
|
})
|