Commit Graph

26308 Commits

Author SHA1 Message Date
hoek
100ffb8b0a Use consistent spelling,
writeable -> writable (recall prior debate over this? :-)
	initialise -> initialize
	recognise -> recognize

Merry Christmas! :)
1997-12-25 09:36:42 +00:00
dg
2a494c06e2 The spl fixes in in_setsockaddr and in_setpeeraddr that were meant to
fix PR#3618 weren't sufficient since malloc() can block - allowing the
net interrupts in and leading to the same problem mentioned in the
PR (a panic). The order of operations has been changed so that this
is no longer a problem.
Needs to be brought into the 2.2.x branch.
PR:		3618
1997-12-25 06:57:36 +00:00
julian
13a5c596cc Add a man page for REMOVING devices from devfs. 1997-12-25 05:54:24 +00:00
alex
370393763b Changed pthread_detach to conform to POSIX, i.e. the single argument
provided is of type pthread_t instead of pthread_t *.

PR:		4320

Return EINVAL instead of ESRCH if attempting to detach an already
detached thread.
1997-12-25 05:07:20 +00:00
alex
32ddc95d90 Removed unnecessary initialization of hp in gethostbyaddr_r. 1997-12-25 04:21:08 +00:00
ache
5d5e8db790 Add overflow checks: if output size becomes bigger than INT_MAX,
just return EOF
1997-12-25 00:32:17 +00:00
ache
e4ef30b29d Correct type of stored argument place (from previous fix) 1997-12-24 23:54:19 +00:00
ache
33cd251a1b 1) Restore back comment about snprintf()
2) Optimize string buffer copy to call memcpy() and update pointers
only for count > 0, it makes snprintf(NULL, 0, ...) more efficient
1997-12-24 23:23:18 +00:00
ache
d6bcc605a0 Return back to BSD snprintf semantics which recent C9x standard adopts
instead of Singe Unix, thanx Bruce for explaining, I am not realize
standards war was there.

But now, fix n == 0 case to not return error and fix check for too
big n.

Things left to do: check for overflow in arguments.
1997-12-24 23:02:47 +00:00
ache
7bbce1048f 1) Oops! Insert again if (n == 0) return 0.
Final word is Bruce's quote:

C9x specifies the BSD4.4-Lite behaviour:

       [#3] ...   Thus,  the
       null-terminated  output  has  been completely written if and
       only if the returned value is less than n.

It means that if we not have any null-terminated output as for n == 0
we can't return value less than n, so we forced to return value
equal to n i.e. 0

The next good thing is glibc compatibility, of course.

2) Do check for too big n in machine-independent way.
3) Minor optimization assuming EOF is < 0
1997-12-24 20:24:08 +00:00
imp
37887cee9a sprintf->snprintf paranoia
Obtained from: OpenBSD (?)
1997-12-24 19:39:57 +00:00
imp
66fd98fe99 Be extra paranoid about the length of data returned from gethostbyaddr or
gethostbyname.
Submitted by:	Julian Assange
1997-12-24 19:38:18 +00:00
imp
ed2ffa32c0 sprintf->snprintf paranoia. The one thing that looks like a hole in
the diff is in an ifdef that isn't enabled for FreeBSD.
Obtained from:	OpenBSD(?)
1997-12-24 19:21:09 +00:00
imp
2dee7f5729 Various sprintf -> snprintf fixes.
Minor style fix (strcpy(foo,"") -> *foo = '\0')
Obtained from:	OpenBSD(?)
1997-12-24 19:13:23 +00:00
imp
604bcde61e Use snprintf rather than printf out of paranoia
Obtained from:	OpenBSD
1997-12-24 18:56:03 +00:00
dyson
d97fabbb53 Support running with inadequate swap space. Additionally, the code
will complain with a suggestion of increasing it.
1997-12-24 15:05:25 +00:00
ache
1756dc5a15 Back out part related to "return 0 if n == 0" and return EOF as before.
The main argument is that it is impossible to determine if %n evaluated or not
when snprintf return 0, because it can happens for both n == 0 and n == 1.
Although EOF here is good indication of the end of process, if n is
decreased in the loop...
Since it is already supposed in many places that EOF *is* negative, f.e.
from Single Unix specs for snprintf
"return ... a negative value if an output error was encountered"
this not makes situation worse.
1997-12-24 14:32:40 +00:00
ache
b8a0fd9139 Fix snprintf(...%n...)
to pass not more than buffer size to %n agrument, old variant
always assume infinite buffer.
%n is for actually transmitted characters, not for planned ones.
1997-12-24 13:47:13 +00:00
ache
5d2bb2184a Remove wrong comment about snprintf:
"return the number of bytes needed, rather the number used"

