# File lib/puppet/provider/selmodule/semodule.rb, line 84
 84:     def selmodversion_file
 85:         magic = 0xF97CFF8F
 86: 
 87:         filename = selmod_name_to_filename
 88:         mod = File.new(filename, "r")
 89: 
 90:         (hdr, ver, numsec) = mod.read(12).unpack('LLL')
 91: 
 92:         if hdr != magic
 93:             raise Puppet::Error, "Found #{hdr} instead of magic #{magic} in #{filename}"
 94:         end
 95: 
 96:         if ver != 1
 97:             raise Puppet::Error, "Unknown policy file version #{ver} in #{filename}"
 98:         end
 99: 
100:         # Read through (and throw away) the file section offsets, and also
101:         # the magic header for the first section.
102: 
103:         mod.read((numsec + 1) * 4)
104: 
105:         ## Section 1 should be "SE Linux Module"
106: 
107:         selmod_readnext(mod)
108:         selmod_readnext(mod)
109: 
110:         # Skip past the section headers
111:         mod.read(14)
112: 
113:         # Module name
114:         selmod_readnext(mod)
115: 
116:         # At last!  the version
117: 
118:         v = selmod_readnext(mod)
119: 
120:         self.debug "file version #{v}"
121:         return v
122:     end