Compare commits
3 Commits
14fdcb892d
...
991ae4383a
Author | SHA1 | Date |
---|---|---|
Bananymous | 991ae4383a | |
Bananymous | 2ce7205c80 | |
Bananymous | bec3e8654f |
|
@ -119,8 +119,9 @@ namespace Kernel
|
|||
|
||||
BAN::ErrorOr<long> sys_pread(int fd, void* buffer, size_t count, off_t offset);
|
||||
|
||||
BAN::ErrorOr<long> sys_chmod(const char*, mode_t);
|
||||
BAN::ErrorOr<long> sys_chown(const char*, uid_t, gid_t);
|
||||
BAN::ErrorOr<long> sys_chmod(const char* path, mode_t mode);
|
||||
BAN::ErrorOr<long> sys_fchmod(int fildes, mode_t mode);
|
||||
BAN::ErrorOr<long> sys_chown(const char* path, uid_t uid, gid_t gid);
|
||||
|
||||
BAN::ErrorOr<long> sys_socket(int domain, int type, int protocol);
|
||||
BAN::ErrorOr<long> sys_getsockname(int socket, sockaddr* address, socklen_t* address_len);
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include <ctype.h>
|
||||
|
||||
bool g_disable_debug = false;
|
||||
extern Kernel::TerminalDriver* g_terminal_driver;
|
||||
|
||||
namespace Debug
|
||||
|
@ -70,6 +71,9 @@ namespace Debug
|
|||
{
|
||||
using namespace Kernel;
|
||||
|
||||
if (g_disable_debug)
|
||||
return;
|
||||
|
||||
if (Kernel::Serial::has_devices())
|
||||
return Kernel::Serial::putchar_any(ch);
|
||||
if (Kernel::TTY::is_initialized())
|
||||
|
|
|
@ -1103,6 +1103,18 @@ namespace Kernel
|
|||
return 0;
|
||||
}
|
||||
|
||||
BAN::ErrorOr<long> Process::sys_fchmod(int fildes, mode_t mode)
|
||||
{
|
||||
if (mode & S_IFMASK)
|
||||
return BAN::Error::from_errno(EINVAL);
|
||||
|
||||
LockGuard _(m_process_lock);
|
||||
auto inode = TRY(m_open_file_descriptors.inode_of(fildes));
|
||||
TRY(inode->chmod(mode));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
BAN::ErrorOr<long> Process::sys_chown(const char* path, uid_t uid, gid_t gid)
|
||||
{
|
||||
LockGuard _(m_process_lock);
|
||||
|
|
|
@ -65,6 +65,7 @@ static bool should_disable_serial(BAN::StringView full_command_line)
|
|||
return false;
|
||||
}
|
||||
|
||||
extern bool g_disable_debug;
|
||||
static ParsedCommandLine cmdline;
|
||||
|
||||
static void parse_command_line()
|
||||
|
@ -81,6 +82,8 @@ static void parse_command_line()
|
|||
cmdline.disable_smp = true;
|
||||
else if (argument == "nousb")
|
||||
cmdline.disable_usb = true;
|
||||
else if (argument == "nodebug")
|
||||
g_disable_debug = true;
|
||||
else if (argument.starts_with("ps2="))
|
||||
{
|
||||
if (argument.size() != 5 || !isdigit(argument[4]))
|
||||
|
|
|
@ -55,6 +55,7 @@ __BEGIN_DECLS
|
|||
O(SYS_TTY_CTRL, tty_ctrl) \
|
||||
O(SYS_POWEROFF, poweroff) \
|
||||
O(SYS_CHMOD, chmod) \
|
||||
O(SYS_FCHMOD, fchmod) \
|
||||
O(SYS_CREATE, create) \
|
||||
O(SYS_CREATE_DIR, create_dir) \
|
||||
O(SYS_UNLINK, unlink) \
|
||||
|
|
|
@ -13,9 +13,9 @@ int chmod(const char* path, mode_t mode)
|
|||
return syscall(SYS_CHMOD, path, mode);
|
||||
}
|
||||
|
||||
int fchmod(int, mode_t)
|
||||
int fchmod(int fildes, mode_t mode)
|
||||
{
|
||||
ASSERT_NOT_REACHED();
|
||||
return syscall(SYS_FCHMOD, fildes, mode);
|
||||
}
|
||||
|
||||
int fstat(int fildes, struct stat* buf)
|
||||
|
|
|
@ -197,6 +197,18 @@ BAN::Vector<BAN::Vector<BAN::String>> parse_command(BAN::StringView command_view
|
|||
{
|
||||
char c = command_view[i];
|
||||
|
||||
if (i + 1 < command_view.size() && c == '\\')
|
||||
{
|
||||
char next = command_view[i + 1];
|
||||
if (next == '\'' || next == '"')
|
||||
{
|
||||
if (i + 1 < command_view.size())
|
||||
MUST(current_arg.push_back(next));
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case State::Normal:
|
||||
|
|
Loading…
Reference in New Issue