Commit Graph

69 Commits

Author SHA1 Message Date
christos b33a0c98e1 CID 975111: Ignore return value from initgroups(). If we failed, then
the failure would be that we could not open the .rhosts file so we fail
closed.
2014-05-28 14:39:02 +00:00
darrenr 3ec957d580 bin/46703: BSD r-commands use wrong source address for stderr
http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=46703
Bump libc minor for the addition of rresvport_af_addr()
2012-07-14 15:06:26 +00:00
christos c5e820cae4 PR/45989: Martin Husemann: lint invocation does include -w only on i386
- turn lint -w for all the platforms after fixing the lint warnings.
- add _DIAGASSERTS() for casts that would assign values to types that
  would not fit.
- change types, add casts
- change into ansii prototypes
- turn on _DIAGNOSTIC for libc (during current, to be eliminated for release
  builds)

approved by core@
2012-03-13 21:13:30 +00:00
christos 98715cd1ec PR/45007: rcmd_af(3) and thusly rsh(1) ignore requested address family
Pass in the address family to rshrcmd and DTRT.
While here KNF.
2011-05-31 06:49:26 +00:00
ws 0ff81292cd Don't leak file descriptors. 2007-01-03 11:46:22 +00:00
christos 1d83cc5b6c nuke perror. 2006-11-03 20:21:16 +00:00
yamt 92ca7d2b16 constify and remove an unnecessary __UNCONST. 2005-12-02 11:33:26 +00:00
christos 03256c6e55 WARNS=4 2005-11-29 03:11:58 +00:00
christos 3897500b28 forgot to commit this; cleanup to compile with WARNS=4, since lpd uses it. 2005-11-28 14:18:20 +00:00
christos eea147d9f9 check for pwd != NULL 2005-04-19 03:20:50 +00:00
christos 5d3d04b484 use re-entrant versions of getpw*(). In libc only pwcache remains and this
cannot be changed easily because it involves an API change.
2005-03-30 16:12:58 +00:00
ginsbach e9042901ff rresvport_af() should return -1 when the address family is unsupported
and set errno accordingly.
2004-11-29 17:00:06 +00:00
itojun da88342476 NI_WITHSCOPEID was not picked up by IETF standardization process 2004-11-16 06:04:12 +00:00
mrg 05cd119306 remove my copyright statement 2004-03-21 05:46:42 +00:00
lukem b776c8e6bb Retain the euid of the target user whilst reading the
.rhosts file.  This allows it to have a mode of 600
and still function correctly even when used on an NFS
client with uid 0 mapped to another (anonymous) UID.
Patch from Brian Ginsbach <ginsbach@cray.com>,
and fixes [bin/14880] from Darren Reed <darrenr@>.
2004-01-27 11:46:34 +00:00
agc b2b49933f4 Move Matt Green's code from a 4-clause to a 3-clause licence by removing
the advertising clause. Diffs provided in PR 22396 by Joel Baker, the changes
were confirmed to the board by Matt Green.
2003-10-13 14:22:20 +00:00
agc eb7c1594f1 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22280, verified by myself.
2003-08-07 16:42:00 +00:00
wiz 1035faff1d writable, not writeable. 2003-01-06 20:30:28 +00:00
itojun 233424cdc2 make sure to bound string operation by strlcpy
(there are bunch of "strcpy is safe" comments, i think we should change them
to strlcpy as much as possible)
2002-11-17 20:49:33 +00:00
itojun 9134efabd0 use strlcpy where it is more appropriate. 2002-11-17 01:51:24 +00:00
thorpej de792f2457 Fix signed/unsigned comparison warnings. 2002-11-11 19:49:00 +00:00
tron f2679ef4e3 Revert last change after protoype of getnameinfo(3) has been changed back. 2002-05-22 14:42:37 +00:00
thorpej 2afd826926 Delint after getaddrinfo(), etc. changes. 2002-05-14 23:58:08 +00:00
groo 1e880d776e botched strn* -> strl*
from xs@kittenz.org
2002-04-16 19:16:22 +00:00
lukem 50f5afd52e fix WARNS=2 (-Wshadow) warnings 2001-11-04 13:57:29 +00:00
itohy 7daefc5a5a Passing "char" values to ctype(3) functions is problematic.
If an argument of a ctype function is outside "unsigned char"
and if it is not EOF, the behavior is undefined.

