Commit Graph

2019 Commits

Author SHA1 Message Date
jilles
2beda3228f sh: Fix exit status if return is used within a loop condition. 2010-09-11 15:07:40 +00:00
jilles
694b7e6c37 sh: Apply variable assignments left-to-right in bltinlookup().
Example:
  HOME=foo HOME=bar cd
2010-09-11 14:15:50 +00:00
jilles
73c5bdeaeb sh: Fix 'read' if all chars before the first IFS char are backslash-escaped.
Backslash-escaped characters did not set the flag for a non-IFS character.

MFC after:	2 weeks
2010-09-08 20:35:43 +00:00
jilles
817eae6892 sh: Add simple tests for backslashes in the read builtin. 2010-09-08 18:32:23 +00:00
jilles
8d1940fec4 sh: Add a test that 'read' leaves the file pointer at the correct place.
Naive buffering would break the common while read x... construct, which did
not appear to be tested yet.
2010-09-03 21:17:33 +00:00
phk
e895a280b3 We need to copy the ports config files before we launch the prefetch 2010-09-03 09:34:15 +00:00
imp
c5088c509e Allow / in the NANO_DEVICE
PR:		149729
Submitted by:	Thomas Quinot <thomas@cuivre.fr.eu.org>
2010-09-03 03:48:06 +00:00
jilles
662ba753ab sh: Weaken builtins/command4 test to only require a nonzero exit status.
This matches what is in POSIX; various other shells use different exit
statuses.

Note that it is still required that there be no output.
2010-08-29 20:53:24 +00:00
brian
a33d520868 Add a Makefile for tools/regression/bin and support 'all' in
pax/Makefile.

MFC after:	3 weeks
2010-08-29 12:14:53 +00:00
brian
a8d67237e0 Correct an out-by-one error when earlying out ustar filenames that
are too long.  Filenames escaping this test are caught later on,
so the bug doesn't cause any breakage.

Document the correct ustar limitations in pax.  As I have no access
to the IEEE 1003.2 spec, I can only assume that the limitations
imposed are in fact correct.

Add regression tests for the filename limitations imposed by pax.

MFC after:	3 weeks
2010-08-29 11:56:56 +00:00
kib
5afcfa8055 Test the poll(2) return value.
MFC after:	2 weeks
2010-08-28 17:38:40 +00:00
gabor
415098b7a0 - Change default grep back to GNU version. BSD grep can be built with the
WITH_BSD_GREP knob.
- Bump __FreeBSD_version

Requested by:   dougb
Approved by:    delphij (mentor)
2010-08-23 10:04:26 +00:00
jilles
44306000bd sh: Remove remnants of '!!' to negate pattern.
This Almquist extension was disabled long ago.

In pathname generation, components starting with '!!' were treated as
containing wildcards, causing unnecessary readdir (which could fail, causing
pathname generation to fail while it should not).
2010-08-22 21:18:21 +00:00
jilles
bf52da60ea sh: Test that all bytes from 128 to 255 can be used in IFS.
To avoid multibyte issues, this test forces ISO8859-1 charset.

This also passes on stable/8.
2010-08-22 13:09:12 +00:00
jilles
a0dc7e84cf sh: Add a test for breaking from a loop outside the current function.
It is unwise to rely on this but I'd like to know if this would break.
2010-08-22 11:04:30 +00:00
rpaulo
1702ed2db3 Update for the new tests.
Sponsored by:	The FreeBSD Foundation
2010-08-21 14:14:24 +00:00
pjd
d2e0fb8db2 More tests. 2010-08-18 22:06:43 +00:00
jilles
28527a66ab sh: Add a test for break from a trap action. 2010-08-18 20:26:50 +00:00
kib
2c928d3c34 Add simple test to check the functioning of retrieval of
pagesize()/pagesizes() after change to use aux vector. Note that
public function getosreldate() is different from libc-internal
__getosreldate() and does not use aux to fetch osreldate value.

MFC after:	1 month
2010-08-17 09:42:50 +00:00
pjd
407c718f42 More tests, especially for lchown(2). 2010-08-17 06:08:09 +00:00
jilles
71f5d94974 sh: Reduce unnecessary testsuite failures with other shells. 2010-08-16 22:23:19 +00:00
jilles
f87a1a2d3e sh: Split off a more dubious test from parser/heredoc2.0. 2010-08-16 21:14:49 +00:00
jilles
81d99cf50d sh: Get rid of unnecessary non-standard empty lists.
POSIX does not allow constructs like:
  if cmd; then fi
  { }
