Commit Graph

6408 Commits

Author SHA1 Message Date
jdp
f98a36d07d Fix a bug in __ivaliduser_sa() which caused some rsh/rlogin attempts
to fail needlessly if a reverse DNS lookup of the IP address didn't
come up with a hostname.  As a comment in the code clearly stated,
the "damn hostname" was looked up only for the purpose of netgroup
matching.  But if that lookup failed, the function bailed out
immediately even though in many cases netgroup matching would not
be used.

This change marks the hostname as unknown but continues.  Where
netgroup matching is performed, an unknown hostname is handled
conservatively.  I.e., for "+@netgroup" (accept) entries an unknown
hostname never matches, and for "-@netgroup" (reject) entries an
unknown hostname always matches.

In the lines affected (only), I also fixed a few bogus casts.  There
are others, and in fact this entire file would be a good candidate
for a cleanup sweep.

Reviewed by:	imp (wearing his flourescent yellow Security Team cap)
MFC after:	2 days
2002-08-24 17:37:42 +00:00
kris
7c3a0284bf &x is not a format string 2002-08-24 07:15:55 +00:00
mike
bd085edd0d Note that <sys/types.h> in no longer a prerequisite for <utime.h> and
<sys/mman.h>.
2002-08-24 00:39:43 +00:00
marcel
004dfe76c0 We cannot use an alloc with only inputs and/or locals. The kernel
assumes that the parameters are passed in output registers. Remove
the alloc entirely, but don't depend on the kernel not trashing
our registers.
2002-08-23 03:47:50 +00:00
jmallett
ceb7453fb1 Wrap the header to prevent multiple inclusion, and mark the DECLS section.
Reminded by:	Rachel Hestilow <hestilow@ximian.com>
2002-08-22 23:35:35 +00:00
pirzyk
8bd034327b Fixed getaddrinfo to honor sortlist in /etc/resolv.conf
PR:		bin/27939
Reviewed by:	ru, sheldonh (about a year ago)
Obtained from:	ume (via KAME, I think)
MFC after:	1 month
2002-08-21 19:57:53 +00:00
phk
4b59b6bb73 s/EDOFUS/EDOOFUS/
Persuaded by:	Google
2002-08-21 17:11:00 +00:00
mike
5d0fbddc4d o Merge <machine/ansi.h> and <machine/types.h> into a new header
called <machine/_types.h>.
o <machine/ansi.h> will continue to live so it can define MD clock
  macros, which are only MD because of gratuitous differences between
  architectures.
o Change all headers to make use of this.  This mainly involves
  changing:
    #ifdef _BSD_FOO_T_
    typedef	_BSD_FOO_T_	foo_t;
    #undef _BSD_FOO_T_
    #endif
  to:
    #ifndef _FOO_T_DECLARED
    typedef	__foo_t	foo_t;
    #define	_FOO_T_DECLARED
    #endif

