Commit Graph

10191 Commits

Author SHA1 Message Date
ed
ce4cbee6a1 Add missing static keywords to csplit(1) 2011-11-06 08:14:45 +00:00
ed
4b43e01fe9 Add missing static keywords to cpuset(1) 2011-11-06 08:14:40 +00:00
ed
88b6b62757 Add missing static keywords to column(1) 2011-11-06 08:14:34 +00:00
ed
5d1bcc94a8 Add missing static keywords to colcrt(1) 2011-11-06 08:14:28 +00:00
ed
61bd4fddd2 Add missing static keywords to col(1) 2011-11-06 08:14:22 +00:00
ed
a86a6f0c85 Add missing static keywords to cmp(1) 2011-11-06 08:14:16 +00:00
ed
d0367a1471 Add missing static keywords to catman(1) 2011-11-06 08:14:09 +00:00
ed
1f7f99bbde Add missing static keywords to cap_mkdb(1) 2011-11-06 08:14:03 +00:00
ed
4704a8332d Add missing static keywords to c99(1) 2011-11-06 08:13:58 +00:00
ed
c25f8d73b9 Add missing static keywords to banner(1) 2011-11-06 08:13:51 +00:00
jilles
46fb1cb984 lint: Fix lseek() argument order.
Because SEEK_SET is 0, this seems to have no effect on the generated code.

PR:		bin/160806
Submitted by:	Henning Petersen <henning dot petersen at t-online dot de>
Obtained from:	NetBSD
2011-11-05 22:25:15 +00:00
jilles
eeb1159658 make(1): obj dirs are physical paths so write pwd -P rather than pwd.
Regular pwd may return a pathname containing symlinks, but make does not use
such pathnames.
2011-11-05 21:32:17 +00:00
dougb
41264f106d Fix typo from r226927
Submitted by:	scf
2011-10-30 20:55:32 +00:00
dougb
8e54cbf4ab Add birth date for Ken Thompson
Add birth and death dates for Steve Jobs
Update birth and add death date for Dennis Ritchie

PR:		bin/162157
Submitted by:	Niclas Zeising <niclas.zeising@gmail.com>
2011-10-30 04:04:40 +00:00
dougb
d794f830d2 Add a reminder about quarterly status report due dates
Reviewed by:	danger
2011-10-29 18:16:29 +00:00
ache
1a131a903e Reword '}' description to sound more clear.
Submitted by:   dougb
MFC after:      7 days
2011-10-29 06:13:47 +00:00
ache
a71751c33e Update '}' description to reflect reality (and POSIX)
PR:             96236
Submitted by:   "Andreas Kohn" <andreas@syndrom23.de>
MFC after:      7 days
2011-10-28 20:28:13 +00:00
pluknet
e43df010f9 Add the XSI option -b to show date of the last reboot.
That required to increase the LINE field to fit the output of -b.
While here, change the row() function to take a const argument.

In collaboration with:	ed
2011-10-28 12:47:37 +00:00
ed
c59a6ed6df Print INIT_PROCESS and LOGIN_PROCESS entries as well.
Even though our implementation of utmpx never emits these types of
records, they are part of POSIX. Do print them when they show up in the
database files.

While there, also print the type number of unsupported records.
2011-10-27 16:20:29 +00:00
gabor
6762a389b8 - Fix installation when WITH_BSD_GREP is set to yes
Submitted by:	Aleksandr Rybalko <ray@ddteam.net>
2011-10-23 16:04:07 +00:00
kientzle
afbc6f6bc7 Typo from previous commit. Urgh. 2011-10-22 16:53:29 +00:00
kientzle
3c7e934d28 Bring in the --gid --gname --uid and --uname implementation
from libarchive.googlecode.com.

MFC after:	3 days
2011-10-22 16:52:04 +00:00
dim
99b00e570c Upgrade our copy of llvm/clang to r142614, from upstream's release_30
branch.  This brings us very close to the 3.0 release, which is expected
in a week or two.