Add a colon dummy command, except in a test that verifies that such empty
lists do not cause crashes when used as a function definition.
2010-08-16 17:18:08 +00:00
pjd
59ce935eae Finish renaming fstest to pjdfstest. 2010-08-15 21:29:03 +00:00
pjd
4a1c311f9e Give fstest a more unique name: pjdfstest.
It is released from time to time and used outside FreeBSD, so it is good to
have a name one can google.
2010-08-15 21:24:17 +00:00
pjd
d4c7d76723 Update copyright years. 2010-08-15 21:20:40 +00:00
pjd
7ec16847fb More tests. 2010-08-15 21:19:42 +00:00
jilles
0328c8f214 sh: Fix break/continue/return sometimes not skipping the rest of dot script.
In our implementation and most others, a break or continue in a dot script
can break or continue a loop outside the dot script. This should cause all
further commands in the dot script to be skipped. However, cmdloop() did not
know about this and continued to parse and execute commands from the dot
script.

As described in the man page, a return in a dot script in a function returns
from the function, not only from the dot script. There was a similar issue
as with break and continue. In various other shells, the return appears to
return from the dot script, but POSIX seems not very clear about this.
2010-08-15 21:06:53 +00:00
jilles
072152a8c4 sh: Test that all bytes from 1 to 127 can be used in IFS.
This also passes on stable/8.
2010-08-15 17:14:05 +00:00
pjd
03b315a9ca More tests (especially for lchmod(2)), less code duplication. 2010-08-15 14:44:48 +00:00
pjd
4d7d840be1 - Use loops to avoid code duplication.
- More tests.
2010-08-13 21:17:59 +00:00
pjd
66fa238445 More tests. 2010-08-12 20:35:14 +00:00
pjd
2ac8e0568d Portable Makefile. 2010-08-12 19:45:27 +00:00
pjd
60f714732b Fix copy&pasted code - we want to create character device here. 2010-08-12 19:43:40 +00:00
pjd
ac4d0fab5f - Use loops where possible to avoid code duplication.
- Don't pass uid and gid to create_file() if not needed.
- More tests.
2010-08-11 17:34:58 +00:00
pjd
510a3e5097 Allow to specify uid, gid and mode for create_file(). 2010-08-11 17:33:32 +00:00
mjacob
5688dd21e9 Consistently set us to be SPC3 for our inquiry data.
For mptest, add delays to I/O that simulate real disks better. This
also allows us to simulate what happens when a device goes away
with active transactions. It's pretty spectacular.

Sponsored by:	Panasas
MFC after:	1 month
2010-08-11 17:25:14 +00:00
pjd
e000343bcd More and more tests. 2010-08-11 16:34:44 +00:00
pjd
c6ffc68b54 Move create_file() to misc.sh, as it is going to be used in more places. 2010-08-11 16:34:26 +00:00
pjd
81f412d303 Make use of recently added dirgen_max() and namegen_max() to implement
ENAMETOOLONG checks.
2010-08-11 16:33:17 +00:00
pjd
286e5bb227 Instead of hardcoding {NAME_MAX} as 255 and {PATH_MAX} as 1024 obtain those from
pathconf(2) and properly generate too long file names.
This should fix ENAMETOOLONG checks on Linux.
2010-08-11 16:29:12 +00:00
pjd
8afd703de9 More tests, mostly related to devices and sockets. 2010-08-10 22:57:43 +00:00
jilles
8824c5ab76 sh: Fix heap-based buffer overflow in pathname generation.
The buffer for generated pathnames could be too small in some cases. It
happened to be always at least PATH_MAX long, so there was never an overflow
if the resulting pathnames would be usable.

This bug may be abused if a script subjects input from an untrusted source
to pathname generation, which a bad idea anyhow. Most shell scripts do not
work on untrusted data. secteam@ says no advisory is necessary.

PR:		bin/148733
Reported by:	Changming Sun snnn119 at gmail com
MFC after:	10 days
2010-08-10 22:45:59 +00:00
pjd
db2419320f Linux has no strlcpy(). 2010-08-09 20:16:52 +00:00
pjd
bf33fb9a4b Fix bind(2) and connect(2) support on Solaris. 2010-08-09 17:42:04 +00:00
pjd
20a20b3ca3 Fix file system type detection on Solaris. 2010-08-09 17:40:59 +00:00
pjd
b69af9bb70 Small tweaks. 2010-08-09 17:37:29 +00:00
pjd
a26561868e No need to use grep to check if path start with /.
Suggested by:	ed
2010-08-09 17:34:57 +00:00
mjacob
fcb0104482 Add a multipath oriented test. 2010-08-09 00:36:22 +00:00
jilles
f9b80b004e sh: Add more testcases for ${var:-word}.
Whether POSIX requires these is unclear.

They pass with 8-stable sh as well.
2010-08-08 17:03:23 +00:00