+/*
+ interpret an old style SE_PRIV structure
+ */
+static uint64_t map_old_SE_PRIV(unsigned char *dptr)
+{
+ uint32_t *old_masks = (uint32_t *)dptr;
+ /*
+ * the old privileges code only ever used up to 0x800, except
+ * for a special case of 'SE_ALL_PRIVS' which was 0xFFFFFFFF
+ */
+ if (old_masks[0] == 0xFFFFFFFF) {
+ /* they set all privileges */
+ return SE_ALL_PRIVS;
+ }
+
+ /* the old code used the machine byte order, but we don't know
+ * the byte order of the machine that wrote it. However we can
+ * tell what byte order it was by taking advantage of the fact
+ * that it only ever use up to 0x800
+ */
+ if (dptr[0] || dptr[1]) {
+ /* it was little endian */
+ return IVAL(dptr, 0);
+ }
+
+ /* it was either zero or big-endian */
+ return RIVAL(dptr, 0);
+}
+