Kernel: Rename UnveilState to VeilState

This commit is contained in:
Andreas Kling 2020-01-21 19:28:29 +01:00
parent 66598f60fe
commit 30ad7953ca
Notes: sideshowbarker 2024-07-19 09:54:43 +09:00
4 changed files with 16 additions and 16 deletions

View file

@ -822,14 +822,14 @@ Optional<KBuffer> procfs$all(InodeIdentifier)
process_object.add("pledge", pledge_builder.to_string());
switch (process.unveil_state()) {
case UnveilState::None:
switch (process.veil_state()) {
case VeilState::None:
process_object.add("veil", "None");
break;
case UnveilState::VeilDropped:
case VeilState::Dropped:
process_object.add("veil", "Dropped");
break;
case UnveilState::VeilLocked:
case VeilState::Locked:
process_object.add("veil", "Locked");
break;
}

View file

@ -719,7 +719,7 @@ const UnveiledPath* VFS::find_matching_unveiled_path(StringView path)
KResult VFS::validate_path_against_process_veil(StringView path, int options)
{
if (current->process().unveil_state() == UnveilState::None)
if (current->process().veil_state() == VeilState::None)
return KSuccess;
// FIXME: Figure out a nicer way to do this.

View file

@ -639,7 +639,7 @@ pid_t Process::sys$fork(RegisterDump& regs)
child->m_root_directory_relative_to_global_root = m_root_directory_relative_to_global_root;
child->m_promises = m_promises;
child->m_execpromises = m_execpromises;
child->m_unveil_state = m_unveil_state;
child->m_veil_state = m_veil_state;
child->m_unveiled_paths = m_unveiled_paths;
#ifdef FORK_DEBUG
@ -860,7 +860,7 @@ int Process::do_exec(NonnullRefPtr<FileDescription> main_program_description, Ve
m_promises = m_execpromises;
m_unveil_state = UnveilState::None;
m_veil_state = VeilState::None;
m_unveiled_paths.clear();
// Copy of the master TLS region that we will clone for new threads
@ -4607,11 +4607,11 @@ int Process::sys$unveil(const Syscall::SC_unveil_params* user_params)
return -EFAULT;
if (!params.path.characters && !params.permissions.characters) {
m_unveil_state = UnveilState::VeilLocked;
m_veil_state = VeilState::Locked;
return 0;
}
if (m_unveil_state == UnveilState::VeilLocked)
if (m_veil_state == VeilState::Locked)
return -EPERM;
if (!params.path.characters || !params.permissions.characters)
@ -4662,7 +4662,7 @@ int Process::sys$unveil(const Syscall::SC_unveil_params* user_params)
}
m_unveiled_paths.append({ path.value(), new_permissions });
ASSERT(m_unveil_state != UnveilState::VeilLocked);
m_unveil_state = UnveilState::VeilDropped;
ASSERT(m_veil_state != VeilState::Locked);
m_veil_state = VeilState::Dropped;
return 0;
}

View file

@ -82,10 +82,10 @@ enum class Pledge : u32 {
#undef __ENUMERATE_PLEDGE_PROMISE
};
enum class UnveilState {
enum class VeilState {
None,
VeilDropped,
VeilLocked,
Dropped,
Locked,
};
struct UnveiledPath {
@ -399,7 +399,7 @@ public:
bool has_promises() const { return m_promises; }
bool has_promised(Pledge pledge) const { return m_promises & (1u << (u32)pledge); }
UnveilState unveil_state() const { return m_unveil_state; }
VeilState veil_state() const { return m_veil_state; }
const Vector<UnveiledPath>& unveiled_paths() const { return m_unveiled_paths; }
private:
@ -503,7 +503,7 @@ private:
u32 m_promises { 0 };
u32 m_execpromises { 0 };
UnveilState m_unveil_state { UnveilState::None };
VeilState m_veil_state { VeilState::None };
Vector<UnveiledPath> m_unveiled_paths;
WaitQueue& futex_queue(i32*);