History log of /freebsd-current/usr.sbin/rpcbind/rpcb_svc_com.c
Revision Date Author Comments
# 8a7b6120 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.sbin: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix


# 2a63c3be 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c comment pattern

Remove /^/[*/]\s*\$FreeBSD\$.*\n/


# fce4b0c5 02-Mar-2023 Elyes Haouas <ehaouas@noos.fr>

rpcbind: Remove useless return at the end of void function

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/656


# 7ef6eb24 04-Mar-2018 Hiroki Sato <hrs@FreeBSD.org>

- Remove extra NULL check before free().
- Fix null pointer dereference in netbuffree() and use netbuffree()
where applicable.


# 35f85edc 02-Jan-2018 Conrad Meyer <cem@FreeBSD.org>

rpcbind: Fix race in signal termination

If a signal was delivered while the main thread was not in poll(2) and after
check was performed, we could reenter poll and never detect termination. Fix
this with the pipefd trick. (This race was introduced very recently, in
r327482.)

PR: 224503
Reported by: kib
Reviewed by: kib, markj
Sponsored by: Dell EMC Isilon


# b545252a 01-Jan-2018 Conrad Meyer <cem@FreeBSD.org>

rpcbind: Fix build

Add missed unistd.h include. Not sure where it was lost; I believe it
compiled before I submitted the change.

PR: 224503
Reported by: Cy Schubert <Cy.Schubert AT komquats.com>
Sponsored by: Dell EMC Isilon


# 055569f6 01-Jan-2018 Conrad Meyer <cem@FreeBSD.org>

rpcbind: Do not use signal-unsafe functions in SIGTERM handler

syslog(3), routines used in write_warmstart(), and exit(3) are all
signal-unsafe. Instead, set a signal-safe flag and check the flag in the
rpcbind main loop to shutdown safely.

PR: 224503
Reviewed by: kib, markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D13728


# c3fc0d96 01-Jan-2018 Xin LI <delphij@FreeBSD.org>

Remove unused includes.


# 8a16b7a1 20-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

General further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.


# 6448ec89 01-Jun-2017 Xin LI <delphij@FreeBSD.org>

* limit size of buffers to RPC_MAXDATASIZE
* don't leak memory
* be more picky about bad parameters

From:

https://raw.githubusercontent.com/guidovranken/rpcbomb/master/libtirpc_patch.txt
https://github.com/guidovranken/rpcbomb/blob/master/rpcbind_patch.txt

via NetBSD.

Reviewed by: emaste, cem (earlier version)
Differential Revision: https://reviews.freebsd.org/D10922
MFC after: 3 days


# c7310cbc 09-Jun-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

rpcbind(8): Make use of some xdr_* macros.

xdr_rpcproc, xdr_rpcprog and xdr_rpcvers were broken in older
versions of FreeBSD but fixed in r296394. Give them some use
hoping they help make the code somewhat more readable.


# e9fc928f 01-May-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

rpcbind: use our roundup() macro when available through <sys/param.h>.

No functional change.


# c1d0909a 06-Oct-2015 Hiroki Sato <hrs@FreeBSD.org>

Reallocate a maxlen-long buffer only when the current maxlen is
shorter than the required length. Note that it rarely happens
because maxlen is almost always 128 which covers struct sockaddr_storage.


# 0ed633d0 02-Oct-2015 Xin LI <delphij@FreeBSD.org>

Fix a regression with SA-15:24 patch that prevented NIS from
working.


# 066c492a 29-Sep-2015 Xin LI <delphij@FreeBSD.org>

The Sun RPC framework uses a netbuf structure to represent the
transport specific form of a universal transport address. The
structure is expected to be opaque to consumers. In the current
implementation, the structure contains a pointer to a buffer
that holds the actual address.

In rpcbind(8), netbuf structures are copied directly, which would
result in two netbuf structures that reference to one shared
address buffer. When one of the two netbuf structures is freed,
access to the other netbuf structure would result in an undefined
result that may crash the rpcbind(8) daemon.

Fix this by making a copy of the buffer that is going to be freed
instead of doing a shallow copy.

Security: FreeBSD-SA-15:24.rpcbind
Security: CVE-2015-7236


# a7c51fa1 25-Nov-2013 Hiroki Sato <hrs@FreeBSD.org>

Replace Sun RPC license with a 3-clause BSD license, with the explicit
permission of Sun Microsystems in 2009.


# 07de1c52 14-Jul-2011 Xin LI <delphij@FreeBSD.org>

Use prototype. While I'm there, add a pair of parenthesis to mark an if
statment's border.

MFC after: 1 month


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# 200ad46c 07-Feb-2010 Warner Losh <imp@FreeBSD.org>

Initialize fromlen before calling recvfrom to avoid passing in random
stack garbage.

