Commit Graph

13435 Commits

Author SHA1 Message Date
sjg 929a26a3de Use Lst_FindFrom and Lst_Succ(ln) to find next entry in missingFiles. 2016-08-10 18:49:40 +00:00
sjg c2d73114d1 Linux filemon only records D some/dir for rm -rf
rather than D entries for each file removed.
Thus we need a loop to remove all matching missingFiles entries
2016-08-10 18:25:00 +00:00
christos 6a9ab0dd0e Bump version for -no 2016-08-07 21:11:55 +00:00
christos f138f6c50d Accept "-no" as a "no" that does not cause errors if the object deleted
does not exist.
2016-08-07 10:37:24 +00:00
christos b31382fbd7 Avoid string gymnastics in an olympic year. 2016-08-05 07:22:17 +00:00
jakllsch ccf7078d06 Make this build with clang:
- Remove unused static const variables
 - Adjust impossibleish comparision.
2016-08-04 12:56:31 +00:00
wiz 4ff383b44d Bump date for new ifstat command. 2016-08-03 13:09:43 +00:00
maya 519ca6e803 Do globbing for FTP URLs of the form ftp://... too
ok christos
2016-08-03 12:33:56 +00:00
scole 6f3aa0fcd4 Add $NetBSD$ tag for new files 2016-08-02 17:53:46 +00:00
scole bd7662dc4d PR bin/51204
Add ifstat command to systat.

Imported from FreeBSD
2016-08-02 15:56:09 +00:00
dholland cf12c76a8b Don't allow initializers of the form { .a = .b = expr } as this is not
valid. Helps a bit with PR 22500.
2016-07-31 22:38:04 +00:00
dholland 096da17405 typo in comment 2016-07-31 22:36:53 +00:00
christos c351e21641 accept attributes in param decls 2016-07-20 18:14:12 +00:00
christos 29a071ed18 handle "extern __attribute__((__gnu_inline__)) __inline" 2016-07-20 17:42:14 +00:00
maya bd2a0d0ca6 Don't reference older CFATTACH_DECL 2016-07-19 17:01:04 +00:00
pgoyette e8f1cd85e9 Only emit bdevsw externs for entries in the bdev table, rather than for
entries in the cdev table.
2016-07-16 07:13:26 +00:00
christos b305547c0c more XXX removal. 2016-07-14 20:38:20 +00:00
christos 1584c6d3ed XXX: removal 2016-07-14 20:34:36 +00:00
christos fb3d963d14 remove soft interrupt queues that don't exist anymore. 2016-07-14 20:13:10 +00:00
christos bb9aed0669 remove __P 2016-07-14 19:39:41 +00:00
christos cfa835e475 dedup 2016-07-14 18:58:26 +00:00
christos 21c3ca2d5c use sysctl to print multicast addresses 2016-07-14 18:19:11 +00:00
christos 143eb5c5cf fix sysctl based interface printing, and annotate where we should add the
missing multicast printing code.
2016-07-13 22:01:12 +00:00
christos 543b506e7c Use sysctl for interface printing (-i), leave on for multicast address printing
(-ia) and comment in the code where this is missing?
XXX: should that be an ioctl or sysctl? provide getifmultiaddrs() via the
routing socket? I guess since this is just for netstat a simple sysctl or
ioctl would suffice. I lean towards sysctl.
2016-07-13 21:57:01 +00:00
shm 3d9e7389b4 Add USE_FORT support. 2016-07-13 13:10:04 +00:00
dholland bb1c83042f PR 51298 David Binderman: simplify redundant conditionals 2016-06-30 15:34:30 +00:00
dholland dc73bb47b8 PR 51192 David Binderman: fix wrong logic (probably)
XXX: this file should probably just be deleted
2016-06-30 05:56:46 +00:00
dholland b7f11ede62 Fix DEBUG_SRC build. Partly from PR 51191. 2016-06-30 05:34:04 +00:00
dholland 0088fcac6f Cleanse an old mangy way of avoiding an unused variable warning.
PR 51191 from David Binderman.
2016-06-30 05:31:00 +00:00
dholland f3d720012b Fix botched logic; PR 51191 from David Binderman. 2016-06-30 05:28:23 +00:00
sjg 846bd14287 meta_compat_parent: fflush each line 2016-06-29 22:10:08 +00:00
wiz 902b00da39 Sync usage with program. Add RCS Id. Increase column width. Fix macro usage. Improve wording. 2016-06-28 09:25:21 +00:00
wiz 5afefdc4ed Sort options in usage. 2016-06-28 09:24:46 +00:00
wiz 1e7f61c60e Infile is also optional. 2016-06-28 09:23:09 +00:00
wiz 8aeff4f5ae Sync usage between program and man page. Increase column width. 2016-06-28 09:22:16 +00:00
wiz 8e4e7d0ff8 Add RCS Id. Sort options in SYNOPSIS. Fix macro usage. Fix Dd. 2016-06-28 09:20:30 +00:00
maya dcb772676a Mention -d flag in mkesdb(1) usage
PR bin/24001
2016-06-27 20:15:16 +00:00
maya aeb2930556 Add man page for mkesdb
Imported from FreeBSD
2016-06-27 20:09:18 +00:00
maya dca09610a7 Add man page for mkcsmapper.
Imported from FreeBSD.

