Commit Graph

1590 Commits

Author SHA1 Message Date
christos e5548b402a Use reach-over sources from common/lib/libc 2005-12-20 19:31:47 +00:00
christos b53fea69d0 Restore the compatibility versions of fts not to do path mangling (i.e.
remove double slashes). Also make sure we free sp in all cases. From yamt,
many thanks!
2005-12-11 04:12:58 +00:00
wiz db45f13c8a Bump date for previous. Remove trailing whitespace. 2005-12-01 18:08:10 +00:00
elad 310e19f394 Change the entry from "foobar" to "not applicable" in the "Changeable"
field of kern.veriexec.count.. no idea how that went unnoticed. :)
2005-12-01 14:45:31 +00:00
christos c341912e62 cleanup casts and KNF. 2005-11-29 13:30:49 +00:00
christos 03256c6e55 WARNS=4 2005-11-29 03:11:58 +00:00
christos 369645b798 ANSI prototypes and function declarations. No functional change. 2005-11-18 16:48:48 +00:00
martin 428522929f Make the MAKEEXTRALIST macro safe to be called with string literals as
third argument - the old version relies on the compiler to use the same
address for identical strings.

Spotted by segv at netctl dot net in libnbcompat context, details
in PR pkg/32097.
2005-11-18 08:32:46 +00:00
christos a109c1ee32 1. minimize code diffs with FreeBSD
2. return ENAMETOOLONG instead of ENOMEM if name is too long to fit.
3. only decrement cp if we are pointing to the end of the string.
   [this fixes the cp truncation of the last char problem reported]
2005-11-17 19:13:20 +00:00
christos fd85feb124 Fix the code example. 2005-11-10 17:23:26 +00:00
christos 2ce4c16c0d Instead of special-casing root, special case paths that end with a /, so
that find foo/ does not print foo//bar. From FreeBSD.
2005-10-22 20:55:13 +00:00
christos 641784aa2a Don't hide the error from sysctl. From Liam Foy. 2005-10-14 23:53:41 +00:00
simonb 9e2441db78 Add a full-stop to the end of a sentence. 2005-10-06 13:45:12 +00:00
wiz 77a08e3909 Fix typo. Add some commas. Improve markup. 2005-10-06 11:17:11 +00:00
elad 8358410265 Document security level for sysctl and security.curtain.
Hi Hubert! :)
2005-10-03 22:22:10 +00:00
wiz 5219255abf getfsent(3) does not contain any information about the (nonexisting)
function getfstype(), so don't MLINK it. Remove getfstype from other
places that reference it too.

Noted by jmc@openbsd.
2005-10-03 14:56:32 +00:00
christos fbd01002b3 Make sure that setmode sets errno on failure (it used to return a random
errno) and document it.
2005-10-01 20:08:01 +00:00
wiz 72a37764e0 Punctuation nits; grammar fix. 2005-09-26 10:54:46 +00:00
christos 1c208b995b ttyname_r returns int. 2005-09-25 20:43:54 +00:00
christos cc85a7cfd9 add getenv_r and ttyname_r 2005-09-25 20:08:01 +00:00
rpaulo 6f844bf524 Document kern.hardclock_ticks. Pointed out by Hubert. 2005-09-24 12:05:45 +00:00
elad 6ed9366c27 Don't overflow when DEBUG is defined.
PR/30833, from Tomas Skare.
2005-09-13 21:38:03 +00:00
christos 95a8d0876b don't use the weak names directly, so that the compat code works. 2005-09-13 13:51:50 +00:00
christos 5b84b3983f compat core reorg. 2005-09-13 01:44:08 +00:00
christos 3303764533 64 bit inode changes 2005-08-19 02:04:54 +00:00
elad ccdc56641c Make this compile again (remove unused serrno).
Noted by uwe@.
2005-08-13 21:16:58 +00:00
elad 314b003dee Don't allow last path element to be nonexistant. 2005-08-13 19:53:53 +00:00
christos 86741d79ab - Fix the remaining indr_references so that they define lint symbols.
- Add an internal symbol for strerror_r (thanks klaus for noticing)
- Remove internal __strerror
2005-07-30 15:21:20 +00:00
christos e7adb37afc PR/30832: Tomas Skäre: Freed memory used in lib/libc/getnetgrent.c
While there, KNF and ansify.
2005-07-25 14:38:48 +00:00
rpaulo 25a6efd600 Fix another sigignore -> sigset typo.
ok klenik@, hubertf@
2005-07-24 21:58:32 +00:00
isaki e70e55fa02 Correct a typo. 2005-07-17 05:06:57 +00:00
christos c13c780daf Ignore indirect references when linting.
XXX: All this is done backwards, and is a mess. Really the _foo.c files should
include the _foo function definition, not the foo.c files, like everywhere
else.
2005-07-16 18:01:38 +00:00
christos 47bfe475f7 Add missing _. 2005-07-16 18:00:40 +00:00
enami 8bf4305eee Fixes to previous:
- Don't handle single and multiple slashes differently.
- A symlink to a directory can be appear in the middle of path.  Don't
  reject it.
