From: Mark Eichin Date: Fri, 21 Apr 1995 21:20:47 +0000 (+0000) Subject: rlogin testing changes from ian@cygnus.com X-Git-Tag: krb5-1.0-beta5~316 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=845b6e5875db232e35e18d81ed8af1c209621a41;p=krb5.git rlogin testing changes from ian@cygnus.com > Fri Mar 24 15:04:25 1995 Ian Lance Taylor * krlogind.c (srvtab): New global variable. (krb5_override_default_realm): Declare. (ARGSTR): Add "S:M:L:" to Kerberos version. (login_program): New global variable. (main): Handle -S, -M, and -L arguments. Call SO_REUSEADDR on socket if debug_port set. (doit): Use login_program instead of LOGIN_PROGRAM. (recvauth): Pass srvtab to krb5_compat_recvauth. * krlogind.M: Document -S, -M, and -L. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5430 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog index 68c974658..967ccdf66 100644 --- a/src/appl/bsd/ChangeLog +++ b/src/appl/bsd/ChangeLog @@ -1,3 +1,19 @@ +Fri Apr 21 17:18:57 1995 Mark Eichin + + rlogin testing changes from ian@cygnus.com. + +> Fri Mar 24 15:04:25 1995 Ian Lance Taylor + + * krlogind.c (srvtab): New global variable. + (krb5_override_default_realm): Declare. + (ARGSTR): Add "S:M:L:" to Kerberos version. + (login_program): New global variable. + (main): Handle -S, -M, and -L arguments. Call SO_REUSEADDR on + socket if debug_port set. + (doit): Use login_program instead of LOGIN_PROGRAM. + (recvauth): Pass srvtab to krb5_compat_recvauth. + * krlogind.M: Document -S, -M, and -L. + Fri Apr 21 17:13:48 1995 Mark Eichin More changes from ian@cygnus.com to support testing. diff --git a/src/appl/bsd/krlogind.M b/src/appl/bsd/krlogind.M index 9d6916c5d..6052ea79c 100644 --- a/src/appl/bsd/krlogind.M +++ b/src/appl/bsd/krlogind.M @@ -94,6 +94,21 @@ as found in the environment variable, ``TERM''; see .IR environ (7). The screen or window size of the terminal is requested from the client, and window size changes from the client are propagated to the pseudo terminal. +.PP +.I Krlogind +supports three options which are used for testing purposes: + +.IP \fB\-S\ srvtab\fP 10 +Set the \fIsrvtab\fP file to use. + +.IP \fB\-M\ realm\fP +Set the Kerberos realm to use. + +.IP \fB\-L\ login\fP +Set the login program to use. This option only has an effect if +DO_NOT_USE_K_LOGIN was not defined when +.I krlogind +was compiled. .SH DIAGNOSTICS All diagnostic messages are returned on the connection associated with the diff --git a/src/appl/bsd/krlogind.c b/src/appl/bsd/krlogind.c index d64e2addd..cfeecd68b 100644 --- a/src/appl/bsd/krlogind.c +++ b/src/appl/bsd/krlogind.c @@ -245,7 +245,10 @@ krb5_authenticator *kdata; krb5_ticket *ticket = 0; krb5_context bsd_context; -#define ARGSTR "rRkKeExXpPD:?" +char *srvtab = NULL; +extern char *krb5_override_default_realm; + +#define ARGSTR "rRkKeExXpPD:S:M:L:?" #else /* !KERBEROS */ #define ARGSTR "rRpPD:?" #define (*des_read) read @@ -264,6 +267,8 @@ krb5_context bsd_context; #endif /* DO_NOT_USE_K_LOGIN */ #endif /* LOGIN_PROGRAM */ +char *login_program = LOGIN_PROGRAM; + #define MAXRETRIES 4 #define MAX_PROG_NAME 16 @@ -383,6 +388,12 @@ main(argc, argv) do_encrypt = 1; break; #endif + case 'S': + srvtab = optarg; + break; + case 'M': + krb5_override_default_realm = optarg; + break; #endif case 'p': passwd_if_fail = 1; /* Passwd reqd if any check fails */ @@ -393,6 +404,11 @@ main(argc, argv) case 'D': debug_port = atoi(optarg); break; + case 'L': +#ifndef DO_NOT_USE_K_LOGIN + login_program = optarg; +#endif + break; case '?': default: usage(); @@ -418,6 +434,9 @@ main(argc, argv) sin.sin_port = htons(debug_port); sin.sin_addr.s_addr = INADDR_ANY; + (void) setsockopt(s, SOL_SOCKET, SO_REUSEADDR, + (char *)&on, sizeof(on)); + if ((bind(s, (struct sockaddr *) &sin, sizeof(sin))) < 0) { fprintf(stderr, "Error in bind: %s\n", strerror(errno)); exit(2); @@ -749,15 +768,15 @@ void doit(f, fromp) #endif #ifdef DO_NOT_USE_K_LOGIN - execl(LOGIN_PROGRAM, "login", "-r", rhost_name, 0); + execl(login_program, "login", "-r", rhost_name, 0); #else if (passwd_req) - execl(LOGIN_PROGRAM, "login","-h", rhost_name, lusername, 0); + execl(login_program, "login","-h", rhost_name, lusername, 0); else - execl(LOGIN_PROGRAM, "login", "-h", rhost_name, "-e", lusername, 0); + execl(login_program, "login", "-h", rhost_name, "-e", lusername, 0); #endif - fatalperror(2, LOGIN_PROGRAM); + fatalperror(2, login_program); /*NOTREACHED*/ } /* if (pid == 0) */ @@ -1535,7 +1554,7 @@ recvauth() server, /* Specify daemon principal */ 0, /* default rc_type */ 0, /* no flags */ - NULL, /* default keytab */ + srvtab, /* normally NULL to use v5srvtab */ do_encrypt ? KOPT_DO_MUTUAL : 0, /*v4_opts*/ "rcmd", /* v4_service */