Commit Graph

3075 Commits

Author SHA1 Message Date
Chris D. Faulhaber
e146d0bc6a Add more argument checking
Reviewed by:	rwatson
Obtained from:	TrustedBSD Project
2002-02-21 23:13:06 +00:00
Chris D. Faulhaber
c61eb011c4 static'ize and declare functions
Reviewed by:	rwatson
Obtained from:	TrustedBSD Project
2002-02-21 23:12:25 +00:00
Warner Losh
576541a9e6 Fixed divots that I created when I moved prototypes of group_from_gid
and user_from_uid to grp.h and pwd.h.  Update the man pages.

Submitted by: David Malone
Pointy hat to: imp
2002-02-19 00:05:59 +00:00
Mike Barcroft
fd8e4ebc8c o Move NTOHL() and associated macros into <sys/param.h>. These are
deprecated in favor of the POSIX-defined lowercase variants.
o Change all occurrences of NTOHL() and associated marcros in the
  source tree to use the lowercase function variants.
o Add missing license bits to sparc64's <machine/endian.h>.
  Approved by: jake
o Clean up <machine/endian.h> files.
o Remove unused __uint16_swap_uint32() from i386's <machine/endian.h>.
o Remove prototypes for non-existent bswapXX() functions.
o Include <machine/endian.h> in <arpa/inet.h> to define the
  POSIX-required ntohl() family of functions.
o Do similar things to expose the ntohl() family in libstand, <netinet/in.h>,
  and <sys/param.h>.
o Prepend underscores to the ntohl() family to help deal with
  complexities associated with having MD (asm and inline) versions, and
  having to prevent exposure of these functions in other headers that
  happen to make use of endian-specific defines.
o Create weak aliases to the canonical function name to help deal with
  third-party software forgetting to include an appropriate header.
o Remove some now unneeded pollution from <sys/types.h>.
o Add missing <arpa/inet.h> includes in userland.

Tested on:	alpha, i386
Reviewed by:	bde, jake, tmm
2002-02-18 20:35:27 +00:00
Chris D. Faulhaber
e76872c11e o style and consistency fixes:
- if (!var) -> if (var == NULL)
  - return val; -> return (val);
o update copyright
2002-02-17 20:05:20 +00:00
Ian Dowse
6112fceebd Fix two file descriptor leaks in the internal function local_rpcb()
that is used by a number of rpcbind-related library functions. Also
fix a rpc client leak in rpcb_set().

Submitted by:	mbr
Obtained from:	NetBSD
2002-02-16 17:05:49 +00:00
Garrett Wollman
5874617263 Document that the type of st_flags is now fflags_t. 2002-02-15 22:37:15 +00:00
Bruce Evans
bdc5bab2eb Don't leave stack garbage in the reserved fields of the header. 2002-02-15 02:37:08 +00:00
Bruce Evans
2c316efdf3 Fixed style bugs in rev.1.5:
- missing whitespace
- strange version of warn() built out of warnx() + strerror().  Just use
  warn().
- conversion of just one of the two perror()'s to warn*()

Actually use _warn() instead of _warn(), to keep up with namespace-
unpollution for warn().
2002-02-15 02:28:50 +00:00
Warner Losh
63195486ba Use new-style function declations. 2002-02-13 09:30:47 +00:00
Dima Dorfman
c96bb7c5f2 Don't make it seem like vm.max_proc_mmap only affects MAP_FIXED.
PR:		34005
Submitted by:	Steven Grady <grady@digitaldeck..com>,
		Hiten Pandya <hitmaster2k@yahoo.com>
2002-02-10 21:07:56 +00:00
Robert Watson
c0858e0a77 Part III: Update extended attribute system call interface documentation.
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
2002-02-10 04:46:28 +00:00
Ruslan Ermilov
2ef702f52a FreeBSD 4.1 bootstrapping aid (__FBSDID is not there). 2002-02-08 09:34:17 +00:00
Alfred Perlstein
866e3c9008 Move the AF_LOCAL check to the AF_INET check since portmap protocol
v. 2 only needs this. That also makes it shorter and simpler.

Submitted by: mbr
2002-02-06 19:14:02 +00:00
Dag-Erling Smørgrav
dc584ddbc5 ANSIfy and remove some dead code.
Sponsored by:	DARPA, NAI Labs
2002-02-06 15:26:07 +00:00
Dag-Erling Smørgrav
ed4d1c46a2 Apply the following mechanical transformations in preparation for
ansification and constification:

    s{\s+__P\((\(.*?\))\)}{$1}g;
    s{\(\s+}{\(}g;
    s{\s+\)}{\)}g;
    s{\s+,}{,}g;
    s{(\s+)(for|if|switch|while)\(}{$1$2 \(}g;
    s{return ([^\(].*?);}{return ($1);}g;
    s{([\w\)])([!=+/\*-]?=)([\w\(+-])}{$1 $2 $3}g;
    s{\s+$}{\n};g

Also add $FreeBSD$ where needed.

MFC after:	1 week
2002-02-06 13:30:31 +00:00
Alfred Perlstein
1c71deff79 balance parens.
Submitted by: mbr
2002-02-05 23:56:29 +00:00
Alfred Perlstein
2abd9cf115 For RPC v2 we need to fill in ret->xp_raddr too. INET_6
is not supported in portmap, so we don't have to care about it.

Submitted by: mbr
2002-02-05 23:46:37 +00:00
Alfred Perlstein
8d6301358e Fix cc -Wall, fix rcsid warnings, add missing prototypes,
change prototypes to be the same as in the original sun tirpc code.
Remove ()P macro in a file where the mayority had ()P already removed.
Add them if the mayority use ()P macros.

Submitted by: mbr
Requested by: bde
2002-02-05 23:43:43 +00:00
Alfred Perlstein
e4db1131b8 Do not call addrinfo on local transport adresses, if returning a
server handle (for reuse or whatever). We just return now a handle
connected to the local rpcbind.

Do not try to call checkcache, if host = NULL;

Submitted by: mbr
2002-02-05 23:12:51 +00:00
Alfred Perlstein
49de9dcd8b style: return(x) -> return (x)
Submitted by: mbr
2002-02-05 19:31:16 +00:00
Alfred Perlstein
08760d5a57 Fix the credential handling code.
In NetBSD, Solaris, xprt->xp_p2 pointed directly to the credentials,
in FreeBSD xprt->xp_verf.oa_base was a pointer to a struct cmessage,
which is defined as follow:

struct cmessage {
        struct cmsghdr cmsg;
        struct cmsgcred cmcred;
};

The credentials were submitted the right way and xprt->xp_p2 pointed to them.
But cb_verf.oa_flavor was still empty. There was an assignment missing
in svc_recv() in svc_vc.c:

msg->rm_call.cb_verf.oa_flavor = AUTH_UNIX;

Also

+       if (addr.ss_family == AF_LOCAL) {
+               xprt->xp_raddr = *(struct sockaddr_in *)xprt->xp_rtaddr.buf;
+               xprt->xp_addrlen = sizeof (struct sockaddr_in);
+       }

was missing. But the first seems not to be needed:

I guess in rpc.yppasswdd there was a typo:

- transp>xp_verf.oa_flavor != AUTH_UNIX) {
+ rqstp->rq_cred.oa_flavor != AUTH_UNIX) {

This little fix does fix the breakage in rpc.yppasswdd :-)

+       if (msg.msg_controllen == 0 ||
+           (msg.msg_flags & MSG_CTRUNC) != 0)
+               return (-1);

We cannot set the cb_verf.oa_length in svc_recv() of svc_vc.c,
the credentials get overwritten then, and that's bad.

Submitted by: mbr
2002-02-05 19:30:30 +00:00
Alfred Perlstein
8858373f83 The clnt_create(KEYSERVSOCK, CRYPT_PROG, CRYPT_VERS, "unix") hacks
were removed and replaced them with clnt_tp_create, now the af_local
support is fixed.

I also removed the hack how rpcinfo contacted rpcbind, now we can
relay on clnt_tp_create create the client-handle for us.  Only
rpcbind itself needs a hardcoded socket-path.

Submitted by: mbr

Also add $FreeBSD
2002-02-05 19:26:04 +00:00
Maxim Sobolev
c6de4ce791 Allow ldd(1) be used on shared libraries in addition to executables. 2002-02-04 10:33:48 +00:00
Bruce Evans
49efc51214 Fixed tab lossage in vendor id and nearby style bugs in previous commit. 2002-02-01 23:26:32 +00:00
Bruce Evans
eb0a30f4c1 Fixed syntax error in previous commit. It was non-fatal because it was
in conditional code that happens not to be compiled, and because gcc
doesn't complain garbage after #endif by default.

Fixed some style bugs in previous commit, 1.8 and 1.1.
2002-02-01 23:16:39 +00:00
Peter Pentchev
b484faa5e0 Return ENONAME if getaddrinfo() is called with AI_NUMERICHOST
and the hostname given is not numeric.

PR:		34390
Submitted by:	Serge van den Boom <svdb@stack.nl>
Approved by:	silence from -net
MFC after:	1 month
2002-02-01 08:35:16 +00:00
David E. O'Brien
60e104f3f5 Fixed slipage in editor. 2002-02-01 07:26:00 +00:00
David E. O'Brien
26a2df7351 Cut-n-paste in `list' mode considered harmful. 2002-02-01 07:25:07 +00:00
David E. O'Brien
a99d101352 * Remove __P and convert to ANSI prototypes.
* Remove 'register'.  (some functions had 7+ register functions...)
* Fix SCM ID's.
2002-02-01 01:39:09 +00:00
David E. O'Brien
b231cb3945 * Remove __P and convert to ANSI prototypes.
* Remove 'register'.  (some functions had 7+ register functions...)
* Fix SCM ID's.
2002-02-01 01:32:19 +00:00
David E. O'Brien
22626efa0f * Remove 'register'. (some functions had 7+ register functions...)
* Fix SCM ID's.
2002-02-01 01:08:48 +00:00
David E. O'Brien
ea8d448a92 Fix SCM ID's. 2002-02-01 00:57:29 +00:00
David E. O'Brien
ec4c2e3605 Fix minor style nit. 2002-01-31 17:26:37 +00:00
Chris D. Faulhaber
ea018aa260 Revert last commit. stdio.h include is for perror(), not strerror() 2002-01-31 13:32:14 +00:00
Chris D. Faulhaber
066f7169c1 strerror(3) is in string.h, not stdio.h
MFC after:	1 week
2002-01-31 13:20:48 +00:00
Bruce Evans
56bcbf00e2 Fixed world breakage due to missing include of <sys/cdefs.h> in previous
commit.

Fixed related style bugs:
basename.c: misplaced '#if 0'
dirname.c: misplaced '#if 0'
getgrent.c: missing '#if 0', and tab lossage in vendor id (the previous
            commit fixed the complete corruption of the vendor id but
	    lost a tab)
getpwent.c: missing '#if 0'
2002-01-31 12:58:36 +00:00
David E. O'Brien
135b57f906 Fix FreeBSD IDs. 2002-01-30 21:36:57 +00:00
Chris D. Faulhaber
60fba73589 Correct function's description.
Obtained from:	TrustedBSD Project
2002-01-29 12:18:45 +00:00
Andrey A. Chernov
831e8f614c Do not try to convert to char already converted C monetary locale members.
Do this conversion on locale load stage instead.
2002-01-28 08:26:38 +00:00
Chris D. Faulhaber
d5af31a255 o return EINVAL if acl_to_text() have been sent a NULL acl. o update copyright dates.
Reviewed by:	rwatson
2002-01-26 19:32:50 +00:00
David Malone
ab09ef008f Use ctime_r to build the timestamp for syslog, so that we don't
clobber a ctime buffer which is passed in.

PR:		34022
Submitted by:	Hartmut Brandt <brandt@fokus.gmd.de>
MFC after:	2 weeks
2002-01-25 21:49:34 +00:00
Alexey Zelkin
a2fb0481d7 get __time_load_locale() prototype from include file, rather than declare
own
2002-01-24 15:38:59 +00:00
Alexey Zelkin
bcbeac34ae * style(9)'fy
* declare prototype for __time_load_locale() in timelocal.h
2002-01-24 15:07:44 +00:00
David Malone
98d1592458 Change brk's prototype from char *brk(const char *) to int brk(const void *)
and sbrk's prototype from char *sbrk(int) to void *sbrk(intptr_t).

This makes us more consistant with NetBSD and standards which include
these functions. Bruce pointed out that ptrdiff_t would probably
have been better than intptr_t, but this doesn't match other
implimentations.

Also remove local declarations of sbrk and unnecessary casting.

PR:		32296
Tested by:	Harti Brandt <brandt@fokus.gmd.de>
MFC after:	1 month
2002-01-24 12:11:31 +00:00
Ruslan Ermilov
0e65089b79 The sixth argument to the NET_RT_IFLIST sysctl is actually 0 for
all interfaces, and ifnet.if_index value for a single interface.
2002-01-23 12:48:08 +00:00
Andrey A. Chernov
ff7448f849 Restore C99 standard conformance information, isblank() _is_ in final
standard document

Pointed by: "Jacques A. Vidrine" <n@nectar.cc>
2002-01-22 20:14:35 +00:00
Mark Murray
5567b258eb Use the proper type (gid_t) for (group)->gr_gid to be orthogonal
with uid_t usage and (user)->pw_uid.

PR:		3242
2002-01-22 17:32:53 +00:00
Ruslan Ermilov
0dc5e09ec6 Fix the description of the O_NONBLOCK flag to match reality.
Prodded by:	Maxim Konovalov <maxim@macomnet.ru>
Obtained from:	BSD/OS
2002-01-22 14:18:55 +00:00
Ruslan Ermilov
0c7f152b7b Fix a typo I made in revision 1.5.
Submitted by:	trevor
2002-01-22 12:38:43 +00:00