The Pedigree Project 0.1
FilesystemCredentials.h
1/* Filesystem authority is numeric and independent of account-file records. */
2#ifndef PEDIGREE_FILESYSTEM_CREDENTIALS_H
3#define PEDIGREE_FILESYSTEM_CREDENTIALS_H
4#include "pedigree/kernel/processor/types.h"
5
7 static constexpr size_t MaximumGroups = 32;
8 uint32_t uid = 0, gid = 0;
9 uint32_t groups[MaximumGroups] = {};
10 size_t groupCount = 0;
11 bool valid = false;
12 bool inGroup(uint32_t id) const {
13 if (gid == id)
14 return true;
15 for (size_t i = 0; i < groupCount; ++i)
16 if (groups[i] == id)
17 return true;
18 return false;
19 }
20};
21#endif