Commit Graph

12929 Commits

Author SHA1 Message Date
christos be0200b5b7 remove unused label 2015-06-19 17:20:02 +00:00
christos 43fc769556 remove useless assignment and explain why. 2015-06-19 17:17:24 +00:00
christos a038441bc0 restore use of whitespace needing shell. 2015-06-19 14:32:56 +00:00
christos 0002ddbc7d make needshell customizable, so that xinstall can use it. 2015-06-19 14:32:04 +00:00
christos 3f6f33cbde create needshell so we don't scan the string multiple times. 2015-06-19 14:25:34 +00:00
christos fc12b1912c use isspace() 2015-06-19 14:25:16 +00:00
mlelstv 75fd2a8412 Adjust metachar handling to previous behaviour:
- space and tab are no shell metachars, remove them from generic
  metachar function
- add space and tab as to-be-quoted characters for :Q modifier
- add = and : as characters that require command handling by the shell
2015-06-19 08:03:35 +00:00
christos 12ca937409 grr too many different compilation options. 2015-06-18 19:49:08 +00:00
christos e02fe630ea this is not buf.c 2015-06-18 15:51:57 +00:00
justin a9e309ea46 Fix non native build on metachar.c 2015-06-18 15:34:44 +00:00
christos 9beb5dadf3 Centralize the "is a meta char" test, instead of using two different arrays. 2015-06-17 17:43:23 +00:00
christos 5e58d82807 restore unlink file if strip fails (from Takeshi Nakayama) 2015-06-17 15:52:37 +00:00
christos b1e483495a centralize shell metachar handling. 2015-06-17 15:34:55 +00:00
christos e9677ce525 Use the bourne shell if the after command has shell metachars. 2015-06-17 15:34:08 +00:00
christos 62c8098c95 add missing quote, remove some braces. 2015-06-17 01:38:02 +00:00
christos 7d718eded8 one more stray \n 2015-06-17 00:03:42 +00:00
christos afe59ce9dc more stray \n 2015-06-17 00:01:59 +00:00
christos b72399dd23 fix error statement 2015-06-16 23:44:44 +00:00
christos 616ae4c0ec fix printf statement 2015-06-16 23:42:08 +00:00
christos ff53269704 fix some error handling. 2015-06-16 22:54:10 +00:00
christos b921b70209 remove stray newlines from errors/warnings 2015-06-16 21:12:19 +00:00
christos 561ef1fe67 - improve error printing
- deduplicate run functions and don't use the shell so that we handle
  filenames with spaces and metacharacters consistently.
