Fix Filemode
Fix Filemode

Previously the code assumed that you could just cast the
syscall.Stat().mode field to create an os.FileMode, but this is not
correct.
The mode from stat is a 16 bit value made up of a 4 bit enum that
gives the type, 3 bits for suid, sgid, and sticky, and 3 sets of 3
bits for permissions. The os.FileMode is a 32 bit value, with the
lower 9 matching the permissions bits, but the remaining 23 bits are a
bitfield.

There isn't an exported function in the standard library to convert
the output (there are things like fillFileStatFromSys which do more),
so this includes a small function to do this.

Signed-off-by: Icarus Sparry <6c3f1b7255a010a0f2f5925d48745b811c353441@intel.com>

cavaliercoder/go-rpm