Obtained from: NetBSD 1.13


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 784bddbc 07-Nov-2007 Kevin Lo <kevlo@FreeBSD.org>

Cleanup of userland __P use


# 545fbf37 29-Oct-2003 Martin Blapp <mbr@FreeBSD.org>

Don't compare a char to NULL.

Obtained from: NetBSD


# bcb53b16 16-Jan-2003 Martin Blapp <mbr@FreeBSD.org>

Implement nonblocking tpc-connections. rpcgen -m does still
produce backcompatible code.

Reviewed by: rwatson
Obtained from: NetBSD
MFC after: 1 day


# 9d5abbdd 01-Jan-2003 Jens Schweikhardt <schweikh@FreeBSD.org>

Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.


# d64ada50 30-Dec-2002 Jens Schweikhardt <schweikh@FreeBSD.org>

Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/
Add FreeBSD Id tag where missing.


# 4180788f 06-Oct-2002 Alfred Perlstein <alfred@FreeBSD.org>

WARNS=3 safety (mostly), use __unused for unused params and unsigned where
needed to avoid warnings about comparing signed and unsigned values.


# 2244ec01 16-May-2002 Juli Mallett <jmallett@FreeBSD.org>

Stop this program's abuse of malloc(3). Its return value doesn't need these
ugly explicit casts, and its argument doesn't need explicitly cast to u_int,
especially if sizeof() is being used.


# abca534c 16-Jul-2001 Brian Somers <brian@FreeBSD.org>

Free things in the right order


# 09d4f778 14-Jul-2001 Ian Dowse <iedowse@FreeBSD.org>

This is a selection of essentially cosmetic changes:
- Use '\0' for a char instead of NULL.
- Explicitly compare against the global `nullstring' to determine if
a non-NULL uaddr is not malloc'd.
- Remove some unnecessary casting of the argument to free().
- In rpcbproc_callit_com(), move the freeing of m_uaddr to the
cleanup code at the end of the function.
- To avoid confusion and possible alignment problems, change
netbufdup() to allocate the netbuf struct and the sockaddr buffer
separately, and change netbuffree() accordingly. This makes it
produce netbufs that are consistent with all other netbufs in
rpcbind.


# 98f36a35 23-Jun-2001 Ian Dowse <iedowse@FreeBSD.org>

Fix some return-value brain-damage in forward_register(). This
function has a return type of u_int32_t, into which it was somehow
supposed to encode:
* A valid 32-bit XID (which could be any value including 0).
* 0, meaning a duplicate request.
* -1, meaning a malloc failed (!);
We now ensure that all XIDs are non-zero, and pass the XID out via
a pointer argument.

In forward_find() and free_slot_by_xid(), remove an unnecessary
and confusing test for a negative result from an unsigned modulo
operation, but add an unnecessary cast to highlight why.


# 4ed6d634 21-Mar-2001 Alfred Perlstein <alfred@FreeBSD.org>

Hopefully fix some of the bugs in passing credentials over UNIX domain sockets.

Make struct cmessage visible from socket.h (about 4 places were
defining it for themselves which wasn't good)

Make __rpc_get_local_uid() useable and give it prototype that's
visible.

Fix some issues with printing out usernames from rpcbind and keyserv.


# 8360efbd 18-Mar-2001 Alfred Perlstein <alfred@FreeBSD.org>

Bring in a hybrid of SunSoft's transport-independent RPC (TI-RPC) and
associated changes that had to happen to make this possible as well as
bugs fixed along the way.

Bring in required TLI library routines to support this.

Since we don't support TLI we've essentially copied what NetBSD
has done, adding a thin layer to emulate direct the TLI calls
into BSD socket calls.

This is mostly from Sun's tirpc release that was made in 1994,
however some fixes were backported from the 1999 release (supposedly
only made available after this porting effort was underway).

The submitter has agreed to continue on and bring us up to the
1999 release.

Several key features are introduced with this update:
Client calls are thread safe. (1999 code has server side thread
safe)
Updated, a more modern interface.

Many userland updates were done to bring the code up to par with
the recent RPC API.

There is an update to the pthreads library, a function
pthread_main_np() was added to emulate a function of Sun's threads
library.

While we're at it, bring in NetBSD's lockd, it's been far too
long of a wait.

New rpcbind(8) replaces portmap(8) (supporting communication over
an authenticated Unix-domain socket, and by default only allowing
set and unset requests over that channel). It's much more secure
than the old portmapper.

Umount(8), mountd(8), mount_nfs(8), nfsd(8) have also been upgraded
to support TI-RPC and to support IPV6.

Umount(8) is also fixed to unmount pathnames longer than 80 chars,
which are currently truncated by the Kernel statfs structure.

Submitted by: Martin Blapp <mb@imp.ch>
Manpage review: ru
Secure RPC implemented by: wpaul