add a bugs section.

This commit is contained in:
mrg 1997-06-05 16:40:16 +00:00
parent 66bc7bd651
commit b98cd1ecc7
1 changed files with 25 additions and 1 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: rcmd.3,v 1.10 1997/05/28 04:01:06 mrg Exp $
.\" $NetBSD: rcmd.3,v 1.11 1997/06/05 16:40:16 mrg Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@ -239,3 +239,27 @@ The (newer)
.Fn rcmd
function appeared in
.Nx 1.3 .
.Sh BUGS
As the
.Nm
function uses
.Xr getpwent 3
functions,
passing in a previous value from one of this family of functions
can result in unpredictable results. Do not write code like the
following:
.Bd -literal -offset indent
struct passwd *pw;
pw = getpwuid(getuid());
...
if (rcmd(host, port, pw->pw_name, pw->pw_name, cmd, fd2p) < 0)
err(1, "rcmd");
.Ed
.Pp
When a reentrant version of
.Xr getpwent 3
is available,
.Nm
should be changed to use this instead.