History log of /freebsd-11-stable/libexec/rshd/rshd.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 360673 05-May-2020 dim

Fix misleading indentation warning:

libexec/rshd/rshd.c:442:5: error: misleading indentation; statement is not part of the previous 'else' [-Werror,-Wmisleading-indentation]
ioctl(pv[0], FIONBIO, (char *)&one);
^
libexec/rshd/rshd.c:440:4: note: previous statement is here
else
^

Direct commit to stable/11, since rshd has been removed from FreeBSD 12
and later.


# 330322 03-Mar-2018 eadler

MFC r320406:

A little tweak for performance


# 321068 17-Jul-2017 delphij

MFC r320433:

Use strlcpy() instead of strncpy() and nul-terminating.


# 302408 07-Jul-2016 gjb

Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle.
Prune svn:mergeinfo from the new branch, as nothing has been merged
here.

Additional commits post-branch will follow.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


/freebsd-11-stable/MAINTAINERS
/freebsd-11-stable/cddl
/freebsd-11-stable/cddl/contrib/opensolaris
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/zfs
/freebsd-11-stable/cddl/contrib/opensolaris/lib/libzfs
/freebsd-11-stable/contrib/amd
/freebsd-11-stable/contrib/apr
/freebsd-11-stable/contrib/apr-util
/freebsd-11-stable/contrib/atf
/freebsd-11-stable/contrib/binutils
/freebsd-11-stable/contrib/bmake
/freebsd-11-stable/contrib/byacc
/freebsd-11-stable/contrib/bzip2
/freebsd-11-stable/contrib/com_err
/freebsd-11-stable/contrib/compiler-rt
/freebsd-11-stable/contrib/dialog
/freebsd-11-stable/contrib/dma
/freebsd-11-stable/contrib/dtc
/freebsd-11-stable/contrib/ee
/freebsd-11-stable/contrib/elftoolchain
/freebsd-11-stable/contrib/elftoolchain/ar
/freebsd-11-stable/contrib/elftoolchain/brandelf
/freebsd-11-stable/contrib/elftoolchain/elfdump
/freebsd-11-stable/contrib/expat
/freebsd-11-stable/contrib/file
/freebsd-11-stable/contrib/gcc
/freebsd-11-stable/contrib/gcclibs/libgomp
/freebsd-11-stable/contrib/gdb
/freebsd-11-stable/contrib/gdtoa
/freebsd-11-stable/contrib/groff
/freebsd-11-stable/contrib/ipfilter
/freebsd-11-stable/contrib/ldns
/freebsd-11-stable/contrib/ldns-host
/freebsd-11-stable/contrib/less
/freebsd-11-stable/contrib/libarchive
/freebsd-11-stable/contrib/libarchive/cpio
/freebsd-11-stable/contrib/libarchive/libarchive
/freebsd-11-stable/contrib/libarchive/libarchive_fe
/freebsd-11-stable/contrib/libarchive/tar
/freebsd-11-stable/contrib/libc++
/freebsd-11-stable/contrib/libc-vis
/freebsd-11-stable/contrib/libcxxrt
/freebsd-11-stable/contrib/libexecinfo
/freebsd-11-stable/contrib/libpcap
/freebsd-11-stable/contrib/libstdc++
/freebsd-11-stable/contrib/libucl
/freebsd-11-stable/contrib/libxo
/freebsd-11-stable/contrib/llvm
/freebsd-11-stable/contrib/llvm/projects/libunwind
/freebsd-11-stable/contrib/llvm/tools/clang
/freebsd-11-stable/contrib/llvm/tools/lldb
/freebsd-11-stable/contrib/llvm/tools/llvm-dwarfdump
/freebsd-11-stable/contrib/llvm/tools/llvm-lto
/freebsd-11-stable/contrib/mdocml
/freebsd-11-stable/contrib/mtree
/freebsd-11-stable/contrib/ncurses
/freebsd-11-stable/contrib/netcat
/freebsd-11-stable/contrib/ntp
/freebsd-11-stable/contrib/nvi
/freebsd-11-stable/contrib/one-true-awk
/freebsd-11-stable/contrib/openbsm
/freebsd-11-stable/contrib/openpam
/freebsd-11-stable/contrib/openresolv
/freebsd-11-stable/contrib/pf
/freebsd-11-stable/contrib/sendmail
/freebsd-11-stable/contrib/serf
/freebsd-11-stable/contrib/sqlite3
/freebsd-11-stable/contrib/subversion
/freebsd-11-stable/contrib/tcpdump
/freebsd-11-stable/contrib/tcsh
/freebsd-11-stable/contrib/tnftp
/freebsd-11-stable/contrib/top
/freebsd-11-stable/contrib/top/install-sh
/freebsd-11-stable/contrib/tzcode/stdtime
/freebsd-11-stable/contrib/tzcode/zic
/freebsd-11-stable/contrib/tzdata
/freebsd-11-stable/contrib/unbound
/freebsd-11-stable/contrib/vis
/freebsd-11-stable/contrib/wpa
/freebsd-11-stable/contrib/xz
/freebsd-11-stable/crypto/heimdal
/freebsd-11-stable/crypto/openssh
/freebsd-11-stable/crypto/openssl
/freebsd-11-stable/gnu/lib
/freebsd-11-stable/gnu/usr.bin/binutils
/freebsd-11-stable/gnu/usr.bin/cc/cc_tools
/freebsd-11-stable/gnu/usr.bin/gdb
/freebsd-11-stable/lib/libc/locale/ascii.c
/freebsd-11-stable/sys/cddl/contrib/opensolaris
/freebsd-11-stable/sys/contrib/dev/acpica
/freebsd-11-stable/sys/contrib/ipfilter
/freebsd-11-stable/sys/contrib/libfdt
/freebsd-11-stable/sys/contrib/octeon-sdk
/freebsd-11-stable/sys/contrib/x86emu
/freebsd-11-stable/sys/contrib/xz-embedded
/freebsd-11-stable/usr.sbin/bhyve/atkbdc.h
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.c
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.h
/freebsd-11-stable/usr.sbin/bhyve/console.c
/freebsd-11-stable/usr.sbin/bhyve/console.h
/freebsd-11-stable/usr.sbin/bhyve/pci_fbuf.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.h
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.c
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.h
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.c
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.h
/freebsd-11-stable/usr.sbin/bhyve/rfb.c
/freebsd-11-stable/usr.sbin/bhyve/rfb.h
/freebsd-11-stable/usr.sbin/bhyve/sockstream.c
/freebsd-11-stable/usr.sbin/bhyve/sockstream.h
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.c
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.h
/freebsd-11-stable/usr.sbin/bhyve/usb_mouse.c
/freebsd-11-stable/usr.sbin/bhyve/vga.c
/freebsd-11-stable/usr.sbin/bhyve/vga.h
# 301242 03-Jun-2016 lidl

