summaryrefslogtreecommitdiffstats
path: root/src/hci/commands
diff options
context:
space:
mode:
authorSimon Rettberg2019-04-01 19:04:13 +0200
committerSimon Rettberg2019-04-01 19:04:13 +0200
commitf54118cd68329e1482c59734b665e6e66852b60a (patch)
treecbda226e15137138d39c2c0f9567e2cd5063fa2d /src/hci/commands
parentMerge branch 'master' into openslx (diff)
downloadipxe-f54118cd68329e1482c59734b665e6e66852b60a.tar.gz
ipxe-f54118cd68329e1482c59734b665e6e66852b60a.tar.xz
ipxe-f54118cd68329e1482c59734b665e6e66852b60a.zip
[login] Add "--nouser" option to just ask for password
Diffstat (limited to 'src/hci/commands')
-rw-r--r--src/hci/commands/login_cmd.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/hci/commands/login_cmd.c b/src/hci/commands/login_cmd.c
index c9e196437..6ed76c6f2 100644
--- a/src/hci/commands/login_cmd.c
+++ b/src/hci/commands/login_cmd.c
@@ -23,6 +23,7 @@
#include <string.h>
#include <stdio.h>
+#include <getopt.h>
#include <ipxe/command.h>
#include <ipxe/parseopt.h>
#include <ipxe/login_ui.h>
@@ -36,10 +37,16 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
*/
/** "login" options */
-struct login_options {};
+struct login_options {
+ /** No Username */
+ int nouser;
+};
/** "login" option list */
-static struct option_descriptor login_opts[] = {};
+static struct option_descriptor login_opts[] = {
+ OPTION_DESC ( "nouser", 'n', no_argument,
+ struct login_options, nouser, parse_flag ),
+};
/** "login" command descriptor */
static struct command_descriptor login_cmd =
@@ -61,7 +68,7 @@ static int login_exec ( int argc, char **argv ) {
return rc;
/* Show login UI */
- if ( ( rc = login_ui() ) != 0 ) {
+ if ( ( rc = login_ui( opts.nouser ) ) != 0 ) {
printf ( "Could not set credentials: %s\n",
strerror ( rc ) );
return rc;