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 // POSIX supplies capability authority explicitly; other subsystem callers
13 // retain the traditional numeric-root credential convention.
14 bool enforceCapabilities = false;
15 uint64_t capabilities = 0;
16 bool inGroup(uint32_t id) const {
17 if (gid == id)
18 return true;
19 for (size_t i = 0; i < groupCount; ++i)
20 if (groups[i] == id)
21 return true;
22 return false;
23 }
24};
25#endif