MFC after:	1 week
2011-10-22 14:08:43 +00:00
des
6c6abb3ddc It turns out that truss also used kdump's mkioctls script, and expected
ioctlname() to return a pointer to the name rather than print it.  This did
not show up in testing because truss had its own prototype for ioctlname(),
so it would build fine and run fine as long as the program being traced did
not issue an ioctl.

Teach mkioctls to generate different versions of ioctlname() based on its
first command-line argument.

Pointed out by:	Garrett Cooper <yanegomi@gmail.com>
2011-10-21 11:08:25 +00:00
des
4ebe5d8b07 Fix copy-pasto in CAPFAIL_INCREASE case.
Noticed by:	pjd
2011-10-18 09:39:41 +00:00
des
49ff1260bc Make ktrace(1) build cleanly at WARNS level 6 by completely rethinking the
way in which it handles the -C, -c, -g and -p options.

MFC after:	3 weeks
2011-10-18 08:26:12 +00:00
des
1b405df8ba Revisit the capability failure trace points. The initial implementation
only logged instances where an operation on a file descriptor required
capabilities which the file descriptor did not have.  By adding a type enum
to struct ktr_cap_fail, we can catch other types of capability failures as
well, such as disallowed system calls or attempts to wrap a file descriptor
with more capabilities than it had to begin with.
2011-10-18 07:28:58 +00:00
ed
ce57dfe403 Sort header file names.
Spotted by:	des
2011-10-17 13:54:55 +00:00
ed
934a6f8b67 Add missing #include.
Note to myself: don't write patches while watching a movie.
2011-10-16 19:23:43 +00:00
ed
191c732ed6 Don't cast SIZE_T_MAX to off_t.
I focused so much on the 32-bits case where we have to cast SIZE_T_MAX
up in size, that I forgot about the 64-bits case, where off_t and size_t
are equal in size. Simply cast both numbers to uintmax_t, as we can
assume st_size is never negative.

Reported by:	cperciva
2011-10-16 19:15:25 +00:00
eadler
9d7884364e - change "is is" to "is" or "it is"
- change "the the" to "the"

Approved by:	lstewart
Approved by:	sahil (mentor)
MFC after:	3 days
2011-10-16 14:30:28 +00:00
marcel
4718565769 o Use C99 designated initializer to properly handle ELFOSABI_STANDALONE.
o  In elf_get_byte(), cast through uint8_t and not char to avoid sign
   extension.
2011-10-16 14:11:05 +00:00
ed
d4ce73cfd5 Fix ncplist to build with WARNS=6.
Add some const and static keywords to get it all to build. Also add
missing #includes.
2011-10-16 10:00:28 +00:00
ed
49ae4d0407 Undo r226423.
It seems su does build without warnings, but it requires a small fix to
libbsm headers, which I have not committed to SVN yet.
2011-10-16 09:09:33 +00:00
ed
e3855b1e6b Build rwho(1) with WARNS=6.
The only reason why it didn't build with WARNS=6, is because of some
simple to fix string formatting bugs.

MFC after:	3 months
2011-10-16 08:54:41 +00:00
ed
50100c914e Use integer to store the result of getch().
We need to use an integer to make the comparison against ERR work.

MFC after:	3 months
2011-10-16 08:36:10 +00:00
ed
a8849a7323 Remove WARNS line. This tool builds with WARNS=6 properly. 2011-10-16 08:14:12 +00:00
ed
225015e0ef Fix build of m4 with WARNS=6.
Change the parser; rename `exp' to `exponent' not to collide with exp(3).
2011-10-16 08:09:17 +00:00
ed
7ccc19c3b8 Remove unneeded WARNS=3 lines.
It seems these two tools can be built properly with WARNS=6, even on
architectures that are stricter about alignment.
2011-10-16 08:04:43 +00:00
ed
26202ae0ce Build at(1) with NO_WFORMAT instead of WARNS=1. 2011-10-16 07:57:01 +00:00
ed
e4b5520b25 Make some internal fixes to ruptime(1):
- Prevent possible unaligned access to struct whoent.
- Increase uptime column by one, to properly print hosts with an uptime
  greater than 1000 days.
