summaryrefslogtreecommitdiff
path: root/Userland/Utilities/useradd.cpp
AgeCommit message (Collapse)Author
2023-04-22Utilities: Replace ctype.h usage with AK/CharacterTypes.hSam Atkins
2023-04-03AK+Everywhere: Change AK::fill_with_random to accept a Bytes objectTimothy Flynn
Rather than the very C-like API we currently have, accepting a void* and a length, let's take a Bytes object instead. In almost all existing cases, the compiler figures out the length.
2023-03-01LibCore+Everywhere: Remove ArgsParser::add*(char const*&)Ali Mohammad Pur
This is not guaranteed to always work correctly as ArgsParser deals in StringViews and might have a non-properly-null-terminated string as a value. As a bonus, using StringView (and DeprecatedString where necessary) leads to nicer looking code too :^)
2023-02-25LibCore+Utilities: Replace uses of strpbrk with find_any_of()Andrew Kaster
We don't need to use scary C string POSIX APIs when we have nicer ones on String/DeprecatedString.
2023-01-27AK: Remove StringBuilder::build() in favor of to_deprecated_string()Linus Groh
Having an alias function that only wraps another one is silly, and keeping the more obvious name should flush out more uses of deprecated strings. No behavior change.
2022-12-20AK: Stop using `DeprecatedString` in Base64 encodingJelle Raaijmakers
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
2022-07-12Everywhere: Add sv suffix to strings relying on StringView(char const*)sin-ack
Each of these strings would previously rely on StringView's char const* constructor overload, which would call __builtin_strlen on the string. Since we now have operator ""sv, we can replace these with much simpler versions. This opens the door to being able to remove StringView(char const*). No functional changes.
2022-07-12Userland: Convert command line arguments to String/StringViewsin-ack
StringView was used where possible. Some utilities still use libc functions which expect null-terminated strings, so String objects were used there instead.
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-02-28useradd: Port to LibMainTheOddGarlic
2021-06-09Utilities: Do not allow creating users with existing usernamesbrapru
Previously useradd would not check if a username already existed on the system, and would instead add the user anyway and just increment the uid. useradd should instead return an error when the user attempts to create already existing users.
2021-06-01Userland: Replace most printf-style APIs with AK::Format APIs :^)Linus Groh
2021-05-30Utilities: Update useradd to use /etc/shadowbrapru
This updates useradd to write the spwd struct entry into the /etc/shadow file via putspent. Fixes #4884
2021-05-30Utilities: Change default shell of useradd to /bin/shbrapru
2021-05-15Everywhere: Add a blank line after copyright header where missingLinus Groh
2021-05-14LibC: Do not include errno.h inside unistd.hJean-Baptiste Boric
POSIX does not mandate this, therefore let's not do it.
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-21useradd: Convert String::format() => String::formatted()Andreas Kling
Also make more use of warnln().
2021-01-12Userland: Move command-line utilities to Userland/Utilities/Andreas Kling