PR bin/24001
2016-06-27 20:07:26 +00:00
abhinav dcf78ec2af Add a FILES section and add references to terminfo(3), terminfo(5) in SEE ALSO.
Ok by wiz
2016-06-24 12:03:22 +00:00
abhinav 8dc887f792 Make all the global variables and functions static.
While there, remove unused variables and function prototypes.
Ok from christos
2016-06-23 03:58:13 +00:00
abhinav f2d77fdf32 Replace makewhatis(8) with makemandb(8) in SEE ALSO. 2016-06-16 15:11:43 +00:00
abhinav edcef964c4 Document -f option for man(1).
Also remove unsupported options for `man -k` from the synopsis and usage.
2016-06-16 15:10:58 +00:00
sjg fee87d5733 meta_oodate: set needOODATE if oodate due to missing .meta file. 2016-06-14 18:16:06 +00:00
abhinav 762c2184ca Make the function static in the definition (prototype was already declared static).
Missed in my last commit.
2016-06-13 14:58:57 +00:00
wiz 46dfe48d23 Remove trailing whitespace. Remove unnecessary quotes. 2016-06-13 06:17:19 +00:00
pgoyette fb5782856e Fix missing quote. Resolve automated test failure. 2016-06-13 02:06:44 +00:00
pgoyette cc610a3c94 Add new primaries -asince, -csince, and -since to compare file's
attributes against a user-specified timestamp (rather than the
attributes of a reference file).

Update the parse routines so they have access to the name of the
option being parsed.  This enables accurate error reporting for
"aliases" of primaries.

Now that aliases work, introduce some aliases for consistency with
Gnu findutils.
2016-06-13 00:04:40 +00:00
pgoyette d3e6512866 Use .Ic markup for consistency with the rest of the document 2016-06-12 22:25:13 +00:00
pgoyette 09ebf81448 Further clarification of the treatment of numeric user and group names. 2016-06-12 22:17:18 +00:00
dholland 9d2811fca4 Extend the numeric handling for uids with -user to gids with -group, and
document it. Leftover bit of PR 46158.
2016-06-12 20:50:10 +00:00
abhinav 736d303b6e Add libutil to the DPADD variable. 2016-06-12 14:28:26 +00:00
abhinav 89e188185f Fix a buffer overflow when reading from files containing extra long lines.
Instead of using a statically allocated buffer, manage the buffer at run-time
and reallocate as needed.

It was dumping core for following two cases:
man evrpc | ul
man xdm | ul

While there, also remove __P macro from function prototypes.

Ok from Christos.
2016-06-12 13:29:29 +00:00
pgoyette 355a32cb7e Change -{min,max}depth argument name from n to depth so that the
earlier statement concerning n being prefaced by a plus or minus.
(These exceptions to the +/- rule noted by kre@)

While here, fix markup error.  .Em for emphasis (stress) rather
than .Ar  :)
2016-06-12 03:21:35 +00:00
christos 88297dee99 fix memory leak, simplify 2016-06-07 03:04:45 +00:00
sjg e917da0d70 Extend the mtimes cache used by dir.c so it can be used by others.
We store both st_mtime and st_mode, since some callers care about the
later.

Reviewed by: christos
2016-06-07 00:40:00 +00:00
abhinav 241fae59df Convert reference to f77(1) from .Xr to .Ic as we don't have it any more.
Ok from wiz@
2016-06-06 16:32:19 +00:00
abhinav 00ae54ede2 Remove reference to uucp(1) in SEE ALSO, as it is no more there.
Ok from wiz@
2016-06-06 15:09:33 +00:00
abhinav 3c254bc4ef We don't have f77(1) anymore, remove the reference from SEE ALSO.
While there, also add .An for AUTHORS section.
Ok from wiz@.
2016-06-06 14:25:12 +00:00
dholland f6685469c0 Fix CSRG-era typo: typedef, not typdef. Spotted by Piotr Stefaniak. 2016-06-05 18:35:32 +00:00
christos fcb395931a NUL terminate. 2016-06-05 01:39:17 +00:00
sjg 35fa3446c5 Avoid breaking !NetBSD build 2016-06-05 00:48:58 +00:00
sjg ec729b232b meta_oodate even when missing-meta is true, we do not make a target in
.CURDIR out of date just because of a missing meta file.

Also we can only be missing filemon data if we had a meta file.
2016-06-04 22:17:14 +00:00
agc 3f81b60716 Following positive feedback on tech-userlevel, move the sys_info
script from othersrc to usr.bin/sys_info

	The sys_info script is a small script which will show the version
	information for installed utilities.  It also works on the kernel, and
	on most libraries.

	Its use is as follow:

		[19:41:13] agc@netbsd-002 ...external/bsd/sys_info [4568] > ./sys_info -a
		awk-20121220
		bind-9.10.3pl3
		bzip2-1.0.6
		calendar-20160601
		ftpd-20110904
		g++-4.8.5
		gcc-4.8.5
		grep-2.5.1anb1
		gzip-20150113
		bozohttpd-20151231
		NetBSD-7.99.26
		netpgp-3.99.17
		netpgpverify-20160214
		ntp-4.2.8pl5
		openssl-1.0.1r
		sqlite3-3.12.2
		openssh-7.1
		opensshd-7.1
		tcsh-6.19.00
		xz-5.2.1
		[19:41:20] agc@netbsd-002 ...external/bsd/sys_info [4569] > ./sys_info ntp ssh netpgp
		ntp-4.2.8pl5
		openssh-7.1
		netpgp-3.99.17
		[19:41:31] agc@netbsd-002 ...external/bsd/sys_info [4570] > ./sys_info ntp ssh netbsd
		ntp-4.2.8pl5
		openssh-7.1
		NetBSD-7.99.26
		[19:41:38] agc@netbsd-002 ...external/bsd/sys_info [4571] >

	The -a option can be given to the script to print out the information
	on all known components.

	The sys_info script also works on libraries, returning their
	"versions" as given by the shared object version numbers.

		[19:45:06] agc@netbsd-002 ...external/bsd/sys_info [4572] > ./sys_info libevent libXfont libc netbsd
		libevent-4.0
		libXfont-3.0
		libc-12.200
		NetBSD-7.99.26
		[19:45:27] agc@netbsd-002 ...external/bsd/sys_info [4573] >

	Alistair Crooks
	Wed Jun  1 19:44:01 PDT 2016