2015-06-15 16:33:38 +00:00
martin 61f9154cab Add optional support for posix_spawn (instead of vfork) and enable it for
the in-tree build.
2015-06-15 07:05:09 +00:00
martin 25ed20a82e Do not set MLIBDIR if MKCOMPAT=no 2015-06-13 20:38:52 +00:00
gson cebb0ef7cc Don't call exit() from a signal handler, as it's not async-signal-safe;
use _exit() instead.
2015-06-11 18:12:00 +00:00
mrg 9c78f1be19 midirecord first appears in netbsd 7. 2015-06-08 06:33:35 +00:00
joerg fc207b9190 Format-string related warnings work fine now with both GCC 4.8 and
Clang.
2015-06-06 13:48:37 +00:00
joerg d88f290a56 Drop assignment from uninitialized and otherwise unused variable. 2015-06-06 13:08:31 +00:00
wiz b96dc7bfa6 Drop trailing whitespace. 2015-06-05 07:33:40 +00:00
sjg fab1dc5098 Document .OBJDIR target. 2015-06-05 05:37:42 +00:00
enami aeb1240e20 Fix expand() to process successive escape sequences correctly. 2015-06-03 23:15:22 +00:00
wiz 9424727910 Add missing .El and other minor fixes. 2015-06-03 14:38:38 +00:00
christos c3b6f86ce5 Add a gettext implementation from William Orr. 2015-06-03 14:32:16 +00:00
manu 41797faa82 Fix warning about uninitialized variable
This warning gets fatal when including make(1) as a crunchgen(1) binary.
2015-05-25 09:01:06 +00:00
manu cbae0e6269 Make sure netstat builds with -DSMALL
src/usr.bin/netstat relies on code from src/sbin/route. WHen building
with -DSMALL, some functions such as mpls_ntoa() or p_rtrmx() are not
built in src/sbin/route. We therefore have to make sure they are not
used in src/usr.bin/netstat.
2015-05-25 03:56:20 +00:00
christos 2dad2d2d11 Add -N (VIS_NOLOCALE), sort. 2015-05-24 19:42:39 +00:00
matt 2a4267c6e4 #include <sys/exec_elf.h> for ksyms 2015-05-20 07:16:15 +00:00
matt cac6d59cc3 Use :Q instead of " to quote make vars DBG and LDSTATIC 2015-05-16 02:33:12 +00:00
ozaki-r 6011d36bd6 Fix rump.{netstat,route} shows host's interface names in link local addresses
Interface names of IPv6 link local addresses are resolved
by getnameinfo(3). So we need to rump-ify it as well as
if_indextoname and getifaddrs.
2015-05-15 06:58:59 +00:00
joerg 1d5828794c Mark error as dead. 2015-05-13 20:13:21 +00:00
christos cd5bb2fe49 handle compound literals with a trailing comma 2015-05-11 17:20:06 +00:00
dholland 5a52d2d51f Remove pointless casts. 2015-05-09 23:29:51 +00:00
dholland 90a10bbb8a Make error() printflike instead of using sprintf before calling it. 2015-05-09 23:28:43 +00:00
dholland 98fbb52a77 Use proper (enough) parentheses in macro expansion. 2015-05-09 23:19:34 +00:00
dholland 86f52a859f Use errx when malloc fails, and also don't cast the return value of
malloc/realloc.
2015-05-09 23:16:51 +00:00
dholland d4e3de0b16 one crash -> errx Christos missed 2015-05-09 23:14:22 +00:00
dholland ceecfabaa7 Polish the error messages.
Don't use warn/err to print error messages about the input, as
prepending the program name to those both isn't helpful and confuses
programs that try to parse compile logs.
2015-05-09 23:12:57 +00:00
dholland d1ac143f58 #if 0 code should still compile :-) 2015-05-09 22:58:22 +00:00
christos 8cde9e3d9b modernize:
- make crash() called atexit
	- use err/errx
	- remove __P
2015-05-09 21:44:47 +00:00
dholland a9ad5ddc08 Also check the other emitted getrlimit call for failure. 2015-05-09 18:48:14 +00:00
christos bb21fbff87 CID 1225082: Check getrlimit() return 2015-05-09 15:12:12 +00:00
sjg ca0319bf7c When evaluating condtionals from .if we want to require
that the lhs is a variable reference, a number or a quoted string.
This helps avoid subtle bugs caused by typos.

When conditionals are being evaluated during variable expansion
we cannot be as strict becuase lhs will already have been expanded.

We therefor pass a boolean to Cond_EvalExpression to tell it how
lhs should be treated.

Add unit-tests/cond2.mk to test the above

Reviewed by: christos, joerg
2015-05-05 21:51:09 +00:00
lukem ee0aef00c4 Add -x xferbufsize to set xferbuf size.
Implement  -x xferbufsize  set the socket send and receive buffer size,
as per 'xferbuf' in interactive mode.

Patch from Nicholas Mills (via private mail), with minor adjustment by me.
2015-04-23 23:31:23 +00:00
snj 68a743c9eb Update for 2015 dates. From Jeff Woodall in PR misc/49587, with
a typo fixed in Election Day (and the "even years" bit removed).
2015-04-23 06:19:10 +00:00
joerg 0057d0442d Explain what max is and handle i reaching it again. 2015-04-16 13:31:03 +00:00
joerg e2d874fb89 Don't use memcpy for overlapping ranges. Simplify, memmove is good
enough to skip empty ranges.
2015-04-16 11:39:23 +00:00
pooka 6ee4aeae8e Accept 0 size for -d type=reg, it grows dynamically anyway.
(though perhaps there should be some way to limit that)
2015-04-16 10:05:43 +00:00
christos d6eaf99167 Coverity CID 1264915, Via FreeBSD (Xin Li)
When reading in the original file name from gzip header, we read
in PATH_MAX + 1 bytes from the file.  In r281500, strrchr() is
used to strip possible path portion of the file name to mitigate
a possible attack.  Unfortunately, strrchr() expects a buffer
that is NUL-terminated, and since we are processing potentially
untrusted data, we can not assert that be always true.

