summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libutil/login.conf.54
-rw-r--r--usr.bin/login/login.c11
2 files changed, 12 insertions, 3 deletions
diff --git a/lib/libutil/login.conf.5 b/lib/libutil/login.conf.5
index 5a5a1db..dba8c4a 100644
--- a/lib/libutil/login.conf.5
+++ b/lib/libutil/login.conf.5
@@ -203,7 +203,11 @@ ensure octal interpretation.
.Sh AUTHENTICATION
.Bl -column minpasswordlen indent indent
.It Sy "Name Type Notes Description
+.It "login_prompt string The login prompt given by
+.Xr login 1
.It "minpasswordlen number 6 The minimum length a local password may be.
+.It "passwd_prompt string The password prompt presented by
+.Xr login 1
.It "passwd_format string md5 The encryption format that new or
changed passwords will use.
Valid values include "des", "md5" and "blf".
diff --git a/usr.bin/login/login.c b/usr.bin/login/login.c
index fb7cff2..877235b 100644
--- a/usr.bin/login/login.c
+++ b/usr.bin/login/login.c
@@ -129,6 +129,8 @@ static void usage __P((void));
#define TTYGRPNAME "tty" /* name of group to own ttys */
#define DEFAULT_BACKOFF 3
#define DEFAULT_RETRIES 10
+#define DEFAULT_PROMPT "login: "
+#define DEFAULT_PASSWD_PROMPT "Password:"
/*
* This bounds the time given to login. Not a define so it can
@@ -141,7 +143,7 @@ jmp_buf timeout_buf;
struct passwd *pwd;
int failures;
-char *term, *envinit[1], *hostname, *username, *tty;
+char *term, *envinit[1], *hostname, *passwd_prompt, *prompt, *tty, *username;
char full_hostname[MAXHOSTNAMELEN];
int
@@ -271,6 +273,9 @@ main(argc, argv)
* Get "login-retries" & "login-backoff" from default class
*/
lc = login_getclass(NULL);
+ prompt = login_getcapstr(lc, "prompt", DEFAULT_PROMPT, DEFAULT_PROMPT);
+ passwd_prompt = login_getcapstr(lc, "passwd_prompt",
+ DEFAULT_PASSWD_PROMPT, DEFAULT_PASSWD_PROMPT);
retries = login_getcapnum(lc, "login-retries", DEFAULT_RETRIES, DEFAULT_RETRIES);
backoff = login_getcapnum(lc, "login-backoff", DEFAULT_BACKOFF, DEFAULT_BACKOFF);
login_close(lc);
@@ -706,7 +711,7 @@ auth_traditional()
rval = 1;
salt = pwd != NULL ? pwd->pw_passwd : "xx";
- p = getpass("Password:");
+ p = getpass(passwd_prompt);
ep = crypt(p, salt);
if (pwd) {
@@ -884,7 +889,7 @@ getloginname()
static char nbuf[NBUFSIZ];
for (;;) {
- (void)printf("login: ");
+ (void)printf(prompt);
for (p = nbuf; (ch = getchar()) != '\n'; ) {
if (ch == EOF) {
badlogin(username);
OpenPOWER on IntegriCloud