mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:57:43 +00:00
Kernel: Rename UnveilState to VeilState
This commit is contained in:
parent
66598f60fe
commit
30ad7953ca
4 changed files with 16 additions and 16 deletions
|
@ -822,14 +822,14 @@ Optional<KBuffer> procfs$all(InodeIdentifier)
|
||||||
|
|
||||||
process_object.add("pledge", pledge_builder.to_string());
|
process_object.add("pledge", pledge_builder.to_string());
|
||||||
|
|
||||||
switch (process.unveil_state()) {
|
switch (process.veil_state()) {
|
||||||
case UnveilState::None:
|
case VeilState::None:
|
||||||
process_object.add("veil", "None");
|
process_object.add("veil", "None");
|
||||||
break;
|
break;
|
||||||
case UnveilState::VeilDropped:
|
case VeilState::Dropped:
|
||||||
process_object.add("veil", "Dropped");
|
process_object.add("veil", "Dropped");
|
||||||
break;
|
break;
|
||||||
case UnveilState::VeilLocked:
|
case VeilState::Locked:
|
||||||
process_object.add("veil", "Locked");
|
process_object.add("veil", "Locked");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -719,7 +719,7 @@ const UnveiledPath* VFS::find_matching_unveiled_path(StringView path)
|
||||||
|
|
||||||
KResult VFS::validate_path_against_process_veil(StringView path, int options)
|
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;
|
return KSuccess;
|
||||||
|
|
||||||
// FIXME: Figure out a nicer way to do this.
|
// FIXME: Figure out a nicer way to do this.
|
||||||
|
|
|
@ -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_root_directory_relative_to_global_root = m_root_directory_relative_to_global_root;
|
||||||
child->m_promises = m_promises;
|
child->m_promises = m_promises;
|
||||||
child->m_execpromises = m_execpromises;
|
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;
|
child->m_unveiled_paths = m_unveiled_paths;
|
||||||
|
|
||||||
#ifdef FORK_DEBUG
|
#ifdef FORK_DEBUG
|
||||||
|
@ -860,7 +860,7 @@ int Process::do_exec(NonnullRefPtr<FileDescription> main_program_description, Ve
|
||||||
|
|
||||||
m_promises = m_execpromises;
|
m_promises = m_execpromises;
|
||||||
|
|
||||||
m_unveil_state = UnveilState::None;
|
m_veil_state = VeilState::None;
|
||||||
m_unveiled_paths.clear();
|
m_unveiled_paths.clear();
|
||||||
|
|
||||||
// Copy of the master TLS region that we will clone for new threads
|
// 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;
|
return -EFAULT;
|
||||||
|
|
||||||
if (!params.path.characters && !params.permissions.characters) {
|
if (!params.path.characters && !params.permissions.characters) {
|
||||||
m_unveil_state = UnveilState::VeilLocked;
|
m_veil_state = VeilState::Locked;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_unveil_state == UnveilState::VeilLocked)
|
if (m_veil_state == VeilState::Locked)
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
|
|
||||||
if (!params.path.characters || !params.permissions.characters)
|
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 });
|
m_unveiled_paths.append({ path.value(), new_permissions });
|
||||||
ASSERT(m_unveil_state != UnveilState::VeilLocked);
|
ASSERT(m_veil_state != VeilState::Locked);
|
||||||
m_unveil_state = UnveilState::VeilDropped;
|
m_veil_state = VeilState::Dropped;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,10 +82,10 @@ enum class Pledge : u32 {
|
||||||
#undef __ENUMERATE_PLEDGE_PROMISE
|
#undef __ENUMERATE_PLEDGE_PROMISE
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class UnveilState {
|
enum class VeilState {
|
||||||
None,
|
None,
|
||||||
VeilDropped,
|
Dropped,
|
||||||
VeilLocked,
|
Locked,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct UnveiledPath {
|
struct UnveiledPath {
|
||||||
|
@ -399,7 +399,7 @@ public:
|
||||||
bool has_promises() const { return m_promises; }
|
bool has_promises() const { return m_promises; }
|
||||||
bool has_promised(Pledge pledge) const { return m_promises & (1u << (u32)pledge); }
|
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; }
|
const Vector<UnveiledPath>& unveiled_paths() const { return m_unveiled_paths; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -503,7 +503,7 @@ private:
|
||||||
u32 m_promises { 0 };
|
u32 m_promises { 0 };
|
||||||
u32 m_execpromises { 0 };
|
u32 m_execpromises { 0 };
|
||||||
|
|
||||||
UnveilState m_unveil_state { UnveilState::None };
|
VeilState m_veil_state { VeilState::None };
|
||||||
Vector<UnveiledPath> m_unveiled_paths;
|
Vector<UnveiledPath> m_unveiled_paths;
|
||||||
|
|
||||||
WaitQueue& futex_queue(i32*);
|
WaitQueue& futex_queue(i32*);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue