Kernel: Remove char* versions of path argument / kstring copy methods

The only two paths for copying strings in the kernel should be going
through the existing Userspace<char const*>, or StringArgument methods.

Lets enforce this by removing the option for using the raw cstring APIs
that were previously available.
This commit is contained in:
Brian Gianforcaro 2021-08-12 22:04:31 -07:00 committed by Andreas Kling
commit 40a942d28b
Notes: sideshowbarker 2024-07-18 07:02:31 +09:00
6 changed files with 14 additions and 21 deletions

View file

@ -498,7 +498,7 @@ Custody& Process::current_directory()
return *m_cwd;
}
KResultOr<NonnullOwnPtr<KString>> Process::get_syscall_path_argument(char const* user_path, size_t path_length) const
KResultOr<NonnullOwnPtr<KString>> Process::get_syscall_path_argument(Userspace<char const*> user_path, size_t path_length) const
{
if (path_length == 0)
return EINVAL;
@ -512,7 +512,8 @@ KResultOr<NonnullOwnPtr<KString>> Process::get_syscall_path_argument(char const*
KResultOr<NonnullOwnPtr<KString>> Process::get_syscall_path_argument(Syscall::StringArgument const& path) const
{
return get_syscall_path_argument(path.characters, path.length);
Userspace<char const*> path_characters((FlatPtr)path.characters);
return get_syscall_path_argument(path_characters, path.length);
}
bool Process::dump_core()