2005-07-05 02:56:12 +00:00
elad 0b9ed39b26 Make realpath(3) work correctly.
The current code resolves paths like `/foo/bar/', `/foo/bar/./', and
`/foo/bar/../', even if `bar' is a regular file and not a directory.

Reviewed by cube@.
2005-07-04 20:44:47 +00:00
he 0ec45ddeab Fix the toolification of disklabel by using the nbinclude namespace
under HAVE_NBTOOL_CONFIG_H for disktab.h as well.  This means
disktab.h has to be installed in the nbinclude include directory.

(Failure mode: with TOOLDIR as a subdirectory of /usr, the host's disktab.h
got picked up, and not the in-tree copy.)

Reviewed by dyoung.
2005-06-22 21:35:28 +00:00
elad 0e4dfe1792 - Use more calls to veriexec_report() where possible.
- Change #ifdef VERIFIED_EXEC_VERBOSE to another verbose level, 2. Add
  sysctl(3) bits.

- Simplify access type conflict handling during load. This depends on
  the values of access type defines to be ordered from least to most
  'strict'.
2005-06-20 15:06:18 +00:00
wiz f076596bae New sentence, new line. 2005-06-17 18:19:39 +00:00
peter 9231683ec7 Fix some spelling errors.
From Igor Sobrado in PR/29997.
2005-06-17 18:08:00 +00:00
elad ad7b01f7d0 More veriexec changes:
- Better organize strict level. Now we have 4 levels:
  - Level 0, learning mode: Warnings only about anything that might've
      resulted in 'access denied' or similar in a higher strict level.

  - Level 1, IDS mode:
    - Deny access on fingerprint mismatch.
    - Deny modification of veriexec tables.

  - Level 2, IPS mode:
    - All implications of strict level 1.
    - Deny write access to monitored files.
    - Prevent removal of monitored files.
    - Enforce access type - 'direct', 'indirect', or 'file'.

  - Level 3, lockdown mode:
    - All implications of strict level 2.
    - Prevent creation of new files.
    - Deny access to non-monitored files.

- Update sysctl(3) man-page with above. (date bumped too :)

- Remove FINGERPRINT_INDIRECT from possible fp_status values; it's no
  longer needed.

- Simplify veriexec_removechk() in light of new strict level policies.

- Eliminate use of 'securelevel'; veriexec now behaves according to
  its strict level only.