- Reduce code complexity by storing struct whod inside struct hs.
- Set WARNS to 6.

MFC after:	3 months
2011-10-16 07:36:27 +00:00
delphij
7f0cb2e0bc According to the NetBSD foundation [1]:
Third parties are encouraged to change the license on any files which have
a 4-clause license contributed to the NetBSD Foundation to a 2-clause
license. We would also encourage you to inform us about these files, so
that we can continue to track the many places in which NetBSD is used.

http://www.netbsd.org/about/redistribution.html#why2clause [1]

Requested by:	joel@
2011-10-16 07:35:26 +00:00
delphij
3192efecae Partially revert r226274, the old code was right. 2011-10-16 07:05:43 +00:00
trociny
5edcf5899d In r225809 the intention was to send VEOF only once if STDIN was not a
terminal. Unfortunately the fix was incorrect and for flushtime > 0 it
keept sending VEOF.

Sent VEOF generates ^D\b\b echoed by the terminal, which was reported
in bin/161526. Note, we still send VEOF at least once. Otherwise
commands like below would hang forever:

  echo 1 |script /tmp/script.out cat

PR:		bin/161526
Reported by:	Adrian Wontroba <aw1@stade.co.uk>, Stefan Bethke <stb@lassitu.de>
Tested by:	Stefan Bethke <stb@lassitu.de>
MFC after:	3 days
2011-10-15 19:08:22 +00:00
ed
2f1e586900 Fix whitespace inconsistencies in systat(1).
According to md5(1), the resulting binary is the same.
2011-10-15 13:20:36 +00:00
ed
6f6341d894 Put parentheses in the right place.
Noted by:	jilles@
Broken by:	me. :-(
2011-10-14 10:43:55 +00:00
ed
a87680cb54 Make nl(1) build with WARNS=6.
Obtained from:	NetBSD
2011-10-14 07:28:39 +00:00
ed
ec118486fa Build last(1) and leave(1) with WARNS=6.
These ports were only built with WARNS=1, because they use certain
format extensions. We can use NO_WFORMAT for that instead.
2011-10-14 07:26:20 +00:00
ed
c532eb5b65 Build tr(1) with WARNS=6. 2011-10-14 07:25:20 +00:00
ed
9a877f97e7 Build look(1) with WARNS=6. 2011-10-14 07:24:48 +00:00
ed
a3dde8469a Build finger(1) with WARNS=6. 2011-10-14 07:24:23 +00:00
rakuco
c4fe3bac8a Add myself to committers-ports.dot and calendar.freebsd.
Approved by:	avilla (mentor)
2011-10-13 20:36:43 +00:00
des
c9a3d28e97 Clean up mkioctls a bit, and fix cross-building by checking ${MACHINE}
instead of $(uname -m).

Pointed out by:	nyan@
2011-10-13 16:29:24 +00:00
des
47b4a2d1c7 Make kdump compile cleanly at WARNS level 6, with one exception: the
ipfilter headers contain a duplicated function declaration.  Turn off
-Werror to allow kdump to compile in spite of this.

It would be neat to be able to turn off -Werror on a file-by-file basis...

PR:		bin/161478
Submitted by:	Garrett Cooper <yanegomi@gmail.com>
2011-10-12 21:45:12 +00:00
gleb
71169bb7fd Add myself
Approved by:	mdf (mentor)
2011-10-12 20:18:13 +00:00
dim
eacdf4cafb Add symlink from clang to clang-cpp, so you can use CPP=clang-cpp in
Makefiles.  Also add a manpage symlink for it.

MFC after:	3 days
2011-10-12 17:47:15 +00:00
dim
a1220b444b Add manpage symlink for clang++(1).
PR:		docs/149051
MFC after:	3 days
2011-10-12 17:25:49 +00:00
delphij
c0ed9a753b - Fix an off-by-one bug in addgroup().
- Fix the error message when setgid() failed.

PR:		bin/161509
Submitted by:	Jeremy Huddleston <jeremyhu apple com>
MFC after:	2 weeks
2011-10-12 01:19:12 +00:00
gabor
16b6dcb054 - Fix counting of match limit (-m)
Reported by:	Nali Toja <nalitoja@gmail.com>
Approved by:	delphij (mentor)
2011-10-12 01:09:57 +00:00
gabor
afe335edb5 - Use getprogname() instead of __progname
- Allow disabling bzip2 support with WITHOUT_BZIP2
- Fix handling patterns that start with a dot
- Remove superfluous semicolon

Approved by:	delphij (mentor)
2011-10-11 22:27:23 +00:00
des
9b8d9b3ed1 Add a new trace point, KTRFAC_CAPFAIL, which traces capability check
failures.  It is included in the default set for ktrace(1) and kdump(1).
2011-10-11 20:37:10 +00:00
des
0fb3102c12 The previous commit did not fix the issue since it did not prevent sign
extension.  Cast to u_register_t first, then to uintmax_t.

Submitted by:	bde@
2011-10-11 15:04:58 +00:00
des
405f55d978 Cast to unsigned for %#jx.
Noticed by:	jh@
2011-10-11 07:46:45 +00:00
delphij
2ccfd227c9 Incorporate recent changes from NetBSD. Most notable change is the addition
of support of decompressing xz files.

Obtained from:	NetBSD
2011-10-10 06:37:32 +00:00
des
1f659f520a Address some of bde@'s concerns with the new code. 2011-10-08 21:02:08 +00:00
des
3b508d2272 Teach kdump(1) to decode capability bitmasks.
MFC after:	3 weeks
2011-10-08 13:01:38 +00:00
des
4b5f03bca4 Fix the dependency issue properly by a) moving kdump_subr.c to the front
of the SRCS list and b) listing kdump_subr.h in DPSRCS.
2011-10-08 12:59:41 +00:00
des
0d23c50594 Bring ioctlname() in line with all the other *name() functions, which
actually print the name (or the numeric value, if they can't figure out
the correct name) instead of just returning a pointer to it.  Also, since
ioctl numbers are not and probably never will be unique, drop support for
using a switch statement instead of an if/else chain.
2011-10-08 12:47:00 +00:00
des
d905bcbba9 I appreciate the logic behind using a (void) cast to indicate that the
return value is intentionally ignored, but frankly, all it does is
get in the way of the code.