Solve this by reading in one less byte (now PATH_MAX) and
explicitly terminate the buffer after the read size with NUL.
2015-04-15 02:29:12 +00:00
sjg 545bddb17b Use separate vars to track cwd and last dir a process read. 2015-04-11 05:24:30 +00:00
sjg c6534f45d3 export-all.mk should be including export.mk
sadly some shells do not grok named signals.
2015-04-10 20:41:59 +00:00
tron d1aa912cef Fix casts which are inconsistent with *printf() formats and remove the
use of a non-standard type in the process.
2015-04-10 09:34:43 +00:00
wiz 2690505034 It's 2015. 2015-04-10 08:43:32 +00:00
wiz 302cc6cfe4 Remove trailing whitespace. 2015-04-10 08:43:16 +00:00
uebayasi c59f84ea6d Typo in previous. 2015-04-10 03:51:44 +00:00
uebayasi e29416eeae More about attribute -> bus, and child configuration. 2015-04-10 03:30:09 +00:00
sjg baa0bd3c22 Forgot to tweak date 2015-04-09 18:22:08 +00:00
sjg 065f2cad03 jobs mode handles '-' very differently to compat mode, but this is not
reflected in make.1
Also fix handling to match the behavior described in the comment
of JobPrintCommand (only matters if shell sets hasErrCtl).

A better long term solution is needed since the current behavior
is sub-optimal wrt '-' and different from all other makes.

Reviewed by: christos
2015-04-09 18:21:01 +00:00
christos 4e91feb5e1 remove ancient dup. 2015-04-07 17:49:40 +00:00
plunky 312b53dde5 change _whatdb => _mandb as that is the correct keyword here,
and move it to the correct position in the list.
2015-04-07 10:17:21 +00:00
wiz 75bbcb9aa1 Document xz decompression support better. From Joachim Henke on netbsd-docs. 2015-04-06 21:41:17 +00:00
christos 27de1fdbf3 build ops.h first, because trying to build dependencies and ops.h at the
same time leads to spurious failures.
2015-04-04 19:32:06 +00:00
christos 60a029958d accept typenames in param decls. 2015-04-03 21:40:04 +00:00
sjg 73c21af432 Close child's reference to meta file. 2015-04-01 01:03:55 +00:00
sjg f15792411b Move initialization of savederr to the block where it is used
to avoid spurious warning from gcc 5
2015-03-26 22:20:42 +00:00
roy a37502b2b6 Add RTF_BROADCAST to mark routes used for the broadcast address when
they are created on the fly. This makes it clear what the route is for
and allows an optimisation in ip_output() by avoiding a call to
in_broadcast() because most of the time we do talk to a host.
It also avoids a needless allocation for the storage of llinfo_arp and
thus vanishes from arp(8) - it showed as incomplete anyway so this
is a nice side effect.

Guard against this and routes marked with RTF_BLACKHOLE in
ip_fastforward().
While here, guard against routes marked with RTF_BLACKHOLE in
ip6_fastforward().
RTF_BROADCAST is IPv4 only, so don't bother checking that here.
2015-03-23 18:33:17 +00:00
mrg 99baa91ed3 if not playing (-q mode), don't call ioctl() or try to use the results.
now -q mode works.
2015-03-22 22:47:43 +00:00
plunky e8fd30eb55 parse and print the HIDLANGIDBaseList attribute 2015-03-16 19:10:48 +00:00
christos cefb10afe1 The latest refactoring changes broke sed -i:
cd /tmp; echo foo > test; sed -i.orig s,fo,ba, test
Back them out until they are fixed.
2015-03-12 12:40:41 +00:00
jnemeth 71db0be446 note birth and death of Douglas Adams 2015-03-11 17:35:16 +00:00
mlelstv 170fbd6544 Resolve names of datagram services correctly. 2015-03-08 06:46:51 +00:00
christos b52075bfab add flag that let's you not wait for all the processes specified. 2015-03-04 16:36:12 +00:00
christos ee9a5a1870 PR/49716: Henning Petersen: Use false and true on bool, fix sign in printf
formats.
2015-03-04 13:34:49 +00:00
christos dacc247666 PR/49714: Henning Petersen: Change NULL in EV_SET to 0. 2015-03-04 13:31:53 +00:00
christos 1fddf0eec4 Add a timeout parameter. 2015-03-03 19:59:48 +00:00
christos c7da06e6d1 there is no more makewhatis; it has been replaced by makemandb 2015-03-03 17:59:32 +00:00
christos 90298a02bf add pwait 2015-03-02 21:54:13 +00:00
christos 8fb724825c Add -s option, cleanup warnings. 2015-03-02 21:53:48 +00:00
christos b957b96ffc Add pwait, from FreeBSD 2015-03-02 21:43:39 +00:00
enami c1e351a1b2 Don't truncate at microseconds while preserving timestamps.
One of motivation of this change is to make the behavior of test(1)
-nt/ot with preserved copy (like cp -p) closer to the NetBSD 6.
Of course whether full timestamps are kept or not depends also on
underlying file system.

