mirror of
https://github.com/RGBCube/serenity
synced 2025-05-29 17:45:11 +00:00
usermod: Return error if -L
and -U
options are used simultaneously
This commit is contained in:
parent
089ff7b94e
commit
e86dd1cc89
1 changed files with 7 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2021, Brandon Pruitt <brapru@pm.me>
|
* Copyright (c) 2021, Brandon Pruitt <brapru@pm.me>
|
||||||
|
* Copyright (c) 2023, Tim Ledbetter <timledbetter@gmail.com>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
@ -50,6 +51,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
|
|
||||||
args_parser.parse(arguments);
|
args_parser.parse(arguments);
|
||||||
|
|
||||||
|
if (lock && unlock) {
|
||||||
|
warnln("The -L and -U options are mutually exclusive");
|
||||||
|
args_parser.print_usage(stderr, arguments.strings[0]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
auto account_or_error = Core::Account::from_name(username);
|
auto account_or_error = Core::Account::from_name(username);
|
||||||
|
|
||||||
if (account_or_error.is_error()) {
|
if (account_or_error.is_error()) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue