Commit Graph

3236 Commits

Author SHA1 Message Date
Glen Barber
538354481e MFH
Sponsored by:	The FreeBSD Foundation
2016-03-14 18:54:29 +00:00
Jilles Tjoelker
7d980385e8 sh: Fix copying uninitialized field 'special'.
This just copied uninitialized data and did not depend on it later, so it
should not be dangerous.

Found by:	clang static analyzer
2016-03-13 22:54:14 +00:00
Konstantin Belousov
250d9fd8aa Fix handling of umtxp resource limit in sh(1)/ulimit(1), limits(1), add
login.conf(5) support.

Reviewed by:	jilles
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D5610
2016-03-12 14:54:34 +00:00
Glen Barber
7d536dc855 MFH
Sponsored by:	The FreeBSD Foundation
2016-03-10 21:16:01 +00:00
Bryan Drewery
15c433351f DIRDEPS_BUILD: Connect MK_TESTS.
Sponsored by:	EMC / Isilon Storage Division
2016-03-09 22:46:01 +00:00
Jilles Tjoelker
6dbe471130 sh: Add test for 'set -o nolog'.
The option does not do anything so check that the output of 'set +o' is
different.
2016-03-09 21:05:21 +00:00
Jilles Tjoelker
c94a041f43 sh: Avoid out-of-bounds access in setoptionbyindex() for 'set -o nolog'.
Reported by:	hrs
2016-03-09 21:00:57 +00:00
Glen Barber
7e2d468315 MFH
Sponsored by:	The FreeBSD Foundation
2016-03-07 15:44:54 +00:00
Jilles Tjoelker
acb4eada18 sh: Fix some dead stores.
Found by:	clang static analyzer
2016-03-06 17:24:02 +00:00
Glen Barber
b655ec9752 MFH
Sponsored by:	The FreeBSD Foundation
2016-03-06 04:13:17 +00:00
Mark Peek
26526cb970 Signal handling within tcsh vfork code path will conflict with some system
libraries (such as libthr) which maintain their own signal state. This
change adds the tcsh SAVESIGVEC option to save and restore the sigvecs for
the signals the child modifies before it execs.

Reviewed by:	kib, rwatson
Reported by:	kib
2016-03-05 19:55:42 +00:00
Glen Barber
42d27ee343 MFH
Sponsored by:	The FreeBSD Foundation
2016-03-02 23:53:08 +00:00
Jilles Tjoelker
2efd8c0a6c sh: Remove a redundant STPUTC check. 2016-03-02 22:52:54 +00:00
Jilles Tjoelker
90a2c7ea86 sh: Don't trust that signal descriptions fit within 49 bytes. 2016-03-02 21:24:46 +00:00
Glen Barber
52259a98ad MFH
Sponsored by:	The FreeBSD Foundation
2016-03-02 16:14:46 +00:00
Edward Tomasz Napierala
3ea98e058d dump(1) -> dump(8).
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-02-29 17:17:10 +00:00
Konstantin Belousov
1bdbd70599 Implement process-shared locks support for libthr.so.3, without
breaking the ABI.  Special value is stored in the lock pointer to
indicate shared lock, and offline page in the shared memory is
allocated to store the actual lock.

Reviewed by:	vangyzen (previous version)
Discussed with:	deischen, emaste, jhb, rwatson,
	Martin Simmons <martin@lispworks.com>
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
2016-02-28 17:52:33 +00:00
Edward Tomasz Napierala
75e5511214 Add speed limit to dd(1). This is useful for testing RCTL disk io limits
(when they actually get committed, that is), and might also come in handy
in other situations.

Reviewed by:	wblock@ (man page)
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-02-28 10:27:12 +00:00
Bryan Drewery
bd18fd57db DIRDEPS_BUILD: Regenerate without local dependencies.
These are no longer needed after the recent 'beforebuild: depend' changes
and hooking DIRDEPS_BUILD into a subset of FAST_DEPEND which supports
skipping 'make depend'.

Sponsored by:	EMC / Isilon Storage Division
2016-02-24 17:20:11 +00:00
Glen Barber
aef2f6ad2e MFH
Sponsored by:	The FreeBSD Foundation
2016-02-24 03:08:58 +00:00
Jilles Tjoelker
84f1891033 sh: Fix set -v and multiline history after r295825.
r295825 erroneously dropped the newline from the input data for 'set -v'
output and multiline history.

Reported by:	vangyzen
2016-02-23 22:44:01 +00:00
Glen Barber
317cec3c43 MFH
Sponsored by:	The FreeBSD Foundation
2016-02-22 12:28:23 +00:00
Jilles Tjoelker
2ece338651 sh: Don't hash alias name when there are no aliases. 2016-02-21 20:58:24 +00:00
Jilles Tjoelker
c39f3bac71 sh: Optimize setprompt(0).
Avoid doing work to print an empty prompt (such as when reading scripts).
2016-02-21 18:54:17 +00:00
Jilles Tjoelker
3b3c9ccf08 sh: Remove unnecessary flushouts while reading script.
Output is flushed when a builtin is done or immediately after writing it
(error messages, set -v output, prompts).
2016-02-21 16:48:37 +00:00
Edward Tomasz Napierala
674677bd08 Make the "invalid numeric value" error message actually displayable
(was a dead code before).