Concept by:	bde
Reviewed by:	jake, obrien
2002-08-21 16:20:02 +00:00
scottl
f73fe2349f Fix a typo in #if 0 code 2002-08-21 09:30:45 +00:00
tjr
0205a0ffee Add a manual page for wcwidth(). 2002-08-20 03:42:21 +00:00
tjr
6d3cb7bb91 Add a manual page for wcswidth(). 2002-08-20 03:40:45 +00:00
ache
3407d2c811 Move just committed version of wcswidth.c here (from "locale"),
a bit optimized now.
2002-08-20 02:06:28 +00:00
ache
ba87b2c9c7 Remove wcswidth.c from here (and move it to "string") 2002-08-20 01:59:26 +00:00
ache
1419258201 Remove space at the end of continuation line in prev. commit 2002-08-20 01:16:06 +00:00
bde
40d1e3da5b xdr.3 is added to MAN in ../xdr/Makefile.inc where it belongs, so don't
add it here.
2002-08-19 23:06:00 +00:00
ache
76428962f3 Implement wcswidth() 2002-08-19 20:46:10 +00:00
ache
a7d6d1784b Use modern-style arguments declaration 2002-08-19 20:32:27 +00:00
ache
7eeba77736 Write null wide-character as L'\0' like in other places 2002-08-19 20:12:38 +00:00
ache
57b58c92d3 According to SUSv2, always return 0 for null wide-character code 2002-08-19 18:06:18 +00:00
jmallett
23770870e0 s/trailing NULL/trailing NUL/ 2002-08-19 17:14:58 +00:00
ache
78e59f599d Move internal defines from ctype.h here 2002-08-19 09:02:49 +00:00
jmallett
07d5a64349 Leave room for a trailing NUL not a NULL, that's not an ASCII character. 2002-08-19 03:52:36 +00:00
tjr
a4e0bb4130 Implement the ISO C90 Amd.1 restartable wide and multibyte character
manipulation functions mbrlen(), mbrtowc(), mbsinit(), mbsrtowcs(),
wcrtomb(), wcsrtombs().
2002-08-18 06:30:10 +00:00
ache
4a1a05f8fe Move wcwidth() to separate file, it doesn't belong to iswctype.c at all 2002-08-17 20:30:34 +00:00
ache
3083ba69da According to SUSv2, wcwidth() should return -1 for non-printing characters 2002-08-17 20:11:31 +00:00
ache
513ad1189a Cosmetic - remove unneded brackets and #undef 2002-08-17 20:03:44 +00:00
ache
c7e9ed7c15 wcwidth: fix espression to work correctly with SWIDTH0 2002-08-17 14:16:14 +00:00
bmilekic
9ba26ec3bd Fix libc build breakage by defining FSTYPENAMES before including
disklabel.h; broken originally by 1.87 of sys/disklabel.h, which
made the split between DKTYPENAMES and FSTYPENAMES.
Someone who knows disklabel.c: do we still need DKTYPENAMES to be
defined here now?
2002-08-16 15:33:20 +00:00
keichii
7a4eacff03 Add iswctype wcwidth function code
Submitted by:	clkao@clkao.org
Reviewed by:	keichii
Obtained from:	NetBSD
MFC after:	1 month
2002-08-16 13:45:23 +00:00
alfred
f48beb61ce Hide 'struct ucred' behind '#ifdef _KERNEL', this should stop userland
from attempting to use it for good.  There is a catch, kvm_proc.c needs
to '#define _KERNEL' to get at the ucred.

Requested by: rwatson
2002-08-16 07:01:43 +00:00
rwatson
779e9c05c5 Add LOGIN_SETMAC, which will indicate to the user context management code
that it should also set the user's default MAC label, if available and
permitted.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
2002-08-16 02:14:21 +00:00
robert
a834279e5a - Fix a bug that wrote one char behind the end of the
supplied buffer in case the size of it was equal to
   the number of characters the converted address consumed.
   The bug occurred when converting an AF_INET address.
 - Remove the SPRINTF macro and use sprintf instead.
 - Do not do string formatting using sprintf(3) and a
   temporary buffer which is copied when the supplied
   buffer provides enough space.  Instead, use snprintf(3)
   and the real destination buffer, thus avoid the copy.

Reported by:	Stefan Farfeleder <e0026813@stud3.tuwien.ac.at> (1)
PR:		misc/41289
2002-08-15 21:19:31 +00:00
robert
a58570f7e4 Put each function argument on its own line to keep lines shorter
than 80 columns.
2002-08-15 20:33:44 +00:00
robert
2877957282 Use one line for each function argument to keep the line
width smaller than 80 columns.

Thanks to Ruslan for an explanation of multiple ways to
achieve this.
2002-08-15 18:57:57 +00:00
bde
71afe3acf3 Removed duplicated MLINKS which make(1) recently started warning about. 2002-08-15 12:31:01 +00:00
robert
76358c6b3c Include <stdlib.h> to have abort() and exit() declared. 2002-08-15 11:58:24 +00:00
robert
0ed84d70ad - For compliance with IEEE Std 1003.1-2001, add the 'restrict'
qualifier to function prototypes and definitions where
   appropriate using the '__restrict' macro.
 - Update the manual page.
2002-08-15 10:28:52 +00:00
robert
b0383fce7a - Introduce the 'restrict' qualifier to function prototypes and
definitions to comply with IEEE Std 1003.1-2001.
 - Update the manual pages.
2002-08-15 09:47:10 +00:00
robert
4b216b48b0 - Add the 'restrict' qualifier to the function prototypes and
definitions of the functions that convert strings to numbers
   and are defined by IEEE Std 1003-1.2001.
 - Use ANSI-C function definitions for all of the functions
   mentioned above plus strtouq and strtoq.
 - Update the prototypes in the manual pages.
2002-08-15 09:25:04 +00:00
robert
d844847716 - Add the 'restrict' qualifier to the function definitions and
public prototypes of setbuf(3) and setvbuf(3) using the
   '__restrict' macro from <sys/cdefs.h> to be compliant with
   IEEE Std 1003.1-2001.
 - Replace the K&R with ANSI-C function definitions.
 - Bring the manual page up-to-date.
2002-08-14 23:45:42 +00:00
robert
3a77f79d44 - Add the 'restrict' qualifier to the function definition of
strftime(3) for IEEE Std 1003.1-2001 compliance and remove
   excessive usage of the 'const' qualifier that was neither
   present in the prototype in the publice header, nor in the
   local prototype just above the function definition.
 - Replace the K&R function definition with a ANSI-C one.
 - Update the prototype of strftime(3) in its manual page.
2002-08-14 23:20:48 +00:00
robert
3294a7fc5a - Add the 'restrict' qualifier to the definitions of the string
concatenation and copy functions using the '__restrict' macro.
   This is to satisfy IEEE Std 1003-1.2001.
 - Use ANSI-C function definitions.
 - Add the 'restrict' keyword to the manual pages, too.
2002-08-14 22:59:22 +00:00
robert
78711cadb9 - Add the C99 'restrict' qualifier using the '__restrict' macro to
function prototype and definition of strptime(3).
 - Update the manual page.
2002-08-14 22:36:22 +00:00
rwatson
af32c4898e Use "ugidfw.h" rather than <ugidfw.h> so that mkdep can find it.
Suggested by:	mike
2002-08-14 22:30:07 +00:00
robert
f1b53f4d95 - Add the 'restrict' qualifier to match the IEEE Std 1003.1-2001
prototype of the tdelete(3) function.
 - Remove duplicated space.
 - Use an ANSI-C function definition for tdelete(3).
 - Update the manual page.
2002-08-14 21:16:41 +00:00
robert
b9e5cc5c73 - Add the 'restrict' qualifier required by IEEE Std 1003.1-2001
to the function definition of strxfrm(3) in form of our
   '__restrict' macro.
 - Use an ANSI-C function definition for strxfrm(3).
 - Change the manual page accordingly.
2002-08-14 21:01:04 +00:00
robert
3a82d49c05 -Add the restrict required by IEEE Std 1003.1-2001 in form
of our __restrict macro to the prototypes and function
   definitions of inet_pton and inet_ntop.
 - Use ANSI-C function argument lists.
 - Adjust the prototypes in the manual page.
2002-08-14 20:40:35 +00:00
phk
215b234fbc Unbreak one of the most confusing breaks of the tree I've seen.
The last commit cannot possibly have been tested.
2002-08-13 18:55:51 +00:00
ache
6d4f2c4daa Reduce BSS size for programs which not load collate by eliminating
static buffer.
2002-08-13 14:55:17 +00:00
dwmalone
e3390526f7 Use a union to access the words of a double as this is less likely
to cause bugs when gcc is more aggressively optimising things.

There are still problems with dtoa mentioned in the PR - maybe
Dan could suggest a patch.

PR:		40209
Submitted by:	Dan Lukes <dan@obluda.cz>
Approved by:	bde
MFC after:	2 weeks
2002-08-13 14:17:39 +00:00