Commit Graph

153 Commits

Author SHA1 Message Date
Joshua Peck Macdonald
8098023dde Added a note about the return value. Its been so long I can't
remember who suggested the 'caveat' section.  Sorry.
1996-04-05 05:35:57 +00:00
Bruce Evans
0b50c8d653 stat() before open() because opening of special files may be harmful. 1996-03-29 12:55:54 +00:00
Andrey A. Chernov
81c280f58f Back out one of my previous changes: don't clear PARODD,
so return to absolute minimum of changed flags now
1996-03-28 13:33:18 +00:00
Andrey A. Chernov
9909e796b9 cfmakeraw:
clear PARODD bit too, help user program to set its own
parity via |
Set CREAD bit, it is 99% case
1996-03-27 21:29:32 +00:00
Mike Pritchard
064f007493 Added missing section numbers to a bunch of .Xr macros, or
converted them into .Fn macros where appropriate.  Also fixed
up some minor formatting problems.
1996-03-27 20:49:07 +00:00
Andrey A. Chernov
fe5fcbc78f Convert int to uchar range for ctype 1996-03-25 14:32:30 +00:00
Bruce Evans
7041dd8c4b alarm -> ualarm. 1996-03-19 13:53:00 +00:00
Bruce Evans
cc0ea3465d Updated a type to match Lite2's fixed-width type changes.
Added $Id$.

Obtained from:	4.4BSD-Lite2
1996-03-19 13:44:57 +00:00
Jeffrey Hsu
4b10cdbc3d From Lite2: rename fs to vfs. 1996-03-11 03:08:51 +00:00
Jeffrey Hsu
782ff9b2f0 From Lite2: rename fs to vfs. 1996-03-11 03:06:45 +00:00
David Greenman
1821ce26bf Implemented negative caching on uid/gid lookup failures. This won't
matter much on some systems, but on ftp servers (like wcarchive) where
you run with special stripped group and pwd.db files in the anonymous
ftp /etc, this can be a major speedup for ls(1).
1996-03-05 13:11:42 +00:00
Peter Wemm
7e6ace8561 If the send() to the AF_UNIX socket to the syslogd fails, attempt to
reconnect once using the saved openlog() parameters.

This helps one of the system startup race conditions. If syslogd takes too
long to get going, some daemons can fail the connection and forever log
to the console even though the syslogd is running.  That is ..unfortunate..
1996-03-02 19:56:16 +00:00
Peter Wemm
7350dd84a0 If the two recently added sysctl variables exist, use those rather than
the statically compiled PS_STRINGS and USRSTACK variables.  This prevents
programs using setproctitle from coredumping if the kernel VM is increased,
and stops libkvm users (w, ps, etc) from needing to be recompiled if only
the VM layout changes.
1996-02-24 14:37:30 +00:00
Wolfram Schneider
4885b56627 man page links
fts_open.3 -> fts.3
fts_read.3 -> fts.3
fts_children.3 -> fts.3
fts_close.3 -> fts.3
1996-02-18 01:56:51 +00:00
John Polstra
7a6b3357af Corrected a couple of errors in the fts(3) manual page. The prototype
for "fts_open" was wrong.  Also, the "fts_info" field of the FTSENT
structure was misleadingly described as containing "flags".  Actually, it
contains a single integer value.
1996-02-15 21:48:54 +00:00
Mike Pritchard
e1f4e80c88 Fixed a bunch of man page cross references that were
in the main text of various man pages.

Thanks to Warner Losh for adding an option to manck to allow
it to scan the entire man page looking for bogus xrefs, instead
of just checking the SEE ALSO section.
1996-02-15 20:07:05 +00:00
Mike Pritchard
5f6bedf2ac Correct the xref for msgctl: msgctl(2) -> msgctl(3) 1996-02-12 07:06:23 +00:00
Mike Pritchard
2375385da1 Added man pages for msgctl(3), msgget(3), msgrcv(3) and msgsnd(3).
Obtained from: NetBSD
1996-02-12 07:03:24 +00:00
Mike Pritchard
bcff8e2ae4 Another round of man page cleanups.
Down to only about 100 items left to cleanup! :-)
1996-02-12 04:57:03 +00:00
Mike Pritchard
78b0b234eb Correct a bunch of man page cross references and generally
try and silence "manck".