2016-06-04 15:27:11 +00:00
wiz 401a245f9e Fix typo in width argument; end sentence with dot. 2016-06-03 07:07:37 +00:00
agc 1f657fa580 Commit patch sent to tech-userlevel with universal approval to add a
version option for calendar(1):

	% calendar -v
	calendar-20160601
	%

For reference, see:

	http://mail-index.netbsd.org/tech-userlevel/2016/06/02/msg010081.html
2016-06-03 02:06:40 +00:00
sjg cb28c6994f Add cached_realpath()
realpath(3) is expensive, and meta mode at least uses it extensively.
We use cached_realpath() to save the result of successful calls to
realpath(3) in a private variable context.

This improves the worst case performance (eg examining libc with
nothing to do) by a factor of 4.

Reviewed by: christos
2016-06-03 01:21:59 +00:00
sjg 2d086608a8 Refactor the logic for deciding when a .meta file is needed.
Both meta_create() and meta_oodate() now share meta_needed()
to indicate if a .meta file is needed.

This allows for deciding that missing .meta file is cause of out-of-date.
The new knob 'missing-meta' controlls this, and is off by default
since the side effect files of generators like yacc will typically need
.NOMETA to avoid problems.

This however makes it much easier for folk to switch back and forth
with meta mode (eg. FreeBSD's normal build can leverage meta mode for
improved reliablility without need to clean).

Also if .MAKE.MODE does not contain 'nofilemon', the knob
'missing-filemon' allows control as to whether missing filemon data
should cause the target to be out-of-date.
Again off by default.
2016-06-03 01:16:27 +00:00
wiz 738f858418 Sort options and their descriptions. Sync usage more with man page.
Bump date in man page for new option -C.
2016-06-01 08:24:03 +00:00
kre a868903568 Add the posix -C option (-c but quieter). Fix -R to work properly when
setting \n as the record delimited using a numeric value rather than literal
\n - and to not incorrectly turn \n into a field separator if -R is used to
make some other char the record separator (\n becomes a field separator in
that case as long as the field separator remains "white space" but should not
be in any other case - unless set explicitly of course.)

Plus more cosmetic changes - the man page and usage are updated to make it
more clear that the 2 (or 1) params to -k are not fields (field1 and field2)
but specifiers of the beginning and end of one key field.   There was an
unused 'x' option in the GETOPTS string.  The usage message is reformatted
to display properly on both 80 col and > 80 col displays (on < 80 it will
still probably look pretty ugly ... perhaps not quite so bad though), and
is also updated to show the different usage for the -c case (and -C) from the
others (only 1 file permitted) - the man page synopsis has a similar update.

Using more than one of -c -C or -m generates a usage message rather than
just ignoring the -m as it did before (there was no -C before of course).

Aside from the bug fix to the interaction between -R and -t, there are no
changes that affect the way anything is sorted (or read, or written).

Discussed on tech-userlevel earlier this week.
2016-06-01 02:37:55 +00:00
christos 71229fdd60 Symbolic printing for mmap 2016-06-01 00:47:16 +00:00
pgoyette ed42ce54d9 Move __MKTEMP_OK up earlier so it has an actual impact. Reduces the
number of warnings during build.

XXX There are still some other warnings remaining to be resolved.