Also fix a few other incorrect casts, such as (void *)malloc(foo) and
passing signed values to %x.
2011-10-08 12:28:06 +00:00
des
e7179d16fc Fix casting. 2011-10-08 12:21:51 +00:00
des
cd04cd4a49 Whitespace. 2011-10-08 12:10:16 +00:00
des
5f806d203a C has had swicth statements for 40 years or so. It's about time we
started using them.
2011-10-08 11:51:48 +00:00
des
3aeaeac999 Sort and line up. 2011-10-08 11:39:00 +00:00
des
db03f845e1 1) Some of the #defines or enums for which we auto-generate naming
functions may be wider than int, so use intmax_t throughout.  Also
   add missing casts in printf() calls.

2) Clean up some of the auto-generated code to improve readability.

3) Auto-generate kdump_subr.h.  Note that this requires a semi-ugly hack
   in the Makefile to make sure it is generated before make(1) tries to
   build kdump.c, or preprocess it for 'make depend'.

MFC after:	3 weeks
2011-10-08 09:57:29 +00:00
ed
3eeda85437 Remove extraneous WARNS=7.
WARNS above 6 has no use. Also, all of usr.bin is also built with
WARNS=6 by default.

Discussed with:	edwin
2011-10-08 07:20:12 +00:00
jceel
5364f65380 Add myself.
Approved by:	wkoszek (mentor)
2011-10-07 23:12:33 +00:00
delphij
6216a3cd29 Fix build on i386 and arm.
Tested with:	make universe
Pointy hat to:	delphij
2011-10-06 04:39:18 +00:00
gabor
1cb16d9887 Update BSD grep to the latest development version. It has some code
backported that was written for the TRE integration project in Google
Summer of Code 2011.  This is a temporary solution until the whole
regex library is not replaced so that BSD grep development can continue
and the backported code gets some review and testing.  This change only
improves scalability slightly, there is no big performance boost yet
but several minor bugs have been found and fixed.