According to Single Unix specs:

Upon successful completion, these functions return the number of bytes
transmitted excluding the terminating null
1997-12-24 13:17:13 +00:00
ache
46f0000bfe snprintf return value fixes to conform Single Unix specs:
1) if buffer size is smaller than arguments size, return buffer
size, not arguments size as before.

2) if buffer size is 0, return 0, not EOF as before.
(now it is compatible with Linux and Apache implementations too).

NOTE: Single Unix specs says:

If the value of n {buffer size} is zero on a call to snprintf(), an
unspecified value less than 1 is returned.

It means we can't return EOF since EOF can take *any* value in general
not especially < 1. Better variant will be return -1 (it is less then
1 and different with n == 1 case) but -1 value is already occuped by
EOF in our implementation, so we can't distinguish true IO error
in that case. So 0 here is only possible case still conforming
to Single Unix specs.
1997-12-24 12:31:32 +00:00
wosch
12904d6220 Small bugfix: store $uid_start instead hard coded value 1000
in /etc/adduser.conf.
1997-12-24 11:44:14 +00:00
brian
e35b48c803 Correct copyright.
Requested by: Eivind Eklund <perhaps@yes.no>
1997-12-24 10:28:38 +00:00
jkh
6973ddaa13 Put the dir file in the correct distribution. 1997-12-24 10:16:49 +00:00
brian
14d342e696 Cosmetic (style):
sizeof(var) -> sizeof var
  sizeof type -> sizeof(type)

Suggested by: J Wunsch <j@uriah.heep.sax.de>
1997-12-24 09:29:17 +00:00
brian
e2cdbfbbb2 Use sizeof cftypes128 for NCFTYPES128 macro, not sizeof cftypes !
Lucky that sizeof cftypes < sizeof cftypes128
1997-12-24 09:28:11 +00:00
nate
f886ffb27e - Add prototype for adjust_timeout_calltodo().
Submitted/forgotten by:	Ken Key <key@cs.utk.edu>
1997-12-24 01:33:45 +00:00
imp
e1ae752d33 Be extra paranoid about trusting the length of the data returned by
gethostbyaddr.
Submitted by:	Julian Assange
1997-12-24 01:00:24 +00:00
imp
03672be414 Two fixes:
1) Correct strncpy usage
	2) gethostbyaddr paranoia from Julian Assange
1997-12-24 00:59:49 +00:00
alex
6541be1e21 Added cross references for apm, cron, inetd, lpd, moused, mrouted,
nfsd, nfsiod, portmap, rpc.lockd, rpc.statd, syslogd, tickadj, and
ypbind.
1997-12-24 00:59:28 +00:00
imp
d2e80bb3ce Minor style nit noticed by bde. 1997-12-24 00:59:02 +00:00
imp
6356793b99 Be extra paranoid about trusting the length returned by gethostbyaddr.
Submitted by:	Julian Assange
1997-12-24 00:58:39 +00:00
imp
fb787b8d6a Be extra paranoid about trusting the size of the address returned from
gethostbyaddr.
Submitted by:	Julian Assange
1997-12-24 00:57:41 +00:00
brian
24138e024f strncpy(x,y,sizeof(x)) --> strncpy(x,y,sizeof(x)-1)
Suggested by: Philippe Charnier <charnier@lirmm.fr>
              Theo de Raadt <deraadt@cvs.openbsd.org>