Fixes PR bin/48195 although we really should go back someday and fix
this correctly (by replacing all uses of mktemp(3)!)
2016-05-31 06:55:02 +00:00
dholland 96e4b50290 Use this program's Strdup() instead of strdup() so it exits on failure
instead of dumping core.
2016-05-30 16:35:35 +00:00
dholland 7ad91fe4a4 Use rewind() instead of freopen()'ing the same file for no reason. Also,
close the file when done instead of dropping it on the floor. Obsoletes
PR 50579.
2016-05-30 16:26:34 +00:00
christos c2dcc0c09c Don't make crunch binaries PIE 2016-05-29 16:12:58 +00:00
abhinav 743e3b4551 md5 is a hashing algorithm, don't say it is used for encryption.
Ok by wiz@
2016-05-24 06:15:43 +00:00
christos 8ed051d1e1 put back _PATH_WHATIS, it is used. 2016-05-21 20:54:34 +00:00
abhinav aa0cdec039 Remove unused include and unused constant. Ok from christos@. 2016-05-21 17:21:40 +00:00
sjg ccfdc94797 Propagate errors from filemon.
If we encounter errors producing a .meta file,
we should not consider the target completed successfully.
2016-05-12 20:28:34 +00:00
ozaki-r 278a4a7caa Remove duplicate routing flag list
We alreay have it in route(8) and shouldn't have another one.
(Actually the removed list is forgot to be updated.)
2016-05-12 03:44:11 +00:00
nonaka 048f8f1c7c If the negative number is passed to option '-c' or '-n',
it should occur an error.
2016-05-12 01:56:44 +00:00
sjg 1ea1c693f3 Allow for ignoring paths that match a set of patterns.
This can be expensive, so use with caution.
2016-05-10 23:45:45 +00:00
sjg 83317c9428 Apply realpath() to p before matching against metaIgnorePaths. 2016-05-10 00:02:31 +00:00
wiz 4b483a8522 New sentence, new line. Bump date for previous. 2016-05-02 09:33:15 +00:00
mlelstv 6fc95ff617 Extend syntax of config phrase, a quoted string instead of a device name
is passed as root specification string. This can be used to specify a
wedge by name.
2016-04-29 18:18:22 +00:00
riastradh feb61835e6 __diagused, not __unused -- used in an assert. 2016-04-07 23:29:59 +00:00
gson 4efe3992f9 Fully avoid the nonstandard types u_char, u_int, and u_long, which
were only used inconsistently in a few places anyway.
2016-04-06 09:57:00 +00:00
sjg f5cd368fff Skip looking for .MAKE.JOBS if either of compatMake or forceJob is true.
If -B compatMake will be true and should be honored.
If -j forceJobs will be true and the command line supplied .MAKE.JOBS
should be respected - for consistency with other usage.
2016-04-05 04:25:43 +00:00
christos 7a955c4ce5 PR/49872:Yorick Hardy: sed functions 'i' and 'a' discard leading white space
FIxed as suggested, behavior now matches gnu-sed.
2016-04-05 00:13:03 +00:00
christos b1bf748a07 PR/51043: Yorick Hardy: ftp(1) should use the port number for CONNECT 2016-04-04 23:59:41 +00:00
ozaki-r 09973b35ac Separate nexthop caches from the routing table
By this change, nexthop caches (IP-MAC address pair) are not stored
in the routing table anymore. Instead nexthop caches are stored in
each network interface; we already have lltable/llentry data structure
for this purpose. This change also obsoletes the concept of cloning/cloned
routes. Cloned routes no longer exist while cloning routes still exist
with renamed to connected routes.

Noticeable changes are:
- Nexthop caches aren't listed in route show/netstat -r
  - sysctl(NET_RT_DUMP) doesn't return them
  - If RTF_LLDATA is specified, it returns nexthop caches
- Several definitions of routing flags and messages are removed
  - RTF_CLONING, RTF_XRESOLVE, RTF_LLINFO, RTF_CLONED and RTM_RESOLVE
- RTF_CONNECTED is added
  - It has the same value of RTF_CLONING for backward compatibility
- route's -xresolve, -[no]cloned and -llinfo options are removed
  - -[no]cloning remains because it seems there are users
  - -[no]connected is introduced and recommended
    to be used instead of -[no]cloning
- route show/netstat -r drops some flags
  - 'L' and 'c' are not seen anymore
  - 'C' now indicates a connected route
- Gateway value of a route of an interface address is now not
  a L2 address but "link#N" like a connected (cloning) route
- Proxy ARP: "arp -s ... pub" doesn't create a route

You can know details of behavior changes by seeing diffs under tests/.

Proposed on tech-net and tech-kern:
  http://mail-index.netbsd.org/tech-net/2016/03/11/msg005701.html
2016-04-04 07:37:07 +00:00
knakahara 11bfe22fab ' != " so make the condition actually work. (same as r1.30) 2016-04-01 07:23:15 +00:00
alnsn 38047b2736 Don't enter infinite loop on big ktr_len values.
Fixes PR 49460.
2016-03-27 21:51:20 +00:00
christos f3a6400cd0 sprinkle more volatile (distribution build with gcc-5.3) 2016-03-18 18:42:25 +00:00
christos 0f160f0ea7 match the updated <sys/types.h> definition 2016-03-18 15:05:49 +00:00
christos e5012983f9 CID 1356387: Wrong sizeof 2016-03-16 21:01:28 +00:00
matthias 6c56f993ef honor setting .MAKE.JOBS from the makefile. That way one can e.g. do:
CPUS!=sysctl -n hw.ncpuonline
.MAKE.JOBS?=$(CPUS)
2016-03-16 16:04:44 +00:00
sjg 2271de011e Fix syntax 2016-03-16 00:19:01 +00:00
matthias 5c97c6933e Another small change to make archive member rules work. With this change
archive member rules seem to work as expected again.
2016-03-15 18:30:14 +00:00
matthias 7215e4a264 dynamic dependencies for library member targets are working again. 2016-03-15 06:25:14 +00:00
wiz 8abecf66a7 Be more precise. 2016-03-14 09:53:37 +00:00
matthias 00a4845b58 make $@ an alias for $! in archive member rules (compatibility with
other makes).
2016-03-14 07:42:15 +00:00
dholland 18a2ad4d42 Mark the shared files with where they're used, like we do in pkgsrc. 2016-03-13 00:33:12 +00:00
dholland d9047ae69b Use functions instead of preprocessor abuse. 2016-03-13 00:32:09 +00:00
dholland a4df8c35e0 a couple minor fixes 2016-03-12 22:37:32 +00:00
dholland 710ed66d56 Use execl() correctly. 2016-03-12 22:28:04 +00:00
dholland 1bdc2bf3d4 Add some additional BUGS. 2016-03-12 22:17:23 +00:00
dholland 84481ccbd0 Rework for clarity. 2016-03-12 22:07:48 +00:00
dholland dde5a5b4ad Minor tidyups. 2016-03-12 21:20:17 +00:00
dholland a4db6377a4 NetBSD does actually support flat-panel displays. Even for systat(1).
(noted by tnn)
2016-03-12 02:39:01 +00:00
christos 9c2b425841 PR/50953: David Binderman: Fix misplaced paren 2016-03-11 18:39:03 +00:00
matthias d405a55bc6 $% is $(.MEMBER) and not $(.ARCHIVE), $! is $(.ARCHIVE) and not $(.MEMBER) 2016-03-11 15:12:39 +00:00
matthias 449c0b7d1f make parsing of library member targets work. So
lib.a(member.o): something
	cp something member.o
	ar r lib.a member.o
	rm member.o

will work now.
2016-03-11 13:54:47 +00:00
sjg 6067bdd115 Handle missing file for Read the same as for Write, since if it
is Deleted we don't care.

Patch from Bryan Drewery.
2016-03-11 07:01:21 +00:00
joerg 7682402b4b Unbreak tools build. 2016-03-10 11:32:10 +00:00
christos e37f4314dd PR/50932: David Binderman: use emalloc/erealloc/ecalloc 2016-03-09 20:02:33 +00:00
chs 8da07e54f6 in find_idle_and_ttywrite(), initialize idletime and writable to 0
when stat() fails.  this prevents a coredump later in stimeprint()
due to gmtime() returning NULL for an uninitialized idletime.
2016-03-09 16:12:14 +00:00
christos f6295e9141 PR/50914: David Binderman: Fix memory leaks.
While here, fix error handling too.
2016-03-08 20:13:44 +00:00
martin 212399f8da Gcc, please shut up with those stupid warnings! 2016-03-07 22:16:38 +00:00
christos e46a288cba str2Lst_Append tokenizes the string and uses it in the list so we can't
free the string afterwards. Keep a copy of it and cleanup at the end.
2016-03-07 21:45:43 +00:00
sjg ab15168ea5 For :ts numeric escapes \x* is hex, anything else is octal. 2016-03-07 20:20:35 +00:00
martin cb0ca8dd7b Try to fix build on 32bit architectures. 2016-03-07 08:59:00 +00:00
plunky e01e653371 use correct offset for channel in SDP record 2016-03-06 21:12:07 +00:00
christos e33113ab6d Work around gcc on sparc64 bug 2016-03-06 18:01:28 +00:00
christos fd89278a5f PR/50897: David Binderman: fix memory leaks. While here, modernize error
handling, and types.
2016-03-06 16:13:21 +00:00
martin bf186f94c5 David Binderman in PR bin/50897: fix memory leak. 2016-03-06 15:44:06 +00:00
mrg 35f210138a if opening the audio device fails, try opening again with write-only.
this allows my playback-only usb device to be listed and tested.
2016-03-05 22:10:39 +00:00
dholland 6d1844cb1e Don't try to use stdin after clobbering it with a failed freopen().
Prevents an extra "Bad file descriptor" message when trying to hexdump
a single nonexistent file.

The intended behavior seems to have been to read from stdin if there
was one filename given and it wasn't valid. But this seems like a bad
idea, so prevent that case instead of hacking it up so it works.
2016-03-04 03:02:52 +00:00
dholland 7228911ac6 Don't use one function for two different things. Two functions is the
ticket.
2016-03-04 02:54:38 +00:00
dholland 63eec2f2f9 use "static" 2016-03-04 02:46:19 +00:00
christos bad095e351 PR/50872: David Binderman: Use logical and instead of arithmetic 2016-02-29 18:21:15 +00:00
christos bfc1db599b PR/50873: David Binderman: use logical or instead of arithmetic 2016-02-29 18:19:46 +00:00
christos 08b8c76dab Add visibility and weak 2016-02-27 21:37:14 +00:00
christos 64f5cd70a3 CID 1354295: Array overrun. 2016-02-27 16:31:31 +00:00
christos f3a4188b98 CID 1025009: Fix wrong code (NULL deref) 2016-02-27 16:20:06 +00:00
christos e20f46c663 CID 1025008: Free memory returned by Var_Subst 2016-02-27 16:18:47 +00:00
christos b6546efdb8 CID 1025007: Don't leak missingFiles 2016-02-27 16:17:26 +00:00
christos 0d70c98596 CID 1025006: pbm can't be NULL at this point. 2016-02-27 16:14:23 +00:00
sjg f7ebaac72f Let makefiles decide if depend file gets a meta file 2016-02-27 00:13:21 +00:00
wiz 2aa636aa06 Remove trailing whitespace. 2016-02-25 14:55:56 +00:00
ginsbach 522de9efc9 Fix obvious contraction spelling mistakes by adding missing apostrophes. 2016-02-25 13:23:27 +00:00
ginsbach 7a1819b192 Remove double space before [.,:] in macro arguments. 2016-02-24 17:38:15 +00:00
ginsbach 5299bba682 Add the [n]ei and [n]eei options to the synopsis; already documented in
description.
2016-02-24 17:13:48 +00:00
roy 48f2a68bff White space police. 2016-02-24 13:31:54 +00:00
roy 061eb16dc2 White space police. 2016-02-24 12:01:44 +00:00
ginsbach 3660d7d0e7 Use warnx(3). 2016-02-22 22:01:48 +00:00
ginsbach db3e293160 Stray '\n' in errx(3) format. 2016-02-22 21:20:29 +00:00
ginsbach 781408a293 Use errx(3). 2016-02-22 19:04:18 +00:00
wiz 69951fe427 Spelling fixes. 2016-02-20 01:43:28 +00:00
sjg 30ecb77bc6 Add a knob .MAKE.SAVE_DOLLARS to control the behavior of $$ during :=
If TRUE '$$' are not consumed (saved).
If FALSE '$$' becomes '$' just like normal expansion rules.

