summaryrefslogtreecommitdiffstats
path: root/src/appl/bsd/krlogind.c
Commit message (Collapse)AuthorAgeFilesLines
* Unbundle applications into separate repositoryGreg Hudson2009-11-221-1430/+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-82/+82
| | | | | | make reindent git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23100 dc483132-0cff-0310-8789-dd5450dbe970
* Fix krshd and krlogind to use krb5_c_verify_checksumTom Yu2009-04-021-10/+15
| | | | | | ticket: 1624 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22159 dc483132-0cff-0310-8789-dd5450dbe970
* Remove unnecessary pointer casts in args to free,memcpy,memset,memchr except ↵Ken Raeburn2009-02-021-2/+2
| | | | | | unicode, windows code git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21875 dc483132-0cff-0310-8789-dd5450dbe970
* Remove krb4 support in the applications. login's ability to run aklogGreg Hudson2008-12-151-178/+34
| | | | | | | | | | | | 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
* Convert many uses of sprintf to snprintf or asprintfGreg Hudson2008-12-011-15/+13
| | | | | | | ticket: 6200 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21258 dc483132-0cff-0310-8789-dd5450dbe970
* Use strlcpy instead of strcpy in many placesGreg Hudson2008-10-241-1/+1
| | | | | | | ticket: 6200 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20919 dc483132-0cff-0310-8789-dd5450dbe970
* Use asprintf instead of malloc/strcpy/strcat in many placesGreg Hudson2008-10-201-6/+2
| | | | | | | ticket: 6200 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20901 dc483132-0cff-0310-8789-dd5450dbe970
* Fix test for accept failureKen Raeburn2008-08-061-1/+1
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20612 dc483132-0cff-0310-8789-dd5450dbe970
* Include k5-int.h instead of krb5.h when 'private' functions are neededKen Raeburn2007-01-201-1/+1
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19080 dc483132-0cff-0310-8789-dd5450dbe970
* Pass in the correct value for the first argument of select (one largerRuss Allbery2006-06-191-1/+1
| | | | | | | | | | | | | | 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
* * krlogind.c (doit): Change 0 to (char*)NULL in execl* calls. Patch providedKen Raeburn2005-04-061-3/+3
| | | | | | | | | | | by Michael Calmer. * krshd.c (doit): Likewise. * login.c (main): Likewise. ticket: 3000 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17165 dc483132-0cff-0310-8789-dd5450dbe970
* Rename the local_subkey and remote_subkey fields in the auth_contextTom Yu2003-05-101-1/+1
| | | | | | | | | | | | | | | | | 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
* * compat_recv.c: Only include krb.h if KRB5_KRB4_COMPAT.Ken Raeburn2003-03-051-2/+17
| | | | | | | | | | (krb_v4_recvauth, krb5_compat_recvauth, krb5_compat_recvauth_version): Define only if KRB5_KRB4_COMPAT. * krlogind.c: Include krb.h only if KRB5_KRB4_COMPAT. (v4_kdata, v4_schedule): Define only if KRB5_KRB4_COMPAT. (recvauth) [!KRB5_KRB4_COMPAT]: Skip v4 stuff and call krb5_recvauth_version. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15223 dc483132-0cff-0310-8789-dd5450dbe970
* Use socklen_t when passing address to socket functions.Ken Raeburn2003-01-101-3/+4
| | | | | | Fixes compilation warnings on AIX 4.3.3. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15105 dc483132-0cff-0310-8789-dd5450dbe970
* * krlogind.c (protocol): Initialize pbp, fbp. Change left to type size_tKen Raeburn2002-07-091-2/+3
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14623 dc483132-0cff-0310-8789-dd5450dbe970
* Move compat_recv.c from krb5util library. Move some duplicated code intoKen Raeburn2002-06-251-38/+3
| | | | | | kcmd.c. Use getnameinfo and sockaddr_storage more. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14572 dc483132-0cff-0310-8789-dd5450dbe970
* ipv6 support in krlogind.cKen Raeburn2002-06-251-18/+23
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14567 dc483132-0cff-0310-8789-dd5450dbe970
* revert accidental checkin of unfinished changesKen Raeburn2002-03-081-34/+27
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14257 dc483132-0cff-0310-8789-dd5450dbe970
* (kcmd_connect): copy out correct remote address to callerKen Raeburn2002-03-081-27/+34
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14256 dc483132-0cff-0310-8789-dd5450dbe970
* * krcp.c, krlogin.c, krlogind.c, krsh.c, krshd.c, login.c,Ezra Peisach2001-12-061-1/+1
| | | | | | | | | | | | | | 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-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* * krlogind.c: Provide daemon prototype if neededEzra Peisach2001-06-221-0/+4
| | | | | | * configure.in: Test if prototype for daemon necessary. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13496 dc483132-0cff-0310-8789-dd5450dbe970
* * login.c: Much cleanup to reduce globals and shadowingEzra Peisach2001-06-221-6/+6
| | | | | | | | | | | * krlogind.c (main): Change sin to sock_in. * krshd.c: Change sin to sock_in to not shadow global. Change some local variables to not shadow others. 2 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13487 dc483132-0cff-0310-8789-dd5450dbe970
* * configure.in (SETENVOBJ): If setenv is not present on system,Ezra Peisach2001-06-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | define NEED_SETENV as well as linking in local sources. * defines.h: Include prototype for setenv() if NEED_SETENV defined. * krlogin.c (prf): Declare as void. Used only with one argument - get rid of pseudo-varargs behaviour. * krlogind.c (recvauth): Include k5-util.h for krb5_compat_recvauth_version() prototype. Declare sendoob() void. * krshd.c: Include k5-util.h for krb5_compat_recvauth_version() prototype. * login.c: Include setenv prototype if NEED_SETENV defined. Cast arguments to printf to match format string. * v4rcp.c (source): Cast argument to sprintf() to match format string. * krcp.c (rsource): Likewise. * forward.c (rd_and_store_for_creds): Likewise. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13334 dc483132-0cff-0310-8789-dd5450dbe970
* * login.c: Add braces around initializers. Cleanup assignments inEzra Peisach2001-06-011-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* * krlogind.c (protocol): Don't do TIOCPKT on systems with STREAMSTom Yu2001-05-251-1/+2
| | | | | | | | | | ptys, even if there is a TIOCPKT, since it may result in hangs on some systems where BSD packet mode is (presumably) not implemented properly, such as AIX 4.3.3. Should get cleaned up at some later point to actually I_PUSH "pckt" or equivalent and do translation between STREAMS and BSD style packet mode. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13245 dc483132-0cff-0310-8789-dd5450dbe970
* * defines.h: Add prototypes for rcmd_stream_init_normal(),Ezra Peisach2001-03-121-9/+10
| | | | | | | | | | | | | | 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
* make pty_make_sane_hostname take sockaddr* arg instead of sockaddr_in*Ken Raeburn2000-12-061-1/+1
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12883 dc483132-0cff-0310-8789-dd5450dbe970
* * Makefile.in (DEFINES): Define HEIMDAL_FRIENDLY.Ken Raeburn2000-09-091-1/+6
| | | | | | | | * krlogind.c (recvauth): Don't complain about a subkey sent for KCMDV0.1 if HEIMDAL_FRIENDLY is defined, just quietly ignore it. * krshd.c (recvauth): Likewise. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12646 dc483132-0cff-0310-8789-dd5450dbe970
* 1.2-beta4 pullupKen Raeburn2000-06-301-30/+51
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12470 dc483132-0cff-0310-8789-dd5450dbe970
* * klogind.M: Resync manpageTom Yu1999-02-251-10/+23
| | | | | | * krlogind.c: Rework flags for hostname logging. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11220 dc483132-0cff-0310-8789-dd5450dbe970
* * klogind.M: Document things a little better, including newTom Yu1999-02-171-30/+57
| | | | | | | | | | | | | options controlling hostname manipulation. * krlogind.c: Make use of pty_make_sane_hostname() for purposes of manipulating hostname to pass to login. Also unconditionally syslog IP address and full hostname of remote host. Add command line options to control such behavior. * configure.in: Add arpa/nameser.h to CHECK_HEADERS. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11176 dc483132-0cff-0310-8789-dd5450dbe970
* pull up 3des implementation from the marc-3des branchMarc Horowitz1998-10-301-45/+130
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11001 dc483132-0cff-0310-8789-dd5450dbe970
* POSIX states that getopt returns -1 when it is done parsing options,Theodore Tso1998-05-061-1/+1
| | | | | | not EOF. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10547 dc483132-0cff-0310-8789-dd5450dbe970
* * kcmd.c: Integrate ghudson's changes for client-side krb4Tom Yu1998-02-241-377/+11
| | | | | | | | | | | | | | | | | | | | | 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
* * krlogind.c (protocol): Declare pibuf and fibuf as being BUFSIZTom Yu1998-01-211-1/+1
| | | | | | bytes long, rather than 1024. Fixes an Irix bug. [krb5-appl/527] git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10354 dc483132-0cff-0310-8789-dd5450dbe970
* * krlogind.c:Tom Yu1997-12-121-1/+7
| | | | | | | | | | * krshd.c: * login.c: * v4rcp.c: Don't include netdb.h or sys/socket.h if krb.h is included; this works around an Ultrix bug where those headers aren't protected against multiple inclusion. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10331 dc483132-0cff-0310-8789-dd5450dbe970
* * krlogind.c (recvauth): Fix args in call toTom Yu1997-11-201-1/+1
| | | | | | rd_and_store_for_creds. [krb5-appl/502] git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10301 dc483132-0cff-0310-8789-dd5450dbe970
* * krlogind.c (doit): Fix up potential buffer overrun.Tom Yu1997-11-051-1/+4
| | | | | | | | | | [krb5-appl/488] * krlogin.c (main): Fix up potential buffer overrun. * krcp.c (hosteq): Fix up potential buffer overrun. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10267 dc483132-0cff-0310-8789-dd5450dbe970
* * krlogind.c (main): Changes to allow for standalone daemonTom Yu1997-09-021-58/+107
| | | | | | | operation. Use the "-f" flag to enable. This automagically figures out which port to bind to if you don't specify it. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10189 dc483132-0cff-0310-8789-dd5450dbe970
* kcmd.c (getport): Let the OS pick the best port rather than scanning.Richard Basch1997-02-191-3/+3
| | | | | | | | | | | krlogin.c: Fixed 8bit flow control (Solaris) krlogind.c: Whitespace cleanup krshd.c: No need to set lport before calling getport(&lport) Also, changed all occurrences of krb5_xfree to use something else. [kcmd.c still needs one free() fixed when a routine exists to replace the realm component] git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9908 dc483132-0cff-0310-8789-dd5450dbe970
* Remove krb5_xfree from the public interfaceRichard Basch1997-02-181-1/+1
| | | | | | | Implement krb5_free_data & krb5_free_data_contents to cleanup krb5_data structures and data contents allocated by the krb5 library. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9904 dc483132-0cff-0310-8789-dd5450dbe970
* login.c (destroy_tickets): Just use global kcontext insteadTheodore Tso1996-11-071-5/+9
| | | | | | | | | | | | | 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
* * Remove rhosts support [138]Sam Hartman1996-11-021-27/+4
| | | | | | | * Remove tab3 from initial terminal settings. We don't really care about horizontal tab delays, do we? This was breaking on NetBSD. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9282 dc483132-0cff-0310-8789-dd5450dbe970
* * Use login.krb5 -f from klogindSam Hartman1996-09-301-16/+8
| | | | | | * Allow login.krb5 -f to authorize root login. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9135 dc483132-0cff-0310-8789-dd5450dbe970
* TCP performance fix (see 2203 in krb5-bugs): write out encrypted dataSam Hartman1996-09-021-12/+18
| | | | | | | | and length as one packet, not with two calls to write. This should also happen to rsh, rcp, and possibly telnet. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9020 dc483132-0cff-0310-8789-dd5450dbe970
* * klogind should do a better job of initializing output flags on ttySam Hartman1996-06-241-0/+1
| | | | | | | * Fix so login.krb5 compiles with Athena Kerberos libs (needed for rsaix build) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@8540 dc483132-0cff-0310-8789-dd5450dbe970
* krlogind.c krshd.c:Richard Basch1996-05-091-0/+21
| | | | | | | | | Use the default service principal as the basis for the rcache name. login.c: SVR4 systems typically do not do mail/motd checks in login; they do it in the profiles (/etc/profile). Follow that convention... git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7951 dc483132-0cff-0310-8789-dd5450dbe970
* Merge with Cygnus sources, changes from Mark Eichin, Marc Horowitz, ChrisKen Raeburn1996-05-011-14/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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