From 97d65565f4ab1814ea76aafc66e2bae848071a7c Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Fri, 27 Dec 2024 12:10:40 +0100 Subject: Kernel: Fixes and improvements to scheduler. Signed-off-by: Amlal El Mahrouss --- dev/Kernel/src/User.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'dev/Kernel/src/User.cc') diff --git a/dev/Kernel/src/User.cc b/dev/Kernel/src/User.cc index 8d1bcac9..88d14b2f 100644 --- a/dev/Kernel/src/User.cc +++ b/dev/Kernel/src/User.cc @@ -27,9 +27,11 @@ namespace Kernel { namespace Detail { + //////////////////////////////////////////////////////////// /// \brief Constructs a password by hashing the password. /// \param password password to hash. /// \return the hashed password + //////////////////////////////////////////////////////////// const Int32 cred_construct_token(Char* password, const Char* in_password, User* user, SizeT length) { if (!password || !user) @@ -53,7 +55,9 @@ namespace Kernel } } // namespace Detail + //////////////////////////////////////////////////////////// /// @brief User ring constructor. + //////////////////////////////////////////////////////////// User::User(const Int32& sel, const Char* userName) : mUserRing((UserRingKind)sel) { @@ -61,14 +65,18 @@ namespace Kernel rt_copy_memory((VoidPtr)userName, this->mUserName, rt_string_len(userName)); } + //////////////////////////////////////////////////////////// /// @brief User ring constructor. + //////////////////////////////////////////////////////////// User::User(const UserRingKind& ringKind, const Char* userName) : mUserRing(ringKind) { rt_copy_memory((VoidPtr)userName, this->mUserName, rt_string_len(userName)); } + //////////////////////////////////////////////////////////// /// @brief User destructor class. + //////////////////////////////////////////////////////////// User::~User() = default; Bool User::Save(const usr_public_key_kind password_to_fill) noexcept @@ -159,8 +167,11 @@ namespace Kernel return this->mUserName; } + //////////////////////////////////////////////////////////// /// @brief Returns the user's ring. /// @return The king of ring the user is attached to. + //////////////////////////////////////////////////////////// + const UserRingKind& User::Ring() noexcept { return this->mUserRing; -- cgit v1.2.3