default is TRUE.

Reviewed by: christos
2016-02-20 01:19:03 +00:00
sjg dcbb4e91e7 Initialize curFile->depending in Parse_SetInput. 2016-02-19 06:19:06 +00:00
sjg 9359338bf8 getBoolean:
We need :U to ensure we get an empty string if knob isn't set.
2016-02-19 00:11:45 +00:00
sjg 230e72b2d8 Delete :@ loop iterator when done with it 2016-02-18 23:33:25 +00:00
sjg 3c092045e1 Adapt to changed Var_Subst() 2016-02-18 20:33:40 +00:00
sjg 8d916cfab5 Add .export-literal to avoid the need for $$ dance when trying to put
unexpanded variables into environment.

Reviewed by: christos
2016-02-18 20:25:08 +00:00
christos 4d0b1055db Collapse the 3 boolean parameter to 1 flags parameter. No functional change. 2016-02-18 18:29:14 +00:00
sjg f24ab88bf9 It's 2016 2016-02-18 06:18:58 +00:00
sjg f67d104eff Actually FALSE as last arg to Var_Subst makes more sense 2016-02-18 05:40:50 +00:00
sjg a6c0ebbea8 Add support for .dinclude
Like .sinclude missing file will be ignored.
Like .depend stale dependencies will be ignored.
Allows better implementation of auto depend.

Reviewed by: christos
Requested by: Bryan Drewery at FreeBSD.
2016-02-18 05:02:49 +00:00
sjg 71bb4da1c9 Adapt to new Var_Subst prototype 2016-02-18 05:01:39 +00:00
snj 00523047e3 allllllexander the greeeaaaaat, his name struck fear into hearts of men!
...but let's conquer that fear and give ol' alex a consistent and
correct date of death.

(he died of fever in baaaaaabylooooooonnnn)
2016-02-15 20:58:02 +00:00
christos 54835745af use sizeof() and array notation. 2016-02-06 21:23:09 +00:00
joerg bb694db2f5 METEORGSIGNAL and METEORSFMT overlap with dtrace, prefer the latter. 2016-02-06 20:21:56 +00:00
nonaka a3255ab05b Initialize the token match pointer. 2016-02-05 03:41:05 +00:00
dholland 289d830c55 File watt in the right group, and accept W as well, as that's quite
standard.
2016-02-05 03:38:50 +00:00
dholland ac57bd7b30 Improve previous slightly; while we accept e.g. "meter2" to mean "meter^2",
don't allow "meter-2" to be interpreted as "meter^-2" as that's very
confusing.
2016-02-05 03:32:49 +00:00
dholland 0561f14b04 Improve the parser. Now we understand negative exponents; fixes PR 50768.
Also handle negative numbers better in general (don't randomly drop
the sign in a number of cases) and don't choke on exponents > 9.

This commit alters the meaning of a few previously valid but marginal
inputs (e.g. "3 foot-5 pound" is now treated as "3*-5 foot-pound"
rather than "3*5 foot-pound"; if you want the latter insert another
space) but corrects obviously wrong handling of many more.
2016-02-05 03:30:08 +00:00
christos 24830f9883 PR/50750: David Binderman: Check bounds before dereference 2016-02-03 05:32:14 +00:00
christos cdc14da57c PR/50746: David Binderman: Check bounds before dereferencing. 2016-02-03 05:18:58 +00:00
christos 51d0c37238 PR/50739: David Binderman: Check bounds before dereferencing. 2016-02-01 17:41:37 +00:00
christos 5fa7ae025c remove clauses 3, 4 2016-01-29 15:19:01 +00:00
christos ed70d74604 PR/50712: David Binderman: Fix memory leaks. 2016-01-26 16:23:27 +00:00
christos 83163b539a Toolify 2016-01-24 20:14:44 +00:00
christos 1a7e9bc1af Add a program to find the latest timestamp in a cvs repository 2016-01-24 17:08:16 +00:00
christos ffeb8dbf4e Define _KERNTYPES for things that need it. 2016-01-23 21:22:45 +00:00
christos 3c25de4497 put _KMEMUSER in the Makefile 2016-01-23 16:12:03 +00:00
christos a687207309 Explain what REDIRECT is for. 2016-01-23 14:24:43 +00:00
dholland 7944f94c11 u_int -> unsigned int, in some of the output.
In the bulk of the output making this change would require reworking a
bunch of the internals to allow spaces in type names, which at the
moment doesn't seem worthwhile.
2016-01-23 02:33:09 +00:00
christos 59ef53c17c remove free NULL checks (Tilman Sauerbeck) 2016-01-17 17:45:21 +00:00
christos 9da037e3be provide missing FD_CLOEXEC for the havenots. 2016-01-17 15:32:38 +00:00
christos 43e2498875 Use FD_CLOEXEC (Tilman Sauerbeck) 2016-01-17 15:30:23 +00:00
wiz cbba3dff68 Fix some macros. Sort stuff some more. 2016-01-17 11:24:28 +00:00
christos 6fee39189c Update documentation. 2016-01-16 21:15:51 +00:00
christos 24926742d3 fix the option string. 2016-01-16 21:12:27 +00:00
christos ac2c28bce6 mention that nesting limit is unimplemented 2016-01-16 18:33:35 +00:00
christos 9c5ae85a12 add most gnu m4 long options 2016-01-16 18:31:29 +00:00
christos 42d917fdb8 add nesting_limit 2016-01-16 18:30:57 +00:00
christos 1e0a1203e1 record all input for fake freeze 2016-01-16 17:01:22 +00:00
christos 8178859046 Use hex for masks. 2016-01-16 17:01:01 +00:00
christos 59e8ea8f4c Add disabled support for saving and restoring the symbol table. 2016-01-16 17:00:07 +00:00
christos 8a4a35b9bc - don't eat the rest of the string when no match in patsubst
- include the pattern in the error printing of regex
- handle 3 argument and empty patterns the gnu way
- add support for freezing and thawing state (not working yet)
2016-01-16 16:59:18 +00:00
christos bf45a83338 - declarations for real/fake freeze
- add new flags
2016-01-16 16:57:29 +00:00
christos 50b61022b2 More gnu compatibility:
- handle macros > $9
	- handle character remapping the the gnu way.
