Skip to content

Commit

Permalink
Remove SelinuxfsMagic
Browse files Browse the repository at this point in the history
Use the value from x/sys/unix directly.

While at it, remove buf.Type typecast, since we're
comparing it with an (untyped) const, so it should
not bring any warnings on e.g. 32-bit ARM.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
  • Loading branch information
kolyshkin committed Feb 18, 2020
1 parent 5edaf9d commit 86a2c3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions go-selinux/selinux_linux.go
Expand Up @@ -37,7 +37,6 @@ const (
selinuxTag = "SELINUX"
xattrNameSelinux = "security.selinux"
stRdOnly = 0x01
selinuxfsMagic = 0xf97cff8c
)

type selinuxState struct {
Expand Down Expand Up @@ -118,7 +117,8 @@ func verifySELinuxfsMount(mnt string) bool {
}
return false
}
if uint32(buf.Type) != uint32(selinuxfsMagic) {

if buf.Type != unix.SELINUX_MAGIC {
return false
}
if (buf.Flags & stRdOnly) != 0 {
Expand Down

0 comments on commit 86a2c3f

Please sign in to comment.