Approved by:	delphij (mentor)
Sposored by:	Google Summer of Code 2011
MFC after:	1 week
2011-10-05 09:56:43 +00:00
des
ed77c1ed37 latin1 -> utf8 2011-10-04 15:00:54 +00:00
adrian
b7672d6f5e Handle the situation where fixups_close() has been called but more fixups
are still available on the queue.

Without this, the fixups producer/consumer pipeline will artifically terminate
before all of the fixups have been processed, leading to incomplete updates
and generally quite unhappy users.

Submitted by:	mux
2011-10-04 14:26:45 +00:00
adrian
069abf93c2 Update the comment to reflect what is actually going on.
Submitted by:	mux
2011-10-04 14:25:10 +00:00
ed
91bf568cd6 Correct column with for device numbers made in previous change.
The device number should be displayed using only five columns -- not eight.
2011-10-01 09:16:07 +00:00
gjb
773f9deac1 Fix a few grammar and mdoc nits in script.1
PR:		161088
Submitted by:	Ben Kaduk ( kaduk % mit ! edu )
MFC after:	1 week
Need-MFC:	225809
2011-09-29 02:29:32 +00:00
eadler
5d993e90ab - I am not the oldest committer alive (yet)
Approved by:	bapt (mentor)
2011-09-28 21:42:13 +00:00
eadler
66e1dd1bb2 - fix whitespace issue in calendar
- add a n after \

Submitted by:	brueffer
Approved by:	bapt (mentor)
2011-09-28 20:46:52 +00:00
ed
2a84e78d2e Get rid of major/minor number distinction.
As of FreeBSD 6, devices can only be opened through devfs. These device
nodes don't have major and minor numbers anymore. The st_rdev field in
struct stat is simply based a copy of st_ino.

Simply display device numbers as hexadecimal, using "%#jx". This is
allowed by POSIX, since it explicitly states things like the following
(example taken from ls(1)):

	"If the file is a character special or block special file, the
	size of the file may be replaced with implementation-defined
	information associated with the device in question."

This makes the output of these commands more compact. For example, ls(1)
now uses approximately four columns less. While there, simplify the
column length calculation from ls(1) by calling snprintf() with a NULL
buffer.

Don't be afraid; if needed one can still obtain individual major/minor
numbers using stat(1).
2011-09-28 18:53:36 +00:00
eadler
ce36da245f - add myself to calendar
Approved by:	sahil (mentor)
2011-09-28 18:49:37 +00:00
delphij
b88759ae05 Sync RCS id with NetBSD, this was intentionally omitted from the advisory
in order to reduce patchset size.

MFC after:	3 days
2011-09-28 18:03:53 +00:00
crees
e506eeeb8b Include limits.h instead of sys/limits.h to improve portability.
PR:		bin/150772
Submitted by:	Derrick Brashear <shadow@gmail.com>
Reviewed by:	Garrett Cooper <yanegomi@gmail.com>
Approved by:	cognet
2011-09-28 17:03:49 +00:00
mav
3a1a197150 MFprojects/hid:
Import the rest of HID improvements from the branch:
 - improve report descriptor parser in libusbhid to handle several kinds of
reports same time;
 - add to the libusbhid API two functions wrapping respective kernel IOCTLs
for reading and writing reports;
 - tune uhid IOCTL interface to allow reading and writing arbitrary report,
