1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 14:27:34 +00:00

LibCore: Use StringView instead of char * in Account

This commit is contained in:
Lucas CHOLLET 2022-06-10 20:06:06 +02:00 committed by Sam Atkins
parent 0396b6da82
commit 507cb411c2
10 changed files with 33 additions and 36 deletions

View file

@ -32,11 +32,9 @@ public:
PasswdOnly
};
// FIXME: Convert the methods below to take StringViews instead.
static String parse_path_with_uid(StringView general_path, Optional<uid_t> force_uid = {});
static ErrorOr<Account> self(Read options = Read::All);
static ErrorOr<Account> from_name(char const* username, Read options = Read::All);
static ErrorOr<Account> from_name(StringView username, Read options = Read::All);
static ErrorOr<Account> from_uid(uid_t uid, Read options = Read::All);
bool authenticate(SecretString const& password) const;
@ -51,11 +49,11 @@ public:
// You must call sync to apply changes.
void set_password(SecretString const& password);
void set_password_enabled(bool enabled);
void set_home_directory(char const* home_directory) { m_home_directory = home_directory; }
void set_home_directory(StringView home_directory) { m_home_directory = home_directory; }
void set_uid(uid_t uid) { m_uid = uid; }
void set_gid(gid_t gid) { m_gid = gid; }
void set_shell(char const* shell) { m_shell = shell; }
void set_gecos(char const* gecos) { m_gecos = gecos; }
void set_shell(StringView shell) { m_shell = shell; }
void set_gecos(StringView gecos) { m_gecos = gecos; }
void delete_password();
// A null password means that this account was missing from /etc/shadow.