The isascii(3) is the sole exception of above and it was used to
be used to check a value was valid for other ctype functions in
ancient systems.  On modern systems, the ctype functions take
all values of "unsigned char", and this check is obsolete and
even wrong for non-ASCII systems.  However, we leave the isascii()
untouched for now, so as not to change the current behavior.
2000-07-07 08:03:36 +00:00
christos 43264d6a9a add argsused lint directives
add explicit casts
elide non-portable casts
2000-07-06 02:59:20 +00:00
itojun ed26506c25 usr.sbin/lpr/lpd now compiles lib/libc/net/rcmd.c on its own, to avoid
use of non-exported function __ivaliduser{,_sa}().

we cannot make __ivaliduser{,_sa}() static yet, since doing that would choke
compiled lpd binaries.  we should do it on next libc major version bump.
added a memo on lib/libc/shlib_version.
2000-05-30 01:07:43 +00:00
itojun 8e1ca1a351 fix fatal typo, which misused luser/ruser (PR 9543). 2000-03-05 09:40:57 +00:00
itojun 7b48263c7b (rcmd.c) to make Zoularis happier, pass sa_len separately from sockaddrs.
this changes function prototype for __ivalid*.
This commit breaks binary compatibility for __ivalid*.  I believe this can be
forgiven due to the following:
- this is not really exported function.  no function prototype is in headers.
  function name starts with underbars.  No third-party applications are
  expected to use it.
- the function was introduced very recently, when rcmd.c was made IPv6-ready.
- the only customer in NetBSD tree is lpd.

(lpd.c) sync with rcmd.c change.
2000-02-24 06:33:47 +00:00
itojun 5b36a9108a do not perform sleep() every time we get ECONNREFUSED.
try all the set of addresses before go to sleep() and retry.

not sure if we still need sleep() - retry logic.  why is it so persistent
in connecting?

From: SHIMIZU Ryo <ryo@misakimix.org>
2000-02-18 04:16:54 +00:00
itojun 0affd7a994 visit next addrinfo struct on socket failure.
this should fix the behavior of rcmd() on ipv4-only node, trying to
connect to dual stack node (AAAA and A record on DNS/hostname databaes)
2000-01-31 10:23:03 +00:00
itojun 5b1aaa939e add IPv6 support to rcmd() and friends.
rcmd() and iruserok(): unchanged
	ruserok(): became address family independent
	rcmd_af(), iruesrok_sa(): address family independent
2000-01-27 05:33:06 +00:00
mycroft 967cbc5131 Use a better type in previous. 2000-01-22 23:36:17 +00:00
mycroft c6a0f46b4f Delint. 2000-01-22 22:53:59 +00:00
lukem d896261208 back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
1999-09-20 04:38:56 +00:00
lukem b48252f365 * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
  and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

		_DIAGASSERT(path != NULL)
	#ifdef _DIAGNOSTIC
		if (path == NULL) {
			errno = EFAULT;
			return (-1);
		}
	#endif
1999-09-16 11:44:54 +00:00
itojun 4620b00436 add NetBSD RCSID on top. 1999-07-04 00:43:43 +00:00
christos 180ff547a4 int -> socklen_t 1999-05-03 15:26:12 +00:00
christos 3bb2365914 - fix gcc-2.8.1 warnings
- portability fix: Don't use bindresvport() if !BSD4_4 because we could
  be on an operating system where it takes different arguments (hint, hint).
1999-03-16 18:15:13 +00:00
christos 38676913cd delint 1998-11-15 17:39:20 +00:00
christos 2c89343c25 delint 1998-11-13 15:46:52 +00:00
christos dfa4e2c867 Portability. Use #ifdef BSD4_4 for sin_len 1998-10-18 14:22:05 +00:00
christos c4a835f8e9 Use posix signal system calls. 1998-09-26 23:58:29 +00:00
mycroft e5d9823796 const poisoning. 1998-07-26 19:05:06 +00:00
lukem 786b86d71b use AF_LOCAL instead of AF_UNIX 1998-07-18 05:04:35 +00:00
lukem 7b4851649d use bindresvport for rresvport (from freebsd). old code #if 0-ed out 1998-01-18 06:22:19 +00:00
christos 24f2924d70 inet_addr -> inet_aton 1997-12-21 17:14:24 +00:00
christos 8d36d3405e Fix RCSID's
Fix gcc warnings
Add missing prototypes
Use "namespace.h"
1997-07-13 19:57:30 +00:00
mrg 5a1ec9814a allow rcmd() to use something other than rsh protocol. 1997-05-26 14:18:29 +00:00