summaryrefslogtreecommitdiff
path: root/Userland/Utilities
diff options
context:
space:
mode:
authorJelle Raaijmakers <jelle@gmta.nl>2022-12-19 00:23:47 +0100
committerAndreas Kling <kling@serenityos.org>2022-12-20 10:34:19 +0100
commit25f2e4981c1236f69776c290fba7472ec7714869 (patch)
treebf46d80f5e93fe9590dc990082751c7b320fc9dd /Userland/Utilities
parent99c1b634fc80c922ca4867e4eac83b73e4c28304 (diff)
downloadserenity-25f2e4981c1236f69776c290fba7472ec7714869.zip
AK: Stop using `DeprecatedString` in Base64 encoding
Diffstat (limited to 'Userland/Utilities')
-rw-r--r--Userland/Utilities/useradd.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Utilities/useradd.cpp b/Userland/Utilities/useradd.cpp
index 146d2c598f..f84e4c19ea 100644
--- a/Userland/Utilities/useradd.cpp
+++ b/Userland/Utilities/useradd.cpp
@@ -134,18 +134,18 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
}
}
- auto get_salt = []() {
+ auto get_salt = []() -> ErrorOr<DeprecatedString> {
char random_data[12];
fill_with_random(random_data, sizeof(random_data));
StringBuilder builder;
builder.append("$5$"sv);
- builder.append(encode_base64(ReadonlyBytes(random_data, sizeof(random_data))));
+ builder.append(TRY(encode_base64({ random_data, sizeof(random_data) })));
return builder.build();
};
- char* hash = crypt(password.characters(), get_salt().characters());
+ char* hash = crypt(password.characters(), TRY(get_salt()).characters());
struct passwd p;
p.pw_name = const_cast<char*>(username.characters());