diff options
author | peter <peter@FreeBSD.org> | 1996-08-13 07:51:45 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1996-08-13 07:51:45 +0000 |
commit | 027cdb6a44811bd1249b20a80b2010bc5ff7241c (patch) | |
tree | 9020c2a42d48c6eb0887470e7bcd2542614ac4f1 /libexec/telnetd | |
parent | 2fd72b710bcf420566da0676b379ed29581a1898 (diff) | |
download | FreeBSD-src-027cdb6a44811bd1249b20a80b2010bc5ff7241c.zip FreeBSD-src-027cdb6a44811bd1249b20a80b2010bc5ff7241c.tar.gz |
Add a ``-P altlogin'' option which allows the sysadmin to specify an
alternate login(1) type program to run.
Diffstat (limited to 'libexec/telnetd')
-rw-r--r-- | libexec/telnetd/sys_term.c | 12 | ||||
-rw-r--r-- | libexec/telnetd/telnetd.8 | 6 | ||||
-rw-r--r-- | libexec/telnetd/telnetd.c | 7 |
3 files changed, 21 insertions, 4 deletions
diff --git a/libexec/telnetd/sys_term.c b/libexec/telnetd/sys_term.c index 40610c2..77a9b7e 100644 --- a/libexec/telnetd/sys_term.c +++ b/libexec/telnetd/sys_term.c @@ -42,6 +42,8 @@ static char sccsid[] = "@(#)sys_term.c 8.2 (Berkeley) 12/15/93"; #include <libtelnet/auth.h> #endif +extern char *altlogin; + #if defined(CRAY) || defined(__hpux) # define PARENT_DOES_UTMP #endif @@ -1728,10 +1730,14 @@ start_login(host, autologin, name) close(pty); #endif closelog(); - execv(_PATH_LOGIN, argv); - syslog(LOG_ERR, "%s: %m\n", _PATH_LOGIN); - fatalperror(net, _PATH_LOGIN); + if (altlogin == NULL) { + altlogin = _PATH_LOGIN; + } + execv(altlogin, argv); + + syslog(LOG_ERR, "%s: %m\n", altlogin); + fatalperror(net, altlogin); /*NOTREACHED*/ } diff --git a/libexec/telnetd/telnetd.8 b/libexec/telnetd/telnetd.8 index fee5526..d63c4c5 100644 --- a/libexec/telnetd/telnetd.8 +++ b/libexec/telnetd/telnetd.8 @@ -48,6 +48,7 @@ protocol server .Op Fl X Ar authtype .Op Fl a Ar authmode .Op Fl edebug +.Op Fl P Ar loginprog .Op Fl r Ns Ar lowpty-highpty .Op Fl u Ar len .Op Fl debug Op Ar port @@ -187,6 +188,11 @@ If has been compiled with support for data encryption, then the .Fl edebug option may be used to enable encryption debugging code. +.It Fl P Ar loginprog +Specifies an alternate +.Xr login 1 +command to run to complete the login. The alternate command must +understand the same command arguments as the standard login. .It Fl h Disables the printing of host-specific information before login has been completed. diff --git a/libexec/telnetd/telnetd.c b/libexec/telnetd/telnetd.c index b83b6a0..e131cae 100644 --- a/libexec/telnetd/telnetd.c +++ b/libexec/telnetd/telnetd.c @@ -124,6 +124,7 @@ int lowpty = 0, highpty; /* low, high pty numbers */ int debug = 0; int keepalive = 1; char *progname; +char *altlogin; extern void usage P((void)); @@ -133,7 +134,7 @@ extern void usage P((void)); * passed off to getopt(). */ char valid_opts[] = { - 'd', ':', 'h', 'k', 'n', 'S', ':', 'u', ':', 'U', + 'd', ':', 'h', 'k', 'n', 'p', ':', 'S', ':', 'u', ':', 'U', #ifdef AUTHENTICATION 'a', ':', 'X', ':', #endif @@ -284,6 +285,10 @@ main(argc, argv) keepalive = 0; break; + case 'p': + altlogin = optarg; + break; + #ifdef CRAY case 'r': { |