ncurses, rpc, and some of the gnu stuff are still a big mess, however.
1996-02-11 22:38:05 +00:00
Mike Pritchard
c211e812bb Added some missing MLINKS for section 3 man pages.
Also corrected a few minor formatting errors, file location and cross
references in some of the section 3 man pages.

This shuts up a lot of the output from "manck" for section 3.
1996-02-09 00:45:45 +00:00
Mike Pritchard
e2cc67ef3c Another round of spelling fixes. 1996-01-30 18:13:11 +00:00
Mike Pritchard
a5ed710ccd Fix even more spelling errors in some more man pages. 1996-01-30 16:34:52 +00:00
Mike Pritchard
70520b51b9 Getpwent() and getservent() can wind up calling free() with
an invalid pointer if a call to yp_first() fails.  Closes PR # 964,
and possibly # 952.
1996-01-29 20:16:30 +00:00
Mike Pritchard
86cfd0dd41 Changed the description of SIGSYS to better reflect what
it means when that signal is received.  Closes PR# 686.
1996-01-22 12:31:15 +00:00
Julian Elischer
aaf0927a09 Obtained from: uthreads package 1996-01-22 00:32:08 +00:00
Julian Elischer
f70177e76e Reviewed by: julian and (hsu?)
Submitted by:	 John Birrel(L?)

changes for threadsafe operations
1996-01-22 00:02:33 +00:00
Peter Wemm
3b7e1cc80f Bump libutil revision after recent addition of setproctitle().
Install (optional) libutil.h with prototypes for the functions and
document this in the man page.

minor cleanups to the various routines, include the prototype file, declare
return codes etc.
1996-01-01 08:27:41 +00:00
Joerg Wunsch
7560bb26ff Finally complete my fix for the behaviour of getpass(3) upon receipt
of signals.  Signals are now properly caught, tty state is being
restored, and the previous sigaction triggered.  Upon receipt of a
sigcont, echo is turned off again.

SIGTSTP causes a buffer flush, the man page mentions this.  (Although
i rather think of it as a feature than a bug.)

This is likely to be my last FreeBSD action for 1995, xearth shows
me that our .au guys must already write 1996. :-)
1995-12-31 14:00:25 +00:00
Peter Wemm
6065a0be11 This commit was generated by cvs2svn to compensate for changes in r13122,
which included commits to RCS files with non-trunk default branches.
1995-12-30 19:02:48 +00:00
Joerg Wunsch
5237ee4167 Don't block SIGINT in getpass(3); this doesn't make sense. 1995-12-27 23:23:00 +00:00
Peter Wemm
0050777196 Bring in an initial version of setproctitle().. This is intended to
replace the dozen other various hacks in the code that do all sorts
of crude things including spamming the envrionment strings with the new
argv string.