Add blacklist support to rshd

Reviewed by: rpaulo
Approved by: rpaulo
Relnotes: YES
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6594


# 270111 17-Aug-2014 neel

Remove LOG_ODELAY because it does nothing.

Reviewed by: jilles
CR: https://reviews.freebsd.org/D611


# 262136 17-Feb-2014 brueffer

Remove the 3rd clause ("advertising clause") of the BSD license as
permitted by the University of Berkeley on July 22, 1999.

Reviewed by: imp
MFC after: 1 week


# 226937 30-Oct-2011 brueffer

Fix a misplaced parenthesis.

PR: 162164
Submitted by: Henning Petersen <henning.petersen@t-online.de>
MFC after: 1 week


# 146074 11-May-2005 jmallett

Spell SHUT_RDWR as SHUT_RDWR not 1+1 as the how argument to shutdown(2).


# 143907 21-Mar-2005 das

Use sysconf(_SC_ARG_MAX) instead of NCARGS.


# 141918 14-Feb-2005 stefanf

Fix most cases where the address of an int is passed to a function expecting a
socklen_t * argument.


# 141589 09-Feb-2005 ru

Sync program's usage() with manpage's SYNOPSIS.


# 127864 04-Apr-2004 mux

Cast the terminating NULL to char * in the execl() call.

Submitted by: Stefan Farfeleder <stefan@fafoe.narf.at>


# 98885 26-Jun-2002 markm

Gut out (by default unused) cruft, and tidy up warnings.


# 96195 07-May-2002 des

PAMify.

Sponsored by: DARPA, NAI Labs


# 91749 06-Mar-2002 des

YA patch I forgot to commit last night.


# 90335 07-Feb-2002 imp

