ladybird/Kernel/Forward.h
Andreas Kling 122d7d9533 Kernel: Add Credentials to hold a set of user and group IDs
This patch adds a new object to hold a Process's user credentials:

- UID, EUID, SUID
- GID, EGID, SGID, extra GIDs

Credentials are immutable and child processes initially inherit the
Credentials object from their parent.

Whenever a process changes one or more of its user/group IDs, a new
Credentials object is constructed.

Any code that wants to inspect and act on a set of credentials can now
do so without worrying about data races.
2022-08-20 18:32:50 +02:00

105 lines
2.1 KiB
C++

/*
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/DistinctNumeric.h>
#include <Kernel/API/POSIX/sys/types.h>
namespace Kernel {
class BlockDevice;
class CharacterDevice;
class Coredump;
class Credentials;
class Custody;
class DevTmpFSDeviceInode;
class DevTmpFSDirectoryInode;
class DevTmpFSInode;
class DevTmpFSPtsDirectoryInode;
class DevTmpFSRootDirectoryInode;
class Device;
class DiskCache;
class DoubleBuffer;
class File;
class OpenFileDescription;
class DisplayConnector;
class FileSystem;
class FutexQueue;
class IPv4Socket;
class Inode;
class InodeIdentifier;
class InodeWatcher;
class KBuffer;
class LocalSocket;
class Mutex;
class MasterPTY;
class Mount;
class PerformanceEventBuffer;
class ProcFS;
class ProcFSDirectoryInode;
class ProcFSExposedComponent;
class ProcFSExposedDirectory;
class ProcFSInode;
class ProcFSProcessInformation;
class ProcFSRootDirectory;
class ProcFSSystemBoolean;
class ProcFSSystemDirectory;
class Process;
class ProcessGroup;
class RecursiveSpinlock;
class Scheduler;
class Socket;
class SysFS;
class SysFSDirectory;
class SysFSRootDirectory;
class SysFSBusDirectory;
class SysFSDevicesDirectory;
class SysFSDirectoryInode;
class SysFSInode;
class TCPSocket;
class TTY;
class Thread;
class ThreadTracer;
class UDPSocket;
class UserOrKernelBuffer;
class VirtualFileSystem;
class WaitQueue;
class WorkQueue;
namespace Memory {
class AddressSpace;
class AnonymousVMObject;
class InodeVMObject;
class MappedROM;
class MemoryManager;
class PageDirectory;
class PhysicalPage;
class PhysicalRegion;
class PrivateInodeVMObject;
class Region;
class SharedInodeVMObject;
class VMObject;
class VirtualRange;
}
class Spinlock;
template<typename LockType>
class SpinlockLocker;
struct InodeMetadata;
struct TrapFrame;
AK_TYPEDEF_DISTINCT_ORDERED_ID(pid_t, ProcessID);
AK_TYPEDEF_DISTINCT_ORDERED_ID(pid_t, ThreadID);
AK_TYPEDEF_DISTINCT_ORDERED_ID(pid_t, SessionID);
AK_TYPEDEF_DISTINCT_ORDERED_ID(pid_t, ProcessGroupID);
AK_TYPEDEF_DISTINCT_ORDERED_ID(uid_t, UserID);
AK_TYPEDEF_DISTINCT_ORDERED_ID(gid_t, GroupID);
}