This version is mainly inspired by the sendmail version, with a couple of
ideas taken from the NetBSD implementation as well.
1995-12-26 22:50:08 +00:00
David Greenman
0b7a315970 Include sys/time.h, not sys/user.h.
Submitted by:	"Marc G. Fournier" <scrappy@hub.org>
1995-12-08 08:47:41 +00:00
Bill Paul
de32dbbd5d Small tweak: don't try closing /etc/netgroup if we haven't opened it yet. 1995-12-02 21:54:59 +00:00
Poul-Henning Kamp
d12f212098 Add #include <sys/user.h>. 1995-10-28 16:14:18 +00:00
Andrey A. Chernov
9f23763a01 Remove unneded ctype.h 1995-10-26 22:32:00 +00:00
Andrey A. Chernov
7f3f016d8c Fix it for chars with 8bit set 1995-10-23 20:49:58 +00:00
Bruce Evans
3b4058284e Fixed lint from cc -Wall.
Cleaned up includes.
1995-10-22 18:43:26 +00:00
Poul-Henning Kamp
8b10240709 Minor cleanup, mostly unused vars and missing #includes. 1995-10-22 14:37:11 +00:00
Peter Wemm
fc370289ab Add $Id$ since this version of the file has diverged from the BSD base a
fair bit.  I forgot to add it when I made the fixes some time ago.
1995-10-21 07:05:01 +00:00
Bill Paul
3948edc24c Another tweak/speedup pass:
- Fix buffer overflow problem once and for all: do away with the buffer
  copies to 'user' prior to calling _scancaches() and just pass a pointer
  to the buffer returned by yp_match()/yp_first()/yp_next()/whatever.
  (We turn the first ':' to a NUL first so strcmp() works, then change it
  back later. Submitted by Bill Fenner <fenner@parc.xerox.com> and
  tweaked slightly by me.

- Give _pw_breakout_yp() the 'more elegant solution' I promised way back when.
  Eliminate several copies to static buffers and replace them with just
  one copy. (The buffer returned by the NIS functions is at most
  YPMAXRECORD bytes long, so we should only need one static buffer of
  the same length (plus 2 for paranoia's sake).)

- Also in _pw_breakout_yp(): always set pw.pw_passwd to the username
  obtained via NIS regardless of what pw_fields says: usernames cannot
  be overridden so we have no choice but to use the name returned by
  NIS.

- _Again_ in _pw_breakout_yp(): before doing anything else, check that
  the first character of the NIS-returned buffer is not a '+' or '-'.
  If it is, drop the entry. (#define EXTRA_PARANOIA 1 :)

- Probe for the master.passwd.* maps once during __initdb() instead
  of doing it each time _getyppass() or _nextyppass() is called.

- Don't copy the NIS data buffers to static memory in _getyppass()
  and _nextyppass(): this is done in _pw_breakout_yp() now.

- Test against phkmalloc and phkmalloc/2 (TNG!) to make sure we're
  free()ing the yp buffers sanely.

- Put _havemaster(), _getyppass() and nextyppass() prototypes under
  #ifdef YP. (Somehow they ended up on the wrong side of the #endif.)

- Remove unused variable ___yp_only.
1995-10-11 21:35:08 +00:00
Bill Paul
eb6c139019 Some NIS bug stomping:
- In some cases, we don't properly resolve _all_ possible group memberships.
  If a user is a member of both local and NIS groups, we sometimes lose some
  of the membership info from NIS. (Reported by: Thorsten Kukuk
  <kukuk@uni-paderborn.de>)

- Make NIS +groupname overrides actually work the way the SunOS group(5)
  man page says they should (make them work for all cases: getgrent(),
  getgrnam() and getgrgid()).

- When not compiled with -DYP, grscan() should ignore entries that
  begin with a '+'. When compiled _with_ -DYP, grscan() should ignore
  +groupname entries that don't refer to real NIS groups.

- Remove redundant redeclaration of fgets(), strsep() and index() inside
  grscan(). We already #include all the right header files for these.

Note: -groupname exclusion as specified in the Sun documentation still
isn't supported. This'll be a 2.2 addition. Right now I just want this
stuff to work.
1995-10-06 21:29:01 +00:00
Peter Wemm
11e67a9f2e Fix the problem that I aroused with the last commit..
What was happening, is if syslogd was not running, syslog() would do
a strcat("\r\n") on a non-null-terminated buffer, and write it to the console.

This meant that sometimes extra characters could be written to the console
during boot, depending on the stack contents.

This totally avoids the potential problem by using writev() like the rest
of the does, and avoid modifying the buffer after the trouble we've gone to
to carefully protect it.

This is actually a trivial fix, in spite of the long commit message.. :-)
It only appeared during boot and shutdown with syslogd stopped.
1995-10-05 00:11:15 +00:00
Peter Wemm
fcc3b6999e Make ttyname() use posix-style tcgetattr() to check to see that it's
running on a tty.  (Same as isatty()) The old-style TIOCGETP ioctl
wouldn't fly if the kernel didn't have COMPAT_43.
Submitted by:	Carl Fongheiser <cmf@netins.net>
1995-09-22 17:01:28 +00:00
Peter Wemm
7c8e2aa48c Fix security bugs with a "new approach", using stdio's powerful buffer
control hooks.
It is similar to an unrolled multi-part snprintf(), in that a "FILE *" is
attached to a string buffer.  There is also an optimisation for the case
where the syslog format string does not contain %m, which should improve
performance of "informational" logging, like from ftpd.
1995-09-15 13:53:39 +00:00
Bill Paul
400b841301 getgrent.c: adjust _nextypgroup() slightly so that it continues processing
the group map after encountering a badly formatted entry.

getpwent.c: same as above for _nextyppass(), and also turn a couple of
sprintf()s into snprintf()s to avoid potential buffer overruns. (The
other day I nearly went mad because of a username in my NIS database
that's actually 9 characters long instead of 8. Stuffing a 9-character
username into an 8-character buffer can do some strange things.)

(This reminds me: I hope somebody's planning to fix the buffer overrun
security hole in syslog(3) before 2.1 ships.)
1995-09-05 19:52:59 +00:00
Bill Paul
d454389cc2 getpwent.c: turn the code that checks the override caches into a
seperate function to avoid duplication. Also fix getpwent() a
small bit to properly handle the case where the magic NIS '+'
entry appears before the end of the password file.

getgrent.c: be a little more SunOS-ish. Make it look like the NIS
group map is 'inserted' at the the point(s) where the magic NIS '+'
entry/entries appear.

getgrent: fix a file descriptor leak: remember to close the netgroup
file after we determine that we're using NIS-only innetgr() lookups.
1995-09-02 04:08:55 +00:00
Andrey A. Chernov
85b3ab5887 National date/time representation in syslog logfiles looks ugly,
change strftime to ctime. Logfiles must have default (english) date/time
representation for access/view from various places.
1995-08-29 13:21:53 +00:00
Bill Paul
22397ec3c3 Fix _listmatch() so that it doesn't fall off the end of the list string. 1995-08-08 02:51:16 +00:00
Bill Paul
1e890b056a Just when you thought it was safe...
- getnetgrent.c: address some NIS compatibility problems. We really need
to use the netgroup.byuser and netgroup.byhost maps to speed up innetgr()
when using NIS. Also, change the NIS interaction in the following way:

If /etc/netgroup does not exist or is empty (or contains only the
NIS '+' token), we now use NIS exclusively. This lets us use the
'reverse netgroup' maps and is more or less the behavior of other
platforms.

If /etc/netgroup exists and contains local netgroup data (but no '+').
we use only lthe local stuff and ignore NIS.

If /etc/netgroup exists and contains both local data and the '+',
we use the local data nd the netgroup map as a single combined
database (which, unfortunately, can be slow when the netgroup
database is large). This is what we have been doing up until now.

Head off a potential NULL pointer dereference in the old innetgr()
matching code.

Also fix the way the NIS netgroup map is incorporated into things:
adding the '+' is supposed to make it seem as though the netgroup
database is 'inserted' wherever the '+' is placed. We didn't quite
do it that way before.

(The NetBSD people apparently use a real, honest-to-gosh, netgroup.db
database that works just like the password database. This is
actually a neat idea since netgroups is the sort of thing that
can really benefit from having multi-key search capability,
particularly since reverse lookups require more than a trivial
amount of processing. Should we do something like this too?)

- netgroup.5: document all this stuff.

- rcmd.c: some sleuthing with some test programs linked with my own
version of innetgr() has revealed that SunOS always passes the NIS
domain name to innetgr() in the 'domain' argument. We might as well
do the same (if YP is defined).

- ether_addr.c: also fix the NIS interaction so that placing the
'+' token in the /etc/ethers file makes it seem like the NIS
ethers data is 'inserted' at that point. (Chances are nobody will
notice the effect of this change, which is just te way I like it. :)
1995-08-07 03:42:14 +00:00