Add a shortcut for the "fake freeze" files to not expand include macros
during thawing.
2016-01-16 16:56:21 +00:00
christos e4aa5bd87d this are our's not gnu 2016-01-14 04:27:26 +00:00
christos 9487d441fb Preserve $$ in := assignments..
FOO=\$$CRAP
BAR:=${FOO}

all:
	echo ${FOO}
	echo ${BAR}
2016-01-09 00:55:17 +00:00
wiz 30e99be8f8 Fix downloads of local files using file:// URLs
Previously it would error out in copyurlinfo() when copying a NULL port.
2016-01-05 11:41:00 +00:00
kamil 4929734205 Bump date for previous 2016-01-04 23:55:36 +00:00
kamil 1b333769e1 Add HISTORY and AUTHORS to jot
John A. Kunze requested to add himself as the author of jot
on the FreeBSD bugzilla with the following text:

  Please re-instate my name (as "John A. Kunze") as AUTHOR of the
  jot, rs, and lam utilities.  I wrote these in 1982, around or
  before the time that I worked with Jordan at UCB (he left to work
  at FreeBSD and later at Apple).  Thank you!

  -- https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196786

While there add a note that this tool first appeared in BSD 4.2.
This information is based on the FreeBSD manual pages.

Patch submitted by Michal Mazurek <akfaew AT jasminek.net>.

Reviewed by <dholland>
2016-01-04 23:32:45 +00:00
kamil ce1283db22 Add HISTORY and AUTHORS to lam
John A. Kunze requested to add himself as the authord of rs
on the FreeBSD bugzilla with the following text:

  Please re-instate my name (as "John A. Kunze") as AUTHOR of the
  jot, rs, and lam utilities.  I wrote these in 1982, around or
  before the time that I worked with Jordan at UCB (he left to work
  at FreeBSD and later at Apple).  Thank you!

  -- https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196786

While there add a note that this tool first appeared in BSD 4.2.
This information is based on the FreeBSD manual pages.

Patch submitted by Michal Mazurek <akfaew AT jasminek.net>.

Reviewed by <dholland>
2016-01-04 23:31:44 +00:00
kamil 48345a429a Add HISTORY and AUTHORS to rs
John A. Kunze requested to add himself as the authord of rs
on the FreeBSD bugzilla with the following text:

  Please re-instate my name (as "John A. Kunze") as AUTHOR of the
  jot, rs, and lam utilities.  I wrote these in 1982, around or
  before the time that I worked with Jordan at UCB (he left to work
  at FreeBSD and later at Apple).  Thank you!

  -- https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196786

While there add a note that this tool first appeared in BSD 4.2.
This information is based on the FreeBSD manual pages.

Patch submitted by Michal Mazurek <akfaew AT jasminek.net>.

Reviewed by <dholland>
2016-01-04 23:30:57 +00:00
martin c7acead6b8 Cast register_t to unsigned long before printf'ing it with %lx. 2016-01-04 08:24:42 +00:00
christos 149dca8a74 be a bit smarter about fcntl 2016-01-03 22:05:18 +00:00
christos 90c146a94b Put back -n 2016-01-03 15:38:29 +00:00
christos a7dfd957d5 Handle function symbol renames. 2016-01-02 17:44:33 +00:00
christos 7e015f61f6 print the length on error. 2016-01-02 17:44:21 +00:00
dholland 9dc9693718 Avoid leaking a file handle on error opening the next file. From
David Binderman in PR 50577.
2015-12-31 01:16:47 +00:00
christos 2732a80b37 Add rnd ops. 2015-12-30 18:15:38 +00:00
christos dade5d6c98 print the tag symbolically if we don't support it. 2015-12-22 23:35:21 +00:00
christos 4fff4f53aa From FreeBSD:
- Whitespace cleanup
- Pass a filename rather than fd to libarchive (should work with 2.8+)
- Accept zipfiles from stdin
- Extract common code from extract()/extract_stdout() to extract2fd() (pending)
2015-12-21 17:17:02 +00:00
christos e9dcc55b7e switch to getline(3) 2015-12-21 16:17:09 +00:00
sjg 349257c593 Suff_ClearSuffixes() needs to re-initialize suffNull,
otherwise its children retain old suffixes.
Have Suff_Init() call Suff_ClearSuffixes() for consistency.
2015-12-20 22:44:10 +00:00
christos 8ef345bff8 sort properly. 2015-12-20 00:48:36 +00:00
christos ff6e2ff2e8 Sort the subsections too... Hi Matt, you were right. 2015-12-20 00:40:44 +00:00
joerg d8a9f2abfc Fix tools build. 2015-12-19 17:30:00 +00:00
wiz c4edf3f3df Fix xrefs. 2015-12-19 00:25:16 +00:00
christos 088e556329 add sortinfo 2015-12-18 18:56:47 +00:00
christos 1f7a09da7b mark function as only needed with ssl. 2015-12-17 20:36:36 +00:00
christos 01e355354c Split the position/size parsing into a separate function. 2015-12-17 17:26:45 +00:00
christos 33fd699b86 Simplify and factor out connect message 2015-12-17 17:08:45 +00:00
nonaka ac27abcc55 - Fix to connect https via proxy.
- Fix ttyout message.
2015-12-17 04:36:56 +00:00
christos 7a83389f23 make DPRINTF/DWARN always statements. 2015-12-16 23:00:39 +00:00
christos 17562cefd2 PR/50438: NONAKA Kimihiro: ftp(1): CONNECT method support
Please test!
2015-12-16 21:11:47 +00:00
christos 941a869c25 more refactoring:
- introduce authinfo and urlinfo structures
	- split negotiation code out.