o const poison a few prototypes to avoid gcc3 warnings
o s/err/error/ in a couple places to avoid shadowing warnings


# 90334 07-Feb-2002 imp

o __P removal
o new style definitions/declarations
o declare null_conv static and its arguments __unused


# 90161 03-Feb-2002 kris

Mark a function as __printf0like(). This exposes a warning which requires
some code changes to fix but should be possible.

MFC after: 1 week


# 79452 09-Jul-2001 brian

Fix the type of the NULL arg to execl()

Idea from: Theo de Raadt <deraadt@openbsd.org>


# 76134 29-Apr-2001 markm

Replacement of the old error() routine with errx(3) was premature.
There are protocol issues to deal with.

Bring back this routine (renamed to avoid a library conflict in libssh)
and overhaul it for more 21st Century style coding.

Pointed out by: bde


# 76125 29-Apr-2001 markm

Grrr. Fix a line that was fatfingered out during the cleanup.
Submitted by: bde
Pointy hat: markm


# 76094 28-Apr-2001 markm

Clean up the error handling code a bit. There is no need to "roll our
own" error() routine when errx() is available. This resolves a conflict
when linking statically.


# 74874 27-Mar-2001 markm

Add full PAM support for account management and sessions.

The PAM_FAIL_CHECK and PAM_END macros in su.c came from the util-linux
package's PAM patches to the BSD login.c

Submitted by: "David J. MacKenzie" <djm@web.us.uu.net>


# 72093 06-Feb-2001 asmodai

Fix typo: compatability -> compatibility.

Compatability is not an existing english word.


# 69707 07-Dec-2000 ru

Whitespace-only to sync with -stable.


# 67001 12-Oct-2000 ru

Removed broken PAM support from rshd(8) and rlogind(8). rshd does
not allocate a pty(4) so it is not suitable at all for interactive
PAM modules. rlogind calls login(1) which is already PAM enabled.

Approved by: markm


# 62643 05-Jul-2000 bsd

Plug the hole where rshd would bypass a proper .rhosts check if the
password was empty.

Reviewed by: Warner Losh <imp@freebsd.org>


# 59748 29-Apr-2000 asmodai

Remove dead debug code.
This also removes a dependency/reference on COMPAT_43.


# 56939 01-Feb-2000 shin

sync iruserok() extension API with other BSDs

Some of rcmd related function is need to be updated to
support IPv6. Some of them are already updated as standard
document. But there is also several de-facto functions and
they are not listed in standard documents.
They are,

iruserok() (used by rlogind, rshd)
ruserok() (used by kerberos, etc)

KAME package updated those functions in original way.

iruserok_af()
ruserok_af()

But recently there was discussion on IETF IPng mailing
list about how to sync those API, and it is decided,

-Those function is not standard and not documented.
-But let BSDs sync their API as de-facto.

And after some discussion, it is announced that

-add update to iruserok() as iruserok_sa()
-no ruserok() API change(it is only updated internaly)

So I sync those API before 4.0 is released.
The changes are,
-prototype changes
-ruserok() internal update (use iruserok_sa() inside)
-removal of ruserok_af()
-change iruserok_af() as static functioin, and also prefix the name with __.
-add iruserok_sa() (Just call __iruserok_af() inside)
-adding flag AI_ALL to getipnodebyaddr() called from __icheckhost().
This is necessary to support IPv4 communication via AF_INET6 socket
could be correctly authenticated via iruserok_sa()
-irusreok_af() call is replaced to iruserok_sa() call
in rlogind, and rshd.

Approved by: jkh


# 56758 28-Jan-2000 shin

Fix rshd coredump when AF_INET socket is used.

Confirmed by: F. Heinrichmeyer <fritz.heinrichmeyer@fernuni-hagen.de>


# 56590 25-Jan-2000 shin

several tcp apps IPv6 update
-inetd
-rshd
-rlogind
-telnetd
-rsh
-rlogin

Reviewed by: freebsd-arch, cvs-committers
Obtained from: KAME project


# 51433 19-Sep-1999 markm

Fix for new Kerberos4. Make a fist cut at PAM-ising while I'm here.


# 50476 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 45422 07-Apr-1999 brian

Ensure that things returned by gethostname() and
friends are terminated and allow for a maximum
host name length of MAXHOSTNAMELEN - 1.
Put parenthesis around sizeof args.
Make some variables static.
Fix telnetd -u (broken by my last commit)

