diff options
author | Liav A <liavalb@gmail.com> | 2020-12-25 19:01:19 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-12-27 23:07:44 +0100 |
commit | 18e77aa28535d52eb6be9c2791a6d217433b1b68 (patch) | |
tree | b63d9024593e11667884c8d9074aeb55bc20e823 /Kernel/TTY | |
parent | 092a13211a4216c19c08280bd5e5803e1030f087 (diff) | |
download | serenity-18e77aa28535d52eb6be9c2791a6d217433b1b68.zip |
Kernel: Add a method to determine the desired permissions of a Device
This method will be used later in DevFS, to set the appropriate
permissions for each device node.
Diffstat (limited to 'Kernel/TTY')
-rw-r--r-- | Kernel/TTY/MasterPTY.h | 3 | ||||
-rw-r--r-- | Kernel/TTY/PTYMultiplexer.h | 3 | ||||
-rw-r--r-- | Kernel/TTY/TTY.h | 3 |
3 files changed, 9 insertions, 0 deletions
diff --git a/Kernel/TTY/MasterPTY.h b/Kernel/TTY/MasterPTY.h index 69ba0a16dc..7744a58cdb 100644 --- a/Kernel/TTY/MasterPTY.h +++ b/Kernel/TTY/MasterPTY.h @@ -48,6 +48,9 @@ public: virtual String absolute_path(const FileDescription&) const override; + // ^Device + virtual mode_t required_mode() const override { return 0640; } + private: // ^CharacterDevice virtual KResultOr<size_t> read(FileDescription&, size_t, UserOrKernelBuffer&, size_t) override; diff --git a/Kernel/TTY/PTYMultiplexer.h b/Kernel/TTY/PTYMultiplexer.h index bb20469f38..9402ae1136 100644 --- a/Kernel/TTY/PTYMultiplexer.h +++ b/Kernel/TTY/PTYMultiplexer.h @@ -55,6 +55,9 @@ public: void notify_master_destroyed(Badge<MasterPTY>, unsigned index); + // ^Device + virtual mode_t required_mode() const override { return 0666; } + private: // ^CharacterDevice virtual const char* class_name() const override { return "PTYMultiplexer"; } diff --git a/Kernel/TTY/TTY.h b/Kernel/TTY/TTY.h index 8ba84a0dc6..a60526078c 100644 --- a/Kernel/TTY/TTY.h +++ b/Kernel/TTY/TTY.h @@ -67,6 +67,9 @@ public: void set_default_termios(); void hang_up(); + // ^Device + virtual mode_t required_mode() const override { return 0620; } + protected: virtual ssize_t on_tty_write(const UserOrKernelBuffer&, ssize_t) = 0; void set_size(unsigned short columns, unsigned short rows); |