From owner-freebsd-current Wed May 16 16:54: 8 2001 Delivered-To: freebsd-current@freebsd.org Received: from smtp03.primenet.com (smtp03.primenet.com [206.165.6.133]) by hub.freebsd.org (Postfix) with ESMTP id 5E70637B422 for ; Wed, 16 May 2001 16:54:05 -0700 (PDT) (envelope-from tlambert@usr01.primenet.com) Received: (from daemon@localhost) by smtp03.primenet.com (8.9.3/8.9.3) id QAA22846 for ; Wed, 16 May 2001 16:54:03 -0700 (MST) Received: from usr01.primenet.com(206.165.6.201) via SMTP by smtp03.primenet.com, id smtpdAAAIpaWLS; Wed May 16 16:53:55 2001 Received: (from tlambert@localhost) by usr01.primenet.com (8.8.5/8.8.5) id QAA27838 for current@freebsd.org; Wed, 16 May 2001 16:55:27 -0700 (MST) From: Terry Lambert Message-Id: <200105162355.QAA27838@usr01.primenet.com> Subject: PATCH: /usr/src/usr.bin/login To: current@freebsd.org Date: Wed, 16 May 2001 23:54:06 +0000 (GMT) X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG This patch adds the "prompt" and "passwd_prompt" fields to the /etc/login.conf, which makes lgoin more like getty in its ability to be configured. Sorry, no documentation at this time, and no support for "%h" and other getty psecific things. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. --------------------------------- RCS file: /home/cvs/FreeBSD/src/usr.bin/login/login.c,v retrieving revision 1.51.2.5 diff -u -r1.51.2.5 login.c --- login.c 2001/02/13 13:05:20 1.51.2.5 +++ login.c 2001/05/17 00:28:57 @@ -116,6 +116,8 @@ #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 @@ -128,7 +130,7 @@ struct passwd *pwd; int failures; -char *term, *envinit[1], *hostname, *username, *tty; +char *term, *envinit[1], *hostname, *username, *tty, *prompt, passwd_prompt; char full_hostname[MAXHOSTNAMELEN]; #ifndef NO_PAM static char **environ_pam; @@ -257,6 +259,8 @@ * 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); @@ -651,7 +655,7 @@ rval = 1; salt = pwd != NULL ? pwd->pw_passwd : "xx"; - p = getpass("Password:"); + p = getpass(passwd_prompt); ep = crypt(p, salt); if (pwd) { @@ -819,7 +823,7 @@ static char nbuf[NBUFSIZ]; for (;;) { - (void)printf("login: "); + (void)printf(prompt); for (p = nbuf; (ch = getchar()) != '\n'; ) { if (ch == EOF) { badlogin(username); --------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message