Prompted by: bde


# 45393 06-Apr-1999 brian

Use realhostname() rather than various combinations of
gethostbyaddr() & gethostbyname().

Remove brokeness in ftpd for hosts of MAXHOSTNAMELEN length.


# 41860 16-Dec-1998 peter

As previously threatened, clean up the rshd -a option and make it default
on rshd and rlogind. However, note that:
1: rshd used to drop a connection with -a if the hostname != ip address.
This is unneeded, because iruserok() does it's own checking.
It was also wrong if .rhosts had an explicit IP address in it,
connections would be dropped from that host solely because the DNS was
mismatched even though it was explicitly intended to work by IP address.
2: rlogind and rshd check the hostname mappings by default now because that
is what goes into the utmp/wtmp and logs. If the hostname != ip address,
then it uses the IP address for logging/utmp/wtmp purposes. There isn't
much point logging ficticious hostnames.
3: rshd -a is now accepted (but ignored) for compatability. If you really
want to make life miserable for people with bad reverse DNS, use tcpd in
paranoid mode (which is questionable anyway, given DNS ttl tweaking).


# 41445 01-Dec-1998 dg

Added a -D option to turn on TCP_NODELAY.


# 35728 04-May-1998 rnordier

Replace _exit() with exit()
Pointed out by: Nathan Torkington <gnat@prometheus.frii.com> PR 5585


# 31490 02-Dec-1997 charnier

No \n in syslog() strings. Add man page to Xrefs. Change null byte to NUL byte.


# 29917 28-Sep-1997 markm

Changes for the new KTH Kerberos4.
Also make -Wall a bit quieter


# 27516 18-Jul-1997 wosch

Rshd print to much information if a user does not exists.


# 25674 10-May-1997 davidn

login_getclass() -> login_getpwclass().


# 25099 23-Apr-1997 davidn

Added login.conf support.


# 24379 29-Mar-1997 peter

Be a bit more careful about what port number we are using for the
second socket. If we're going to check for reserved ports, we should
do it properly.


# 24349 28-Mar-1997 imp

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


# 22989 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


# 22454 09-Feb-1997 imp

Some patches for source routed packets from OpenBSD.
Rev 1.13 deraadt:
do not warn about valid options; invalid options correctly quit
Rev 1.12 deraadt:
need not clear options since bad ones cause exit;
provos@ws1.physnet.uni-hamburg.de
Rev 1.11 deraadt:
IPOPT_LSRR/IPOPT_SSRR must exit() due to tcp sequencing; pointed
out by provos@wserver.physnet.uni-hamburg.de. also another 1-char
buffer overflow.

Reviewed by: Peter Wemm
Obtained from: OpenSBD


# 22041 27-Jan-1997 joerg

Make even more copies of hostnames obtained by inet_ntoa(). iruserok()
could still clobber the static storage, yielding an error message with
a wrong hostname.


# 21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# 19108 22-Oct-1996 scrappy

Fixes:

When an rsh is denied by rshd because the client is lacking appropriate
.rhosts permission, an error message is formatted for syslog which contains
the client's hostname. The hostname portion of the message relies on a pointer
to a field within gethostbyname()'s internal struct hostent which changes state
between when the pointer is initialized and when it is dereferenced to create th
e
message.

Submitted by: skynyrd@opus.cts.cwu.edu


# 18471 22-Sep-1996 wosch

add forgotten $Id$


# 18449 21-Sep-1996 pst

Fix some compilation warnings.


# 14024 11-Feb-1996 markm

#include <kerberosIV/des.h> -> #include <des.h>


# 13881 03-Feb-1996 markm

Rename des_set_key -> des_set_key_krb. (libdes conflict)


# 12387 19-Nov-1995 ache

Add missing & in des_set_key argument


# 12240 12-Nov-1995 peter

Move the setlogin() call a little earlier.. It was being done in the child
process - which would be no longer allowed if the setlogin() changes go
through. Now the parent (the session leader, when started by inetd) does it.


# 10401 28-Aug-1995 mpp

Check for expired passwords before allowing access to the system.


# 1593 27-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1592,
which included commits to RCS files with non-trunk default branches.


# 1592 27-May-1994 rgrimes

BSD 4.4 Lite Libexec Sources