2015-12-16 19:17:16 +00:00
nonaka f6c8c6eefb Fix compile failure without WITH_SSL.
>    /tmp/bracket/build/2015.12.15.21.01.27-i386/src/usr.bin/ftp/fetch.c: In function 'fetch_url':
>    /tmp/bracket/build/2015.12.15.21.01.27-i386/src/usr.bin/ftp/fetch.c:823:18: error: 'HTTPS_URL_T' undeclared (first use in this function)
>           urltype == HTTPS_URL_T ? &ssl : NULL);
2015-12-16 01:20:05 +00:00
christos 82dbb89087 Factor the proxy handling code out. 2015-12-15 21:45:21 +00:00
christos 605492b2a8 Separate no_proxy handling. 2015-12-15 21:01:27 +00:00
christos 9444a4268c Try to factor out some code, this is completely out of control. 2015-12-15 20:49:49 +00:00
christos 093dea8259 use ecalloc 2015-12-14 03:15:10 +00:00
christos c7fdb70dcd PR/50546: David Binderman: Fix bad sizeof 2015-12-13 18:09:00 +00:00
tron ce945c29d6 (Hopefully) fix build without IPv6 support 2015-12-13 14:06:13 +00:00
dholland 67d56d848e Clarify that SCCS is a specific thing and not a generic thing. 2015-12-12 09:52:40 +00:00
dholland cd705862bc Remove spurious ARGSUSED. 2015-12-12 09:50:12 +00:00
plunky d82c710316 update several profiles, bringing up to date decoding of all the
Bluetooth 1.1->4.2 Service Discovery specifications I could find,
namely:

    Wireless Access Protocol
    Multi-Profile Specification
    Calendar, Tasks & Notes
    Message Access Profile
    Message Notification Service
    Global Navigation Satellite System
    Health Device Profile
    File Transfer Protocol
    3D Display
    General Access Profile
    Generic Attribute Server

all documentation is on bluetooth.org, under

    https://www.bluetooth.org/en-us/specification
2015-12-11 21:05:18 +00:00
tron 0d7f9f570d Use the proper format "[IPv6 address]:port" when reporting connection
attempts to IPv6 endpoints.
2015-12-11 08:37:31 +00:00
christos 048e0d6b52 simplify. 2015-12-03 20:01:19 +00:00
christos 96135c5b6f PR/50496: Alex Kozlov: teach unzip to extract symlinks
Our libarchive does not handle symliks yet, but later versions do.
Set mode and times for symlinks. Finally handle hardlinks for
completion although they are not handled yet by librarchive.
2015-12-03 20:00:12 +00:00
sjg b35a5f4c5f Fix evaluation of defined(FOO) and ${FOO} > 0
add a unit-test to catch it.
2015-12-02 00:28:24 +00:00
sjg 69ecbee5a0 Avoid calling brk_string() and hence Var_Export1() on
empty strings.
2015-12-01 07:26:08 +00:00
sjg 1c3d99f499 Use lstat(2) if we have a link, incase it is a symlink.
Patch from bdrewery at FreeBSD.org
2015-11-30 23:37:56 +00:00
sjg bea1b39c5f Avoid accessing beyond end of empty string.
Detected by Address Sanitizer - dim at FreeBSD.org
2015-11-30 23:15:43 +00:00
sjg 8098e1a571 ParseTrackInput: do not access beyond end of buffer.
Detected by Address Sanitizer - dim at FreeBSD.org
2015-11-26 00:23:04 +00:00
christos 1ef9a127cf PR/50360: Thomas Klausner: Fix MKREPRO issue 2015-11-25 01:12:03 +00:00
uebayasi e1ddff408d A few more. 2015-11-22 01:20:36 +00:00
christos e9836e5e7e fix format 2015-11-21 15:22:17 +00:00
christos 301b67f323 WARNS=6 2015-11-21 15:01:43 +00:00
christos 2ea5bc272a PR/50454: Timo Buhrmester: Fix wrong allocation for wall(1) -g
Modernize.
2015-11-21 14:59:51 +00:00
christos 2e3d23cd2c redo previous, not needed. 2015-11-13 19:13:50 +00:00
christos 4ae24fd01a Handle 0b locally since anyway this is not portable. 2015-11-13 16:04:58 +00:00
christos 5e9bf06a78 Recognize binary constants 2015-11-12 17:34:01 +00:00
pooka d0f0cf2fcb In ioconfname mode, #define IOCONF as the ioconf token.
Avoids having to retype the name to call config_init/fini_component().
2015-11-12 14:38:21 +00:00