when multiple supported by the device;
 - teach usbhidctl to set output and feature reports;
 - make usbhidaction support all the same item names as bhidctl.

Sponsored by: iXsystems, inc.
2011-09-28 14:52:25 +00:00
bz
2e8e044c2f Fix handling of corrupt compress(1)ed data. [11:04]
Add missing length checks on unix socket addresses. [11:05]

Approved by:	so (cperciva)
Approved by:	re (kensmith)
Security:	FreeBSD-SA-11:04.compress
Security:	CVE-2011-2895 [11:04]
Security:	FreeBSD-SA-11:05.unix
2011-09-28 08:47:17 +00:00
des
dbd6a0f2f0 Document the fact that passive mode is now the default.
Update copyright dates and strip my middle name.
2011-09-27 19:02:44 +00:00
trociny
49d59b0738 When script(1) reads EOF from input it starts spinning on zero-byte
reads eating 100% CPU. Fix this by skipping select on STDIN after
reading EOF -- permanently if STDIN is not terminal and for one second
if it is.

Also after reading EOF from STDIN we have to pass it to the program
being scripted. The previous approach was to write zero bytes into the
pseudo-terminal. This does not work because zero-byte write does not
have any effect on read. Fix this by sending VEOF instead.

Submitted by:	Ronald Klop <ronald-freebsd8@klop.yi.org>
Discussed with:	kib, Chris Torek <chris.torek@gmail.com>
Approved by:	kib
MFC after:	1 week
2011-09-27 18:14:04 +00:00
des
9d09fddd43 Use fseeko() instead of fseek(). The rest of the code is off_t-aware,
but the use of fseek() means fetch(1) can't correctly resume a transfer
that was interrupted past the 2 GB mark.

Pointed out by:	ache@
MFC after:	3 weeks
2011-09-27 17:11:31 +00:00
des
0a0c98d376 Followup to r225599: the fseek() was a no-op since the file was opened
in append mode.  Open it in read-write mode instead.  Also move the
fseek up one level to cover the (unlikely but not impossible) case where
the server accepts ranges but does not send a Content-Size header.

PR:		bin/117277
MFC after:	3 weeks
2011-09-27 15:57:13 +00:00
des
07841942cc When resuming an HTTP download, we failed to verify that the range
returned by the server matched what we requested, and blindly appended
what we received to what we already had.  This could go two ways: if the
delivered offset was higher than expected, the local file would contain
duplicate data, while if it was lower than expected, there would be data
missing from the middle of the file.  Furthermore, if the transfer was
interrupted again, each subsequent attempt would compound the error.
Fix the first problem by restarting the transfer from scratch if there
is a gap, and the second by explicitly seeking to the correct location
in the local file so as to overwrite any duplicated data.

PR:		bin/117277
Approved by:	re (kib)
MFC after:	3 weeks
2011-09-15 22:50:31 +00:00
dwmalone
4ad48ef959 It seems when I added code for affine unit changes to units, I
forgot to tell the man page we could now convert Celsius to Fahrenheit.

Approved by:	re (kib)
MFC after:	1 month
2011-09-15 19:52:43 +00:00
brueffer
d35d0d3c95 Fix typos in error messages.
Found by:	kib
Approved by:	re (kib)
MFC after:	1 week
2011-09-13 20:35:34 +00:00
brueffer
a77e217ce2 Fix csup to allow case insensitive server names in the auth file,
just as advertised in the manpage.

PR:		158652
Submitted by:	stephen
Approved by:	re (kib)
MFC after:	1 week
2011-09-13 20:33:27 +00:00
rmacklem
6f1f963a1c Fix nfsstat(1) so that it prints out correct stats for the
new NFS server when the "-e" option is not used. The bug was
that srvrpccnt[] was being indexed by NFSPROC_XXX when it needs
to be indexed by NFSV4OP_XXX.

Tested by:	hrs
Approved by:	re (bz)
2011-08-23 13:44:56 +00:00