The ifdef added in mv(1) since existing ifdefs was our local change
to compile it on solaris (though I couldn't test it):
http://mail-index.netbsd.org/tech-userlevel/2014/11/28/msg008831.html
2015-03-02 03:17:24 +00:00
mrg fe7264a410 be explicit about stdout mode. 2015-03-01 09:56:54 +00:00
asau 7004d56080 Hide more subroutines in processing phase. 2015-03-01 01:07:46 +00:00
asau 2390183275 Close files opened at processing time within processing phase. 2015-03-01 01:00:07 +00:00
asau ee4b150430 Move run-time data structures into processing part. 2015-03-01 00:51:08 +00:00
asau 82be1f5db2 Move data I/O file pointers into processing part. 2015-03-01 00:38:01 +00:00
asau 1f228785da Improve modularity of "sed" source:
- move program source input subroutines into compiler part;
- move data I/O subroutines into processor part.
2015-02-28 21:56:53 +00:00
roy 81601736f6 Document RTF_LOCAL 2015-02-26 09:58:12 +00:00
christos 95f20280d9 Treat complex numbers like other floating numbers. This caused a core-dump
when linting libm complex code and assumed the size of the type larger than
the array size of value bitmaps.
2015-02-09 18:17:34 +00:00
christos 3934378a65 Allocate the right size for pcb blocks.
XXX: pullup-7!
2015-02-08 15:09:45 +00:00
christos b0698f50d1 print the timer flags. 2015-02-07 19:36:06 +00:00
christos 58fd765e07 Add QXL, re-enable I915 2015-02-07 14:37:42 +00:00
martin 3af45c0517 Drop i915, it still causes duplicate case statements
(DRM_IOCTL_QXL_UPDATE_AREA == DRM_IOCTL_I915_BATCHBUFFER)
2015-02-07 11:24:55 +00:00
christos e4344b2827 Extend the scripts to handle the X drm ioctls. 2015-02-06 20:08:23 +00:00
christos 3babb960e1 Extend the list of the headers processed to generate symbolic ioctls to
the X sets, and include the DRM ioctls. Unfortunately the DRM ioctls for
different cards overlap, so until I write some code to merge them, only
enable one (currently the i915).
2015-02-06 20:07:45 +00:00
christos 42e28dd7ad use strtoi instead of strtonum, since this is a tool. 2015-01-29 19:26:20 +00:00
christos b3decb4766 latent strtonum removal. 2015-01-29 13:20:51 +00:00
christos f47593bb0f use strtonum from libc (Kamil Rytarowski) 2015-01-29 03:28:19 +00:00
christos fff8579aad delete extern 2015-01-29 03:27:06 +00:00
christos 93da4522d3 appease gcc-4.5.4 2015-01-22 20:01:22 +00:00
gson 7a9652e2cb Retry read() on EINTR. Fixes premature exit of
</dev/random progress -e cat >/dev/null
2015-01-17 10:57:51 +00:00
mrg a1b1261ab6 do not use directory paths present in gzip files with the -N flag,
similar to the problem reported in pigz.
2015-01-13 02:37:20 +00:00
christos eea786b46d Increase the buffer limit; otherwise files in:
http://www.taxdetective.ca/Samples/sampledatafiles.html

fail.
2015-01-12 14:17:08 +00:00
christos e8283fa6b1 fix wordexp result handling 2015-01-10 17:16:01 +00:00
christos ef0ab4422a fix incorrect arg size computation 2015-01-10 17:16:00 +00:00
prlw1 8707c3a333 Simplify code so that gcc 4.8 can understand it.
http://mail-index.netbsd.org/tech-userlevel/2015/01/06/msg008882.html
2015-01-09 12:45:32 +00:00
riastradh 3299a48014 Omit no longer existing l, m from default trace points. 2015-01-08 22:03:42 +00:00
christos 819d4545f4 Provide -C == -A + -B like fgrep, from Anon Ymous 2015-01-08 03:56:33 +00:00
christos f8128537a0 adjust to the netname4 prototype. 2015-01-07 22:43:01 +00:00
pooka 0397f3a735 Move sysproxy support into a separate component, rumpkern_sysproxy,
instead of it being always provided by the rump kernel base.  This
move accomplishes two things:

1) it is no longer necessary to provide sysproxy hypercall stubs for
   platforms which do not want to use sysproxy
