summaryrefslogtreecommitdiffstats
path: root/src/appl/bsd/krsh.c
Commit message (Collapse)AuthorAgeFilesLines
* Unbundle applications into separate repositoryGreg Hudson2009-11-221-595/+0
| | | | | | | | | | | | | | | Remove libpty, gssftp, telnet, and the bsd applications from the source tree, build system, and tests. Docs still need to be updated to remove mentions of the applications. The build system should be simplified now that we're down to one configure script and don't need some of the functionality currently in aclocal.m4. ticket: 6583 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23305 dc483132-0cff-0310-8789-dd5450dbe970
* make mark-cstyleTom Yu2009-10-311-15/+15
| | | | | | make reindent git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23100 dc483132-0cff-0310-8789-dd5450dbe970
* Remove krb4 support in the applications. login's ability to run aklogGreg Hudson2008-12-151-36/+0
| | | | | | | | | | | | has been preserved and made unconditional on krb4 support, since aklog can now do krb5 auth. The config variable is now named krb_run_aklog (as it was sometimes documented), not krb4_run_aklog as it previously was. ticket: 6303 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21450 dc483132-0cff-0310-8789-dd5450dbe970
* Fix a krsh bug introduced in r21001 which could cause garbage at theGreg Hudson2008-11-101-0/+1
| | | | | | | | | beginning of the command string. ticket: 6200 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21065 dc483132-0cff-0310-8789-dd5450dbe970
* Convert many uses of strcpy/strcat (and sometimes sprintf) to acceptedGreg Hudson2008-11-051-10/+6
| | | | | | | | | string-handling functions. ticket: 6200 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21001 dc483132-0cff-0310-8789-dd5450dbe970
* Use strdup in place of malloc/strcpy in many placesGreg Hudson2008-10-201-2/+1
| | | | | | | ticket: 6200 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20898 dc483132-0cff-0310-8789-dd5450dbe970
* Pass in the correct value for the first argument of select (one largerRuss Allbery2006-06-191-2/+2
| | | | | | | | | | | | | | than the largest file number in the select set) rather than some multiple of sizeof some struct. The latter is large enough accidentally work, but breaks on AIX. Map IPv4-mapped IPv6 addresses back to IPv4 in krshd for the purposes of connecting back to the remote system on AIX, since on AIX getnameinfo returns such addresses but connect won't accept them. Ticket: 3122 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18166 dc483132-0cff-0310-8789-dd5450dbe970
* (main): Invoke krb5_free_context at exit to allowEzra Peisach2004-05-241-1/+7
| | | | | | checking for memory leaks. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16353 dc483132-0cff-0310-8789-dd5450dbe970
* Rename the local_subkey and remote_subkey fields in the auth_contextTom Yu2003-05-101-2/+2
| | | | | | | | | | | | | | | | | to send_subkey and recv_subkey, respectively. Add new APIs to query and set these fields. Change the behavior of mk_req_ext, rd_req_dec, and rd_rep to set both subkeys. Applications wanting to set unidirectional subkeys may still do so by saving the values of subkeys and doing overrides. Cause mk_cred, mk_priv, and mk_safe to never use the recv_subkey. Cause rd_cred, rd_priv, and rd_safe to never use the send_subkey. ticket: 1415 status: open tags: pullup target_version: 1.3 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15407 dc483132-0cff-0310-8789-dd5450dbe970
* * krsh.c (SECURE_MESSAGE): Only indicate that input/output data are beingKen Raeburn2002-06-251-1/+1
| | | | | | encrypted, and don't automatically say it's with DES. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14568 dc483132-0cff-0310-8789-dd5450dbe970
* * krcp.c, krlogin.c, krlogind.c, krsh.c, krshd.c, login.c,Ezra Peisach2001-12-061-3/+3
| | | | | | | | | | | | | | setenv.c, v4rcp.c: Signed v.s unsigned int cleanup. * defines.h: rcmd_stream_{read,write} take size_t as length argument. * kcmd.c: Use GETSOCKNAME_ARG3_TYPE instead of assuming int. input and output handler take size_t as length argument instead of int. Other signed vs. unsigned fixes. * configure.in: Add KRB5_GETSOCKNAME_ARGS. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14050 dc483132-0cff-0310-8789-dd5450dbe970
* * Makefile.in: Link krshd with KRSHDLIBS instead of LOGINLIBSEzra Peisach2001-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.in: Creare a new variable KRSHDLIBS which differs from LOGINLIBS by not including libkrb524.a. Test for getenv. * krcp.c: Prototype lostconn(). * krlogind.c: Provide prototype for signal handler cleanup. Implied need to add extra argument to function - ensure consistant calling. * krsh.c: Provide prototype for signal handler sendsig. * krshd.c: Rewrite error() to use stdargs/varargs. (doit): When creating a tty name using getpid. Ensure that does not overflow tty string buffer. * login.c: Provide prototype for signal handler timedout. * setenv.c: Do not define getenv() unless needed. * v4rcp.c: Rewrite error() to use stdargs/varargs. Add signal number argument to lostconn(), include prototype, and ensure called consistantly. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13567 dc483132-0cff-0310-8789-dd5450dbe970
* * login.c: Add braces around initializers. Cleanup assignments inEzra Peisach2001-06-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | conditionals. Include krb524.h if KRB4_CONVERT defined. * krlogind.c (main): Cleanup unused variables. (protocol): Cleanup ambiguous if-if-else warning. * krshd.c (main): Cleanup unused variables. * krlogin.c (setsignal): Declare as void. (server_message): Cleanup unused variables. * setenv.c (setenv): Declare as returning int and clean up assignments in conditionals. * kcmd.c (kcmd, rcmd_stream_init_krb5, v5_des_read): Clean up unused variables and assignments in conditionals. * forward.c (rd_and_store_for_creds): Likewise. * krcp.c (rsource): Likewise. * v4rcp.c (answer_auth): Likewise. * krsh.c (main): Declare as retuning int. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13257 dc483132-0cff-0310-8789-dd5450dbe970
* * defines.h: Add prototypes for rcmd_stream_init_normal(),Ezra Peisach2001-03-121-2/+2
| | | | | | | | | | | | | | rcmd_stream_init_krb4(), strsave() and rd_and_store_for_creds() * Makefile.in: Add dependency of forward.o on defines.h * forward.c: Include defines.h for prototypes. * kcmd.c, krcp.c, krlogin.c, krlogind.c, krsh.c: Provide full prototype for local functions and move include of kerberosIV/krb.h before defines.h. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13077 dc483132-0cff-0310-8789-dd5450dbe970
* 1.2-beta4 pullupKen Raeburn2000-06-301-13/+44
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12470 dc483132-0cff-0310-8789-dd5450dbe970
* Temporary patch for krb5-appl/678; avoid data from stdout being mixed to stderrSam Hartman1998-12-271-2/+2
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11095 dc483132-0cff-0310-8789-dd5450dbe970
* * kcmd.c: Integrate ghudson's changes for client-side krb4Tom Yu1998-02-241-147/+55
| | | | | | | | | | | | | | | | | | | | | compatibility. [krb5-appl/483] * krcp.c: Integrate ghudson's changes for client-side krb4 compatibility. [krb5-appl/483] * krlogin.c: Integrate ghudson's changes for client-side krb4 compatibility. [krb5-appl/483] * krlogind.c: Integrate ghudson's changes for client-side krb4 compatibility. [krb5-appl/483] * krsh.c: Integrate ghudson's changes for client-side krb4 compatibility. [krb5-appl/483] * krshd.c: Integrate ghudson's changes for client-side krb4 compatibility. [krb5-appl/483] git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10472 dc483132-0cff-0310-8789-dd5450dbe970
* login.c (destroy_tickets): Just use global kcontext insteadTheodore Tso1996-11-071-2/+5
| | | | | | | | | | | | | of creating a new krb5 context for no good reason. krshd.c (main): krsh.c (main): krlogind.c (main): krlogin.c (main): krcp.c(main): Check the error return from krb5_init_context(), and print an error message if necessary. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9317 dc483132-0cff-0310-8789-dd5450dbe970
* * krsh.c, krlogin.c: don't print our own error message if kcmdBarry Jaspan1996-10-181-4/+5
| | | | | | | returns -1 (it always printed something in that case, and error_message(-1) prints a mess [krb5-appl/70] git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9211 dc483132-0cff-0310-8789-dd5450dbe970
* Fix typo so that krsh doesn't exit when using the default portTheodore Tso1996-06-241-1/+1
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@8545 dc483132-0cff-0310-8789-dd5450dbe970
* Merge with Cygnus sources, changes from Mark Eichin, Marc Horowitz, ChrisKen Raeburn1996-05-011-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provenzano and me: * Makefile.in (install): Install correct set of man pages, and check for failures. * kshd.M, klogind.M: Renamed from kr*.M versions. * login.M: New file. Man page for login with some description of new features. * rlogin.M: Remove references to using program with target hostname as argv[0]. * rsh.M: Ditto. Also document -f, -F, -x options. * login.c: Massive changes. Split much functionality out of main and into separate file sections: terminal flag settings, Kerberos 4 and 5 support, UNIX password support, mail check, signal handler handling, some other support routines. Revamp controlling tty and process group handling. For AFS configuration, use setpag and run aklog. Try validating password using krb5. Always set tty flags, not just for rlogin session. When validating tickets, treat an existing key file that doesn't contain the key we think we want (possibly because DNS was spoofed) as an error condition. * Makefile.in (LOGINLIBS): List libkrb524.a here. (LIBOBJS): Not here. (login.krb5): Reverse the order of LIBOBJS and LOGINLIBS. * configure.in: Check for --with-afs. Add AFS libs and define SETPAG if supplied. * login.c (KRB5_GET_TICKETS, KRB4_GET_TICKETS, KRB_RUN_AKLOG): new macros selecting single signon options. krb5.conf profile support for control over authentication options, above the compile time selection. (conf_affirmative): new function, recognize yes/no in profile value. (login_get_kconf): new function, look for all [login] flags and set them in appropriate globals (via login_conf_set array.) (main, sleepexit, destroy_tickets): Check the new login_* flags. (main): rename KRB4_USE_524 to KRB4_CONVERT. * configure.in: Added checks for tcsetpgrp, tcgetpgrp, setpgid. * krlogind.c (control): Use tcgetpgrp if it's available. * loginpaths.h (RPATH, LPATH, LPATH_root): Define HP/UX 9.04 versions, conditionalized on __hpux and !hpux. * login.c and configure.in: instead of checking _IBMR2 and __sgi__, write configure tests to check for the existence of /etc/environment and /etc/TIMEZONE files, respectively. * forward.c (rd_and_store_for_creds) : If chown fails then only pass failure back if owner is different than intended owner. This is to make rsh.exp test work without requiring root privlidges. * login.c (main): Don't set TERM to an empty value. (stypeof) [__hpux]: Return null if unknown. * krlogin.c (catchild): remove hp/ux kludge because of aclocal.m4 fix. (speeds): test __hpux for hpux speed list. (main): test __hpux for use of FIOSSAIOSTAT and FIOSSAIOOWN (USE_TERMIO): test __hpux for bsdtty/ptyio headers. * krlogind.c: test __hpux for bsdtty/ptyio headers. (doit): test __hpux for use of setpgrp2. * krcp.c (main): test __hpux as well for remsh vs. rsh. * krcp.c (des_write): Make sure the buffer for the encrypted data is large enough. Only return an error in malloc fails. * krsh.c (main): Always turn on anyport -A option. * krlogind.c (ptsname): Declare if it's going to be used. * krshd.c (main): Use basename of argv[0] for progname. * login.c (dofork): On linux, TIOCNOTTY causes us to die on a SIGHUP, so don't even try it. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7881 dc483132-0cff-0310-8789-dd5450dbe970
* Fix the server side of the krlogin bug detecting eof in connection closeSam Hartman1996-02-261-2/+2
| | | | | | Also, import the ops changes to do with enable-athena. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7545 dc483132-0cff-0310-8789-dd5450dbe970
* Only display secure_message if encryption actually enabledSam Hartman1996-02-101-1/+2
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7467 dc483132-0cff-0310-8789-dd5450dbe970
* * rcp (client mode) now uses rsh -x but still supports the old encryption inSam Hartman1996-02-011-0/+7
| | | | | | | | | | | | | server mode. * krshd will work in encrypting mode even when the port for stderr is null. * rcp will work if stdin isn't not a socket, but is a pipe in remote mode * krshd destroys forwarded credentials properly * For rsh, the secure_message got moved to the client; if you use a new client with an old server, you get secure_message twice, but it should be a useful change long-term. * Fixed typo in rcp man page. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7423 dc483132-0cff-0310-8789-dd5450dbe970
* * krsh.c, krlogin.c: (main): Ultrix cc does not support automaticEzra Peisach1996-01-111-2/+3
| | | | | | aggregate initiailzation of structures. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7309 dc483132-0cff-0310-8789-dd5450dbe970
* kcmd.c (getport): Clear the sin structure to be zero. (From Doug Engbert.)Theodore Tso1996-01-111-2/+3
| | | | | | | | | | | | | | | krsh.c (main): Added code to default port to 544 if service not found. (From Doug Engbert.) krlogin.c (main): Added code to default port to 543 or 2105 if service not found. (From Doug Engbert.) login.c (main): Save KRB5CCNAME environment variable, which may have been set by forward.c. Add code for SGI to set environment for its /etc/TIMEZONE (untested). Don't print MOTD twice on Suns, added #ifdef NO_MOTD. (Patches from Doug Engbert). git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7295 dc483132-0cff-0310-8789-dd5450dbe970
* If invoked with the -D port option, do not die if proper entry is missingEzra Peisach1995-11-021-10/+13
| | | | | | | | | from /etc/services... This is for the dejagnu suite running on a machine following the installation instructions - i.e. make, make check. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7010 dc483132-0cff-0310-8789-dd5450dbe970
* * kdb5_stash.c : s/keytype/enctype/g, s/KEYTYPE/ENCTYPE/gChris Provenzano1995-09-061-1/+1
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6699 dc483132-0cff-0310-8789-dd5450dbe970
* Compiler warning cleanupPaul Park1995-06-271-10/+10
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6171 dc483132-0cff-0310-8789-dd5450dbe970
* configure.in: Change AC_HAVE_HEADERS with AC_CHECK_HEADERS, and check forTheodore Tso1995-06-221-2/+8
| | | | | | | | | | string.h as well. krsh.c: Don't include ext-proto.h; move the #include of the header files which we actually needed into krsh.c, using the autoconf standard define's. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6125 dc483132-0cff-0310-8789-dd5450dbe970
* * forward.c (rd_and_store_for_creds()) : Rewritten to useChris Provenzano1995-04-261-0/+1
| | | | | | | | | | | | | | | auth_context and the new krb5_rd_creds(). * forward.c (get_for_creds()) : New function replacing krb5_get_for_creds() and uses auth_context and new krb5_mk_creds() routine. * kcmd.c (kcmd()): Use new get_for_creds() routine. * krlogind.c (recvauth()): Use new rd_and_store_for_creds() routine. * configure.in, krlogind.c, krsh.c, krshd.c, login.c, logutil.c. A bunch of patches from Ezra to get BSD to work on The Alpha that looked reasonable. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5484 dc483132-0cff-0310-8789-dd5450dbe970
* Fri Apr 21 14:07:15 1995 Mark Eichin <eichin@cygnus.com>Mark Eichin1995-04-211-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Added Ian's changes with minor tweaks. These are used by the testsuite. > Thu Mar 23 18:18:31 1995 Ian Lance Taylor <ian@cygnus.com> * krshd.c (ARGSTR): Add S:M:A to KERBEROS version. (srvtab): New global variable. (krb5_override_default_realm): Declare. (main): Handle -S, -M and -A arguments. Call SO_REUSEADDR on socket if debug_port set. (doit): If -A used, allocate a random port for the stderr stream, rather than allocating a reserved port. Don't call initgroups if not changing the uid. (recvauth): Pass srvtab to krb5_compat_recvauth. * krshd.M: Document -S, -M, and -A. * krsh.c (main): Accept -A, and pass it to kcmd. * rsh.M: Document -A. * kcmd.c (kcmd): Add new argument anyport. If it is set, permit any port for the stderr stream, rather than requiring a reserved port. Initialize ret_cred to NULL. * krcp.c (main): Pass 0 for anyport to kcmd. * krlogin.c (main): Pass 0 for anyport to kcmd. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5428 dc483132-0cff-0310-8789-dd5450dbe970
* * forward.c, kcmd.c, krcp.c, krlogin.c, krlogind.c, krsh.c,John Gilmore1995-02-281-5/+2
| | | | | | krshd.c: Avoid <krb5/...> and <com_err.h> includes. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5020 dc483132-0cff-0310-8789-dd5450dbe970
* * Removed all #include <krb5/crc-32.h>Chris Provenzano1995-02-021-1/+0
| | | | | | * Removed krb5_enctype argument passed to krb5_get_for_creds() git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4871 dc483132-0cff-0310-8789-dd5450dbe970
* Removed all references to DECLARG and OLDDECLARG.Chris Provenzano1995-01-131-9/+11
| | | | | | | | Added krb5_context to all krb5_*() routines. Fixed krlogin to use htons(debug_port). git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4814 dc483132-0cff-0310-8789-dd5450dbe970
* * krsh.c: Include sys/time.h (linux)Richard Basch1995-01-101-0/+1
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4801 dc483132-0cff-0310-8789-dd5450dbe970
* Removed a debugging statement (which could compromise the eblock)Richard Basch1995-01-031-1/+0
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4793 dc483132-0cff-0310-8789-dd5450dbe970
* * krsh.cRichard Basch1995-01-031-25/+163
| | | | | | | | | * krshd.c Added encrypted rsh support. It still isn't entirely secure; as the command-line could be spoofed by an active attack, but the data sharing is... git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4790 dc483132-0cff-0310-8789-dd5450dbe970
* * krlogin.cRichard Basch1994-12-281-12/+22
| | | | | | | | | | * krlogind.c * krsh.c * krshd.c Corrected the arguments to select, based on sizeof fd_set. Converted what remained to use FD_* macros, instead of bitshift git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4777 dc483132-0cff-0310-8789-dd5450dbe970
* Removed the hard-coded paths for the BSD rlogin/rcp/rsh programs.Richard Basch1994-12-261-0/+2
| | | | | | Let "configure" find the programs for us... git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4752 dc483132-0cff-0310-8789-dd5450dbe970
* Removed the hard-coded paths for the BSD rlogin/rcp/rsh programs.Richard Basch1994-12-261-1/+4
| | | | | | Let "configure" find the programs for us... git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4751 dc483132-0cff-0310-8789-dd5450dbe970
* Checked in Richard's changes of November 2nd. (See changelog). Lots ofTheodore Tso1994-11-081-2/+18
| | | | | | portability fixes: POSIX_SIGNALS, POSIX_SETJMP, use of POSIX waitpid, etc. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4632 dc483132-0cff-0310-8789-dd5450dbe970
* Check for both EAGAIN in addition to EWOULDBLOCKTheodore Tso1994-10-261-4/+4
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4575 dc483132-0cff-0310-8789-dd5450dbe970
* stamp out rcs keywordsMark Eichin1994-08-181-3/+1
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4188 dc483132-0cff-0310-8789-dd5450dbe970
* lintMark Eichin1994-08-141-1/+4
| | | | | | | | | fix LOGIN_PROGRAM (from net) get rid of getpw* misdeclarations make default args char* instead of int fix error message pointer git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4127 dc483132-0cff-0310-8789-dd5450dbe970
* punt getpwuid misdeclarationMark Eichin1994-08-111-5/+0
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4124 dc483132-0cff-0310-8789-dd5450dbe970
* rest of signal cleanups plus strsaveMark Eichin1994-08-051-0/+18
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4053 dc483132-0cff-0310-8789-dd5450dbe970
* almost there. safety checkinMark Eichin1994-08-041-15/+25
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4050 dc483132-0cff-0310-8789-dd5450dbe970
* * configure.in: Added tests for HAVE_SETOWN, HAVE_SYS_FILIO_H.Mark Eichin1994-07-261-0/+5
| | | | | | | | * krlogin.c, krsh.c, krshd.c, krlogin.c, krlogind.c: use them. Still doesn't build on Solaris, but it's a start. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4014 dc483132-0cff-0310-8789-dd5450dbe970
* index->strchr, rindex->strrchr, add (char *) cast to malloc, haveTheodore Tso1994-07-161-5/+5
| | | | | | proper include for the string functions. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@3990 dc483132-0cff-0310-8789-dd5450dbe970