1997-12-23 22:38:55 +00:00
brian
9672a80ab3 Add a PARITITON arg to SCSI_MKFIXED, and use it to
specify RAW_PART for the suopen() in sscioctl().

Now you can `scsi -f /dev/ssc -p'.
1997-12-23 19:44:45 +00:00
nate
b24853a710 This patch causes the "calltodo" timer list to be decremented by the amount
of time that the laptop was suspending.  Thus, select() calls that might have
suspended rather than firing  at 1hr + "time suspended" since the timer was
posted.

Adding:

    options  APM_FIXUP_CALLTODO

to the kernel config enables the patch.

[
This patch was slightly modified to use a consistant indent style and
I removed some unused local variables.  After this has been tested a
few weeks we'll make the options the default, so for now I'm now
documenting it in LINT.  Mike can later if he wants.
]

Reviewed by:	Mike Smith <msmith@freebsd.org>
Submitted by:	Ken Key  <key@cs.utk.edu>
1997-12-23 16:32:35 +00:00
yokota
643a53fdee - Added support for a new MouseMan model (4 buttons, no wheel).
Based on the report from Dave Bodenstab.
- Turn off PnP COM device enumeration procedure if the user explicitly
  specifies a protocol type with the "-t" option.
- Accept "-t auto".  Now the user may entirely omit the "-t" option
  in the command line, or specify "-t auto" in order to make moused
  detect an appropriate protocol type automatically.  In the
  previous version, moused did so only if the "-t" option is absent
  in the command line. ("-t auto" won't disable PnP COM device
  enumeration.)
- Updated the man page.
1997-12-23 08:04:38 +00:00
yokota
59aba0db01 Document `flags' for the psm driver. 1997-12-23 08:01:16 +00:00
alex
064cf03a22 Removed unnecessary setting of 'error' -- binding to a privileged port
by a non-root user always returns EACCES.
1997-12-23 01:40:40 +00:00
alex
cbab4c9147 YTK fix. 1997-12-22 23:00:35 +00:00
jb
b93ad9c7b6 Reviewed by: William LeFebvre <wnl@groupsys.com>
Change errno -> error in local structure to avoid a clash with the
thread-aware version of errno which is required for a thread-safe libc.

Have discussed this with the author and he has agreed to this change. 8-)
1997-12-22 19:39:20 +00:00
ache
6b0fed6a96 Fix sysctl path /usr/sbin->/sbin 1997-12-22 19:11:28 +00:00
eivind
6db96c372e Remove unused include files
Submitted by:	bde
1997-12-22 13:46:08 +00:00
dyson
b6fbb09bc1 Improve my copyright. 1997-12-22 11:54:00 +00:00
dyson
2a4aef5cd4 Improve my copyright. 1997-12-22 11:48:13 +00:00
dyson
edbb7fba33 Correct my previous fix for the UPAGES problem. 1997-12-22 10:06:09 +00:00
charnier
18b5ec7c3a Remove obsolete /etc/hostname.ep? reference.
PR:	kern/5310
Submitted by:	tom@sdf.com
1997-12-22 07:37:50 +00:00
charnier
b15af2b63c Use .Tn, .Bx Free and .An. 1997-12-22 07:35:40 +00:00
brian
d5b26d610c Don't forget to ntohs(sin.sin_port) (DUH!) 1997-12-22 02:28:18 +00:00
dyson
2c2d68bf78 Hopefully fix the problem with the TLB not being updated correctly.
Problem tracked down by bde@freebsd.org, but this is an attempted
efficient fix.
1997-12-22 00:36:48 +00:00
joerg
548dd1da87 Properly clean out the SI_MOUNTEDON flag iff the mount attempt fails
half the way down.  Otherwise, further attempts to mount the device
will be rejected with BUSY.

IMHO, this flag can completely go away for cd9660.  There's no reason
you need to prevent CDs from being mounted multiple times, and in case
of multisession CDs it can even make sense to mount two different
sessions by the same time (to different mount points, otherwise it
would be pointless ;).
1997-12-21 21:40:02 +00:00