2) it is easier to reason about the security aspects, since configurations
   not linking the sysproxy component simply do not support remote
   system calls

discussed on rumpkernel-users
2015-01-07 22:24:03 +00:00
joerg 1382c4d712 Don't depend on yacc skeleton to include sys/cdefs.h early. 2015-01-04 18:31:09 +00:00
joerg 6e60cc85b0 Mark debug_log as printf-like. 2015-01-03 22:57:54 +00:00
christos da9cda45ee don't shadow div(3) 2015-01-01 04:57:01 +00:00
mrg 4fe8b4e652 - this is midirecord(1) not midiorecord(1)
- add the -o handling to the getopt() and man page
- bump date
2014-12-30 18:52:47 +00:00
wiz 6fc026f9ce Sync usage with man page. 2014-12-30 12:14:34 +00:00
wiz bd9cac43f4 Describe -T. Sync SYNOPSIS with options. Sort options.
Remove trailing whitespace. Use more markup.
2014-12-30 12:10:07 +00:00
mrg 34602bc4ec only prev_div needs to be static.
add channel to some log messages.
2014-12-30 06:08:14 +00:00
mrg e2cc3fc481 install midirecord. 2014-12-30 04:22:18 +00:00
mrg 3f4db5ffea add a program to record midi files from /dev/music.
this doesn't process several potential result that netbsd does
not output on /dev/music, and should be largely complete for
our current sequencer(4).
2014-12-30 04:14:25 +00:00
mrg 9dd3b8ae69 add a decode_uint() function. 2014-12-30 01:22:09 +00:00
christos ad7787327b And correct it. 2014-12-26 12:45:57 +00:00
christos 1a965b8777 Correct the provenance of finger.1 and show the link that it was part of
2BSD (from Marcin F. Michalski)
2014-12-26 03:49:00 +00:00
christos f4b2cc8e89 Correct provenance of who(1) (from Marcin F. Michalski) 2014-12-26 01:43:58 +00:00
dennis 7ad3371ebc Update stats-keeping in sys/kern/vfs_cache.c to remove (most)
races while allowing consistent lockless sampling of the per-cpu
statistics without atomic operations.  Update comment describing
the locking protocol to include this.

These files were fumble-fingered out of the last commit.
2014-12-24 20:01:21 +00:00
dennis 61933bb52e Move enough additional 'w' code into 'uptime' to keep the latter
from double-counting utmp users.
2014-12-22 15:24:14 +00:00
christos 2a8765d5a2 Fix various security related issues:
0001. Do not recognize paths, mail folders, and pipes in mail addresses
    by default.  That avoids a direct command injection with syntactically
    valid email addresses starting with |.

    Such addresses can be specified both on the command line, the mail
    headers (with -t) or in address lines copied over from previous
    while replying.

    This was assigned CVE-2014-7844 for some versions of BSD mailx.  It is
    documented behavior for Heirloom mailx, and was mentioned in an old
    technical report about BSD mailx (which does not usually make its way
    into operating system installations).  The patch switches off this
    processing and updates the documentation.

Added expandaddr option to explicitly enable this behavior.

    0002. When invoking sendmail, prevent option processing for email
    address arguments.  This prevents changing e.g. the Postfix
    configuration file in unexpected ways.  This behavior was documented for
    BSD mailx (sort of), but not for Heirloom mailx.  We did not assign a
    CVE to this because it is more of a missing feature, and code invoking
    mailx needs adjustment in the caller as well.

Fixed.

    0003. Make wordexp support mandatory.  (No functional change.)

Fixed (replaced explicit shell pipe implementation).

    0004. Prevent command execution in the expand function, which is IMHO
    unexpected.  (Not really required with patch 1, and there is still
    information disclosure/DoS potential if this expansion occurs.)  This is
    a historic vulnerability already fixed in the Debian package,
    retroactively assigned CVE-2004-2771:

Fixed (as part of the pipe replacement with wordexp).
2014-12-16 19:30:24 +00:00
uebayasi d8aa702d35 Revert debug code. Simplify. 2014-12-15 15:49:25 +00:00
uebayasi fc1f7728b8 config(1): Fix build of old trees (bin/49389) (take 2)
Look into sys/conf/Makefile.kern.inc to check if "build_kernel" .USE target
is defined.  If not (== old source trees), generate one on the fly.
2014-12-15 15:41:18 +00:00
uebayasi 10b064f35c config(1): Fix build of old tree (bin/49389)
Define the default, empty "build_kernel" target, so that old source trees,
whose sys/conf/Makefile.kern.inc don't have "build_kernel" .USE target, can
be built.

(When "build_kernel" is defined, the target is overriden, as far as
sys/conf/Makefile.kern.inc is included later than the "netbsd: ..." definition
in sys/arch/*/conf/Makefile.*.)

This should address PR bin/49389.
2014-12-15 10:10:24 +00:00
mrg 4023260255 redo the previous; avoid a bunch of processing when running as "uptime",
and as a side effect, avoid any name lookups.
2014-12-03 06:12:19 +00:00
christos 3f1eb4e425 if doing uptime, don't bother resolving names. 2014-12-02 22:19:19 +00:00
christos 938d39fd7f PR/49422: Ryo ONODERA: patch(1) cannot handle context diffs 2014-11-27 15:07:23 +00:00
enami 11fe7239df Changes done in rsh.c rev. 1.36 was incomplete. As chuq pointed
in private mail, it broke rcp(1).

To achieve the documented behavior and to fix long standing incorrect
rsh(1) behavior which I've tried to fix in rev. 1.36, rcmd(1) should have
two operation mode; whether it should relay signal information on
auxiliary channel or not, depending on the argument `fd2p' passed to rcmd(3).
So, make rcmd(1) behave differntly depending on the environment variable and
set it when necessary in rcmd(3) according to how auxiliary channel
is set up by rcmd(3).
2014-11-26 23:44:21 +00:00
christos 59de200486 Avoid coredumps when the linenumbers in the hunks turn negative.
From: http://marc.info/?l=openbsd-tech&m=141693055412785

XXX: pullup 7
2014-11-26 00:31:32 +00:00
christos c8da6eb49b Use proper index types, delete casts, use correct sizeof() in allocations. 2014-11-21 20:46:56 +00:00
christos bf68803d37 allow c99 flexible arrays for packed structures. 2014-11-20 21:17:18 +00:00
christos caa0961bff Always set i_brace in the struct case.
Cleanup some debugging.
2014-11-20 20:49:06 +00:00
christos a6210a763e add LDEBUG 2014-11-20 20:48:33 +00:00
riastradh 9783666546 Fix vndcompress restart failure fallback when input is a pipe.
Defer seeking the *input* image, or winding it forward, until we are
certain we all ready in the cloop2 output, because when the input
image is a pipe, we don't get a chance to seek back to the beginning
and start from the top instead of restarting.

If restart does fail, don't try to seek the input image back to the
beginning unless we had already tried to seek or wind it forward.

Add some automatic tests for this and related cases.

XXX pullup to netbsd-7, netbsd-6
2014-11-18 03:48:17 +00:00
uebayasi 57751c8485 Pre-calc file path len/suffix. Misc. clean up. 2014-11-17 00:53:15 +00:00
uebayasi 9eb1865390 Fix oops in r1.30. 2014-11-16 15:10:54 +00:00
uebayasi d2824e0952 Simpfily code by assuming suffix is a single character. 2014-11-16 14:57:59 +00:00