Submitted by:	bde@ (earlier version)
Reviewed by:	bde@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-02-21 14:36:50 +00:00
Jilles Tjoelker
dcd95d8a01 sh: Rework code to remove '\0' from shell input.
This fixes bugs where '\0' was not removed correctly and speeds up the
parser.
2016-02-19 21:53:12 +00:00
Jilles Tjoelker
a3ec59c20a sh: Add tests for comments in sh -c. 2016-02-19 16:56:07 +00:00
Thomas Quinot
cd1832fe92 Reorganize the handling all-zeroes terminal block in sparse mode
The intent of the previous code in that case was to force
an explicit write, but the implementation was incorrect, and
as a result the write was never performed. This new implementation
instead uses ftruncate(2) to extend the file with a trailing hole.

Also introduce regression tests for these cases.

PR: 189284
(original PR whose fix introduced this bug)

PR: 207092

Differential Revision:	D5248
Reviewed by:	sobomax,kib
MFC after:	2 weeks
2016-02-18 08:44:16 +00:00
Glen Barber
72c3aa02dc MFH
Sponsored by:	The FreeBSD Foundation
2016-02-18 00:37:58 +00:00
Bryan Drewery
d3157f0915 Test directories can build in parallel fine.
Sponsored by:	EMC / Isilon Storage Division
2016-02-16 02:13:59 +00:00
Glen Barber
30922917c8 MFH
Sponsored by:	The FreeBSD Foundation
2016-02-10 04:20:39 +00:00
Glen Barber
ac2875fa16 Explicitly add unmarked bin/ binaries to the runtime package.
Note: tcsh(1) has a MK_TCSH=no test, so this should be a separate
package, which requires pre-install/post-install scripts, to be
added later.

Sponsored by:	The FreeBSD Foundation
2016-02-09 16:58:50 +00:00
Glen Barber
406009982a Add rcp(1) to the rcmds package.
Sponsored by:	The FreeBSD Foundation
2016-02-09 16:56:35 +00:00
Glen Barber
ee76423597 Add rmail to the sendmail package
Sponsored by:	The FreeBSD Foundation
2016-02-09 16:54:04 +00:00
Konstantin Belousov
db57c70a5b Rename P_KTHREAD struct proc p_flag to P_KPROC.
I left as is an apparent bug in ntoskrnl_var.h:AT_PASSIVE_LEVEL()
definition.

Suggested by:	jhb
Sponsored by:	The FreeBSD Foundation
2016-02-09 16:30:16 +00:00
Edward Tomasz Napierala
c075c8bb77 Improve comment to reflect recent changes.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-02-09 09:38:05 +00:00
Edward Tomasz Napierala
f30414423a Use a proper type for return value of postfix_to_mult(); the way it's
being used wouldn't work if the value returned didn't fit in intmax_t.

Submitted by:	bde@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-02-09 09:37:04 +00:00
Edward Tomasz Napierala
d819236121 Use proper functions for parsing the numeric values.
Submitted by:	bde@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-02-09 09:32:10 +00:00
Glen Barber
bbb51924bb MFH
Sponsored by:	The FreeBSD Foundation
2016-02-08 12:16:01 +00:00
Edward Tomasz Napierala
e53d0abf73 Add 't' and 'p' postfixes to dd(1).
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-02-04 15:21:01 +00:00
Edward Tomasz Napierala
66d082c84b Reduce code duplication.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-02-04 15:10:08 +00:00
Bryan Drewery
f408f6043a Don't link /usr/share/nls/de_DE.UTF-8/tcsh.cat to itself.
Sponsored by:	EMC / Isilon Storage Division
2016-02-03 23:37:24 +00:00
Glen Barber
1f4bcc459a More 'tests' packaging fixes.
Sponsored by:	The FreeBSD Foundation
2016-02-03 19:08:45 +00:00
Glen Barber
c4429c7e7c Fix build.
Sponsored by:	The FreeBSD Foundation
2016-02-03 18:06:58 +00:00
Hajimu UMEMOTO
e4b59b10f8 The charset of NLS catalogs were converted to UTF-8
since r231990.
2016-02-03 11:44:43 +00:00
Glen Barber
221b349912 MFH
Sponsored by:	The FreeBSD Foundation
2016-02-02 22:27:48 +00:00
Glen Barber
43faedc133 First pass to fix the 'tests' packages.
Sponsored by:	The FreeBSD Foundation
2016-02-02 22:26:49 +00:00
Hajimu UMEMOTO
46c57c6794 Make dynamic link of libiconv from ports work again.
The symbols of libiconv from ports were changed to
have prefixed.
Since we have iconv in our libc these days, we don't
need it on 10.X and later.  However, 9.X still need
this.

Spotted by:	Yoshihiko Sarumaru
MFC after:	1 days
2016-02-02 11:51:18 +00:00
Jilles Tjoelker
bd9b38d1f7 sh: Don't allocate a redirtab if there are no redirections.
Builtins (including variable assignments without command word), function
calls and redirected compound commands need to restore file descriptors
to their original state after execution. This is handled by allocating a
redirtab structure. These mallocs and frees show up heavily in pmcstat.

Only allocate a redirtab if there are actually redirections and maintain a
count of how many levels of REDIR_PUSH there are without redirtabs.

A simple loop without external programs like

sh -c 'i=0; w=$(printf %0100d 7); while [ "$i" -lt 1000000 ]; do
    i=$((i+1)); done'

is over 25% faster on an amd64 bhyve VM.
2016-01-30 21:21:25 +00:00