Commit Graph

3996 Commits

Author SHA1 Message Date
Matthew N. Dodd
4161ee3d26 Document VM86_INTCALL.
Submitted by:	 Bruce M Simpson
2003-04-29 08:35:28 +00:00
Robert Drehmel
da0db726f7 Replace the return value of rfork_thread(3) in its manual page
function prototype with `pid_t' to match the declaration in
<unistd.h>.
2003-04-27 21:07:27 +00:00
Robert Drehmel
d1c2c89dd2 Correct the return value of vfork(2) and rfork(2) in their
manual page function prototypes.
2003-04-27 21:01:34 +00:00
Robert Watson
2715ba4892 Add some strategic whitespace. 2003-04-26 03:32:18 +00:00
Jacques Vidrine
c14d379de1 When using `compat' mode, be sure to re-dispatch setpwent, endpwent,
setgrent, and endgrent also.  (The previous NSS implementation used to
simply twiddle the internal data of the various modules directly.)

A symptom (group list set incorrectly in sshd) was
Reported by:	Glenn Johnson <gjohnson@srrc.ars.usda.gov>

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-25 18:25:19 +00:00
Jacques Vidrine
e2527daf1a In compat mode, we `redispatch' the lookup. It is probably a good
idea to re-initialize `struct passwd', because e.g. pw_class might
get set by one module, but not by another.  Add another call to the
internal pwd_init function to accomplish this.

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-24 23:56:58 +00:00
Jacques Vidrine
0030cba4aa Catch up with nsdispatch.c: nsdispatch(3) is now `hidden' by
namespace.h.

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-24 20:16:21 +00:00
Jacques Vidrine
43f9b2521d Don't complain about missing NSS methods when built statically. It is
annoying and not very useful.

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-24 19:57:31 +00:00
Jacques Vidrine
c5774e2d30 Catch up with nsdispatch.c: nsdispatch(3) is now `hidden' by
namespace.h.

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-24 18:05:48 +00:00
Jacques Vidrine
20e0e084e7 Catch up with nsdispatch.c: nsdispatch(3) is now `hidden' by
namespace.h.

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-24 17:41:20 +00:00
Jacques Vidrine
5460b1abd2 ``Strong typing is a crutch for people with weak memories.''
Correct a bug that should have wreaked havoc everywhere, but for
some reason only bit unlucky people who use `-march' optimizations.
The compiler cannot assist one in distinguishing between the two
function calls below.

   int nsdispatch(void *, ...);
   void *discard;

   nsdispatch(&discard, ...);  /* correct .. no, really! */
   nsdispatch(discard, ...);   /* Boom                   */

Robin provided me with a debugging environment in which I could see
what was going on.

Badness when using CPUTYPE was
Reported by:	"Robin P. Blanchard" <Robin.Blanchard@gactr.uga.edu>
Reported by:	nork

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-22 22:19:05 +00:00
Jacques Vidrine
905ec0db3b Correct a bug that was somehow both obvious and hard-to-see. :-)
An incorrectly-sized allocation was being made due to an incorrect
argument to the `sizeof' operator.  Obvious, because it violated the
`foo = malloc(sizeof(*foo))' idiom.  Hard-to-see, because it was a
missing `*' (`*p' versus `**p').

Resulting failure was
Reported by:	ache

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-21 15:44:25 +00:00
Jacques Vidrine
d3fc864f93 Don't try to access the NIS `master' maps unless we have superuser
privileges.  To do so may cause the NIS server to log spurious and
annoying `access denied' messages.

Reported by:	Philip Paeps <philip@paeps.cx>
Sponsored by:	DARPA, Network Associates Laboratories
2003-04-21 13:57:58 +00:00
Robert Watson
8aa884cb01 Add FILES section to mac.3 and mac.conf.5. Properly Xref mac.conf.5
from mac.3; likewise, mac.conf.5 from mac_prepare.3.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-04-20 04:43:56 +00:00
Robert Watson
781a15a533 Add a man page for the mac.conf MAC library configuration file.
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-04-20 03:18:44 +00:00
Robert Watson
23408b001b Add the mac_prepare{,_*}() functions to the high-level function list
in the mac.3 library man page.  They were already cross-referenced
at the end of the man page, just not explicitly listed here.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-04-20 02:56:16 +00:00
Jacques Vidrine
43652a6ba6 Repair a bug in which a faulty group entry (one with only 2 colons)
would result in an incorrectly terminated grouplist.

login(1) crashes
Reported by:	Morten Rodal <morten@rodal.no>,
		Matthias Schuendehuette <msch@snafu.de>
2003-04-20 01:12:00 +00:00
David Schultz
1f2a0cdf58 %E-like %g and %G conversions should remove trailing zeroes unless
the # flag is present.  Implement this behavior and add a comment
describing it.

Noticed by:	Enache Adrian <enache@rdslink.ro>
Pointy hat to:	das
2003-04-19 23:53:19 +00:00
Jacques Vidrine
171614bfd6 Follow-up to revision 1.74: Using the result buffer to store our empty
string was an incredibly dumb idea (of course it will be changed by an
NSS module on success!).  Use a static empty string instead.

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-18 22:07:30 +00:00
Jacques Vidrine
a9ceaa9dc8 Follow-up to revision 1.73: set _PWF_FILES when `compat' source is used
but user is found in local file.