2005-06-17 17:46:18 +00:00
enami cdc60944c2 Changes done in rev. 1.21 of getcap.3 (former name of this file) is
not correct since, as far as reading the source, it is impossible for
cgetset() to set such errno.  I guess `seq' is not a typo of `set' but
abbreviation of `sequen...'.
2005-06-17 02:10:45 +00:00
dyoung a37289db57 Make disklabel(8) and fdisk(8) into "host tools " last step: build
and install ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-disklabel,
${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-fdisk by "reaching over" to
the sources in ${NETBSDSRCDIR}/sbin/{disklabel fdisk}/.

To avoid clashes with a build-host's header files, especially on
*BSD, the host-tools versions of fdisk and disklabel search for
#includes such as disklabel.h, disklabel_acorn.h, disklabel_gpt.h,
and bootinfo.h in a new #includes namespace, nbinclude/.  That is,
they #include <nbinclude/sys/disklabel.h>, <nbinclude/machine/disklabel.h>,
<nbinclude/sparc64/disklabel.h>, instead of <sys/disklabel.h> and
such.  I have also updated the system headers to #include from
nbinclude/-space when HAVE_NBTOOL_CONFIG_H is #defined.
2005-06-12 19:46:15 +00:00
lukem aaf2af9078 Add missing __RCSID() 2005-06-12 05:34:34 +00:00
lukem 88c3eadbfa Add missing __RCSID() 2005-06-12 05:21:25 +00:00
lukem e82ae39d67 Cosmetic tweak previous; IMHO we don't need the XXX comment in this
case, since I prefer to NULL initialize variables in this situation.
2005-06-05 01:15:29 +00:00
he 0d43148fcf Add an initialization to appease -Wuninitialized. Apparently the
sparc64 compiler gets this wrong.
2005-06-04 22:14:00 +00:00
wiz 2b67bf1d7d Bump date for previous. 2005-06-04 00:39:26 +00:00
lukem d999a32485 Ensure that we don't try to free random memory when another malloc fails,
by initializing newprepare, newparent, and newchild to NULL.
Detected by gcc -Wuninitialized.
2005-06-01 05:30:54 +00:00
lukem b8fe389b4c Exit via the correct cleanup path; we can't munmap until the mmap has
been performed.
Detected with gcc -Wuninitialized.
(The bug was introduced in rev 1.22. Hi Ragge! :)
2005-06-01 05:24:54 +00:00
lukem 178e201b11 appease gcc -Wuninitialized 2005-06-01 04:38:40 +00:00
lukem f162f2532e convert to ANSI prototypes. some KNF 2005-05-28 13:11:14 +00:00
lukem af98cf1789 missed a free(3) in previous 2005-05-28 13:06:14 +00:00
lukem b7289610e1 Use malloc(3) instead of the non-standard alloca(3) in MAKEEXTRALIST(),
check the return value of malloc(3) and return "" (or equiv) upon failure,
and free the result of the malloc(3).
2005-05-28 12:57:48 +00:00
wiz 5165223fca Bump date for standards. 2005-05-25 10:05:22 +00:00
wiz 7ebb6744fd <> -> Aq. 2005-05-25 10:04:37 +00:00
kleink c0b528fad0 Truth, meet standards section. Standards section, meet truth. 2005-05-24 18:01:36 +00:00
wiz e01d6f96c3 New sentence, new line. <> -> Aq. Bump date for previous. 2005-05-24 15:58:11 +00:00
elad 6755bac719 Add man-page bits about the 'count' node. 2005-05-24 15:47:46 +00:00
lukem 47d12f36e7 Use a more standard TNF license (than one that has clause 3 for UCB
& refers to "THE REGENTS").
Confirmed with Lex, who added it.
2005-05-20 01:22:48 +00:00
elad 5888b16eef Some changes in veriexec.
New features:

  - Add a veriexec_report() routine to make most reporting consistent and
    remove some common code.
  - Add 'strict' mode that controls how veriexec behaves.
  - Add sysctl knobs:
     o kern.veriexec.verbose controls verbosity levels. Value: 0, 1.
     o kern.veriexec.strict controls strict level. Values: 0, 1, 2. See
       documentation in sysctl(3) for details.
     o kern.veriexec.algorithms returns a string with a space separated
       list of supported hashing algorithms in veriexec.
  - Updated documentation in man pages for sysctl(3) and sysctl(8).

Bug fixes:

  - veriexec_removechk(): Code cleanup + handle FINGERPRINT_NOTEVAL
    correctly.
  - exec_script(): Don't pass 0 as flag when executing a script; use the
    defined VERIEXEC_INDIRECT - which is 1. Makes indirect execution
    enforcement work.
  - Fix some printing formats and types..
2005-05-19 20:16:19 +00:00
peter 838f5a9f71 - setmode() can fail on strtol(3); note this.
- Use .Va for errno.
2005-05-17 21:54:06 +00:00
lukem 9704a33c9a Remove clause 3 from the UCB license.
XXX: the separate TNF copyright block should be converted to a standard TNF one
2005-05-16 13:13:12 +00:00
lukem a1273fe760 More whitespace consistency tweaks 2005-05-16 11:42:04 +00:00
lukem 248b38c348 Whitespace consistency fixes. 2005-05-16 11:40:16 +00:00
christos d1ca0533bf make sure ty_class is cleared on each entry. 2005-05-14 15:43:47 +00:00
perry d2b93fe0e9 cross reference script.7 2005-05-07 02:38:41 +00:00
rillig 1990d26431 Converted all arguments for the <ctype.h> functions to (unsigned char).
Fixes PR 21165. Approved by christos.
2005-04-19 16:33:53 +00:00
wiz d82b36f1ee Add a comma for readability. 2005-04-19 10:00:50 +00:00
lukem 9fcbc80387 When sequentially parsing a source looking for entries don't fail with
NS_UNAVAIL on an unparseable or too long line; instead try the next entry.
This is more consistent with the behaviour prior to the rework in rev 1.49.
2005-04-19 05:27:58 +00:00
lukem 2662d7cbb4 Clarify getgr*_r() return value when entry isn't found.
Improve markup of various constants.
2005-04-19 04:38:04 +00:00
lukem 77c203997c remove bogus punctuation 2005-04-19 04:32:58 +00:00
lukem f948a874e7 Clarify getpw*_r() return value when entry isn't found.
Improve markup of various constants.
2005-04-19 04:26:16 +00:00
christos eea147d9f9 check for pwd != NULL 2005-04-19 03:20:50 +00:00
lukem d0388cff8b getgrent():
Return the correct result. (broken in rev 1.56 -- Hi Christos!)

getgr{ent,nam,uid}_r():
Return 0 "entry not found" and errno for other failures.
("entry not found" still sets *result to NULL).

Various backends:
don't set the retval to errno (or modify errno) for NS_NOTFOUND.

Per discussion with Klaus Klein.
2005-04-19 03:00:12 +00:00
lukem 443af068fa getpw{ent,nam,uid}_r():
Return 0 "entry not found" and errno for other failures.
("entry not found" still sets *result to NULL).

Various backends:
don't set the retval to errno (or modify errno) for NS_NOTFOUND.

Per discussion with Klaus Klein.
2005-04-19 02:49:00 +00:00
christos 0de6393bd4 PR/21165: Christian Biere: ctype function misuse 2005-04-17 17:27:11 +00:00
kleink b2cb7fcd8a Push back the descriptions of NaN formats, and descriptions of the
distinction between signalling NaNs and quiet NaNs back into the
machine-dependent headers; treat the implementation of __nanf in the
same spirit.

IEEE 754 leaves the distinction between signalling NaNs and quiet NANs
to the implementation, and unlike our headers used to suggest they're
not identical in the interpretation of the fraction's MSb; in due
course, make those of hppa, mips, sh3, and sh5 reflect reality.
2005-04-15 22:39:10 +00:00
drochner 179747d76c getmntinfo() if a compatibility function, so there is no point in hiding
references to the compatibility getfsstat()
The real problem behind PR lib/29919 was a stale weak_alias, so back out
the workaround.
2005-04-12 21:36:46 +00:00
drochner ec387481a6 the real reason behind PR lib/29919 was that there was a __weak_alias,
obviously copied from getmntinfo.c, referencing the compatibility
getmntinfo()
2005-04-12 20:49:19 +00:00
wiz 37172421f7 Adapt .Dt argument for man page renaming, and use more macros. 2005-04-12 17:04:46 +00:00
drochner a00e491cf3 Both libcurses and libc installed a getcap(3) manpage, and both used it
as target for a bunch of MLINKS. This had the effect that whatever came
last in install overwrote everything from the other camp.
Solve this by renaming the libc page -- this makes sense because no
function is really named "getcap" here.
2005-04-12 16:27:42 +00:00
drochner 4ba6a2ab76 this should refer to "cgetset", not "cgetseq" 2005-04-12 16:11:33 +00:00
wiz f5d4b0a380 Remove duplicate word, from Wojciech A. Koszek in PR 29938. 2005-04-11 12:19:16 +00:00
dsl 8386db0625 Change some integral types, long => clock_t.
IIRC this stops some warnings on 64bit systems
2005-04-09 12:52:54 +00:00
dsl 6d9a96dfb2 KNF 2005-04-09 12:48:58 +00:00
atatat 7f2367785b Mention that the number after CTL_NET is "usually the protocol", but
may not be (see net.bpf).
2005-04-09 02:03:36 +00:00
christos 67d11513a6 PR/29919: Evaldo Gardenali: getmntinfo() calling deprecated function getfsstat()
Fixed by defining an _getfsstat() internal function and calling that instead.
2005-04-07 16:24:18 +00:00
kleink fb03db1761 Fix typo in previous. 2005-04-05 15:46:18 +00:00
christos 23f760bbb6 mlinks for get{gr,pw}ent_r.3 2005-04-04 20:35:31 +00:00
wiz aed63b5317 Use Dq macro; end sentence with a dot; break line
differently so that abbreviation dot is not interpreted as line-ending dot.
2005-04-04 18:26:19 +00:00
wiz e9c5ce35a3 Remove superfluous comma. 2005-04-04 18:24:21 +00:00
christos f6d9547d6f Describe get{pw,gr}ent_r. XXX: Are they in any standards? 2005-04-04 14:19:55 +00:00
christos 184974e05a PR/29849, PR/29850: Add getpwent_r and getgrent_r 2005-04-02 04:53:53 +00:00
lukem 7f46de1e4e tweak comment reminding us about lack of reentrancy 2005-03-31 23:58:28 +00:00
wiz 0ef0d9cbc7 Drop trailing whitespace. 2005-03-31 11:44:26 +00:00
christos a075f0f32c Document the return values of the _r functions. 2005-03-31 04:17:05 +00:00
christos ae82b1bd49 detect when this is used as a tool and don't use the _r getpw functions. 2005-03-31 00:05:02 +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
yamt 73a5d8f913 s of sack is selective, not selection. pointed by Michael Eriksson. 2005-03-30 11:09:16 +00:00
wiz 1c3ab7213e Wording improvements, from yamt@ 2005-03-22 01:43:31 +00:00