Reported by:	Shizuka Kudo <shizukakudo_99@yahoo.com>
Sponsored by:	DARPA, Network Associates Laboratories
2003-04-18 21:13:35 +00:00
Jacques Vidrine
4c3c0fecae Don't use `memset' to initialize a struct passwd. A module
may not fill in all fields, and in the case of string fields, this could
cause trouble for applications.  (The only likely example is `pw_class',
because this field is not used by all modules in all cases.)

Move initialization of struct passwd from module-specific code to the
dispatch code.

The problem of a NULL pw_class was
Noticed by:	Philip Paeps <philip@paeps.cx>
                    and the c^Htrusty ssh(1) command.
Déjà vu by:	getpwent.c revision 1.56

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-18 17:27:05 +00:00
Jacques Vidrine
71cc8f0764 Correctly set _PWF_FILES in pw_fields when appropriate.
(_PWF_NIS and _PWF_HESIOD were already being set.)

Reported by:	Shizuka Kudo <shizukakudo_99@yahoo.com>
Sponsored by:	DARPA, Network Associates Laboratories
2003-04-18 16:24:25 +00:00
Jacques Vidrine
b4603f3dd4 Revert the definitions of _PW_KEY* to their previous values. There is
at least one consumer outside of libc and pwd_mkdb.
Adjust the versioning in libc and pwd_mkdb accordingly.

named was the application affected, and that fact was first
Reported by:	Zherdev Anatoly <tolyar@mx.ru>

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-18 14:11:17 +00:00
Jacques Vidrine
1b467db206 The default if nsswitch.conf(5) is not present is supposed to be the
hated `compat' source, not `files'.

Reported by:	Philip Paeps <philip@paeps.cx>
Sponsored by:	DARPA, Network Associates Laboratories
2003-04-18 01:00:37 +00:00
Tom Rhodes
59ac15c152 Add a manual page for the ntp_gettime syscall.
Reviewed by:	ru, phk (older version).
2003-04-17 18:39:30 +00:00
Jacques Vidrine
05f98035ee = Implement thread-safe versions of the getpwent(3) and getgrent(3)
family of functions using the new nsdispatch(3) core.  Remove
  arbitrary size limits when using the thread-safe versions.

= Re-implement the traditional getpwent(3)/getgrent(3) functions on
  top of the thread-safe versions.

= Update the on-disk format of the hashed version of the passwd(5)
  databases to allow for versioned entries.  The legacy version is
  `3'.  (Don't ask.)

= Add support for version `4' entries in the passwd(5) database.
  Entries in this format are identical to version 3 entries except
  that all integers are stored as 32-bit integers in network byte
  order (big endian).

= pwd_mkdb is updated to generate both version 3 and version 4
  entries.

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-17 14:15:26 +00:00
Jacques Vidrine
46d9306383 = Implement name service switch modules (NSS modules). NSS modules
may be built into libc (`static NSS modules') or dynamically loaded
  via dlopen (`dynamic NSS modules').  Modules are loaded/initialized
  at configuration time (i.e.  when nsdispatch is called and nsswitch.conf
  is read or re-read).

= Make the nsdispatch(3) core thread-safe.

= New status code for nsdispatch(3) `NS_RETURN', currently used to
  signal ERANGE-type issues.

= syslog(3) problems, don't warn/err/abort.

= Try harder to avoid namespace pollution.

= Implement some shims to assist in porting NSS modules written for
  the GNU C Library nsswitch interface.

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-17 14:14:22 +00:00
Robert Watson
ecf889825d Clarify the relationship between the MAC library APIs and POSIX.1e:
they resemble one another, but POSIX.1e interfaces were not sufficiently
expressive to do what we needed.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-04-16 20:40:34 +00:00
Tom Rhodes
7456d3c673 Add a manual page for the ntp_adjtime syscall.
PR:		32674
Reviewed by:	phk, ru
2003-04-15 15:42:10 +00:00
Tim J. Robbins
d73c448b1c Merge in vfprintf.c rev. 1.58. 2003-04-14 12:15:59 +00:00
David Schultz
81ae2e9a4d Fix a bug where printf was erroneously printing a decimal point for
%f and sufficiently short %g specifiers where the precision was
explicitly zero, no '#' flag was specified, and the floating point
argument was > 0 and <= 0.5.  While at it, add some comments to better
explain the relevant bits of code.

Noticed by:	Christoph Kukulies <kuku@physik.rwth-aachen.de>
2003-04-14 11:24:53 +00:00
Tim J. Robbins
a40248455d Return "/boot/kernel/kernel" instead of "/kernel" if the sysctl() call
fails. The documentation was incorrectly updated in getbootfile.3 rev. 1.10.
2003-04-11 13:54:28 +00:00
Tim J. Robbins
e3e8878435 When called with s == NULL, behave as if wc == L'\0' as required by the
standard.
2003-04-10 09:20:38 +00:00
David Schultz
fad677445e /strtopx/ s/result/&result/
This is the version I *meant* to commit last week.
2003-04-09 05:58:43 +00:00
Mike Barcroft
fd7a8150fb o In struct prison, add an allprison linked list of prisons (protected
by allprison_mtx), a unique prison/jail identifier field, two path
  fields (pr_path for reporting and pr_root vnode instance) to store
  the chroot() point of each jail.
o Add jail_attach(2) to allow a process to bind to an existing jail.
o Add change_root() to perform the chroot operation on a specified
  vnode.
o Generalize change_dir() to accept a vnode, and move namei() calls
  to callers of change_dir().
o Add a new sysctl (security.jail.list) which is a group of
  struct xprison instances that represent a snapshot of active jails.

Reviewed by:	rwatson, tjr
2003-04-09 02:55:18 +00:00
Matthew N. Dodd
196f440aa2 Bump the date. 2003-04-07 22:59:12 +00:00
Matthew N. Dodd
564b641ef9 Clarify the behavior of PATH_FSTAB with regard to 'tainted' execution.
Requested by:	 ru
2003-04-07 14:21:14 +00:00
Matthew N. Dodd
134dbc4c32 - Add setfstab() and getfstab().
- Use the environment variable 'PATH_FSTAB' if set rather than the
  hardcoded '/etc/fstab' (fstab.h:_PATH_FSTAB)
2003-04-07 12:55:00 +00:00
Tim J. Robbins
adfd6b312d Catch up with recent vfprintf.c changes. 2003-04-07 06:36:49 +00:00
Andrey A. Chernov
6f098a4811 __wcsconv(): free(convbuf) before returning NULL 2003-04-07 03:17:39 +00:00
David Schultz
d890afb84d Today just isn't my day. Remove some old commented out code that snuck
into the last commit.

Noticed by:	mike
2003-04-07 01:07:48 +00:00
David Schultz
3b204b7d09 - %e conversions with precision 0 should not cause a decimal point to
be printed.
- Fix %f conversions where the number of significant digits is < expt.
  This would be a one-line change were it not for thousands separators.
  Noticed by tjr.
- Remove some unnecessary code in the parsing of precision specifiers.
2003-04-07 00:42:19 +00:00
David Schultz
ebbad5ec5c Rework the floating point code in printf(). Significant changes:
- We used to round long double arguments to double.  Now we print
  them properly.

- Bugs involving '%F', corner cases of '#' and 'g' format
  specifiers, and the '.*' precision specifier have been
  fixed.

- Added support for the "'" specifier to print thousands' grouping
  characters in a locale-dependent manner.

- Implement the __vfprintf() side of hexadecimal floating point
  support.  All that is still needed is a routine to convert the
  mantissa to hex digits one nibble at a time in the style of ultoa().

Reviewed by:	silence on standards@
2003-04-05 22:11:42 +00:00
David Schultz
92b93b37c0 Add __ldtoa(), a wrapper around gdtoa() to make it look like dtoa().
In support of this, add some MD macros to assist in converting long
doubles to the format expected by gdtoa().

Reviewed by:	silence on standards@
2003-04-05 22:10:13 +00:00
David Schultz
b936664e72 Add missing #include to unbreak previous commit. 2003-04-05 22:08:53 +00:00
David Schultz
38cac8f88b Correct some buffer sizes.
- __vfprintf()'s 'buf' has never been used for floating point, so
  don't define it in terms of (incorrect) constants describing
  floating point numbers.  The actual size needed depends on
  sizeof(uintmax_t) and locale details, so I slightly overestimated.

- We don't need a 308-character buffer to store the string "308".
  With long doubles and %a we need more than three characters, though.
2003-04-05 22:03:43 +00:00
Tim J. Robbins
63e6ca586e MFp4: Link strtof.3 and strtold.3 to strtod.3. 2003-04-05 07:33:46 +00:00
Mike Makonnen
f23f149866 Zero out the struct tm supplied by the caller. Otherwise,
strange things might happen when garbage values in the struct
get passed in to localtime_r() and family.

Noticed by:	marcus
Approved by:	markm (mentor)(implicit)
2003-04-05 05:46:43 +00:00
Tim J. Robbins
799d93559b MFp4: Pentium/Athlon-optimised implementation of wcschr(). 2003-04-05 04:17:05 +00:00
Jake Burkholder
9f5a511863 Implement makecontext. 2003-04-01 23:28:50 +00:00