Commit Graph

2566 Commits

Author SHA1 Message Date
jmc 94eaa31771 Apply user supplied patterns first before applying actions for -A. This way pax
behavior WRT to patterns lines up with the example in the documentation
and how other implementations do it as well since -A is a non-standard
option/behavior. Fixes items noted in PR#23776
2005-01-23 06:19:03 +00:00
dsl 3b8851c887 Check for *ptr == 0, not ptr == NULL twice when validating -s xxxxx in tar mode.
Fixes PR bin/29040
Also actually report an error to the tty if NET2_REGEX is defined.
2005-01-21 20:23:44 +00:00
christos 2a32d39ed6 PR/28940: David Laight: /bin/sh doesn't quote the output of trap. 2005-01-11 19:38:57 +00:00
jschauma 5398861167 The '-l' option *always* prints a total, not only if output is to a
terminal.
2005-01-09 16:33:32 +00:00
augustss 6258e74613 Use the same width (9) for both the Used and Avail columns. 2004-12-31 09:54:28 +00:00
skrll c3dc5c50d9 Add the missing suspended state 'U'.
Bump date.
2004-12-29 08:48:09 +00:00
provos d830f0d651 increase the maximum length of allowable system call names 2004-12-01 03:30:07 +00:00
atatat fde0dde8b2 Make ps understand "-tpts/4" by assuming that ptyfs is mounted on
/dev/pts and that the '/' immediately preceding the digits does not
need a 'p' in front of it (ick, kludge_oldps_options()).
2004-11-29 04:44:10 +00:00
mycroft 75a40767d0 Print some future timestamps with HH:MM rather than YYYY, so that we get
something reasonable if we're using a file server whose time is slightly
ahead.
2004-11-17 17:00:00 +00:00
christos 3e870b856b print TTY instead of TT, one question mark instead of two and always the
full tty name.
2004-11-16 04:58:14 +00:00
christos 027df12dd8 Pass WARNS=3 2004-10-30 19:29:27 +00:00
dsl 238960af7e Add (unsigned char) cast to ctype function 2004-10-29 19:51:36 +00:00
dsl 7f5b5f6c04 Add (unsigned char) casts to tolower/toupper and iscntrl calls.
Fixes PR 27593
2004-10-28 20:15:36 +00:00
tron addf1a0f97 Fix broken cpio(1) option handling:
- "cpio -i -t" should list the contents of a file, not extract it.
- Don't extract a file when only option "-d" is given.
Patch supplied by Paul Ripke in PR bin/26513.
2004-10-26 16:11:49 +00:00
jmc 79308267d4 For HOSTTOOL builds, just exclude the chroot support as it's not needed and
avoids having to platform check for fchroot(). Fixes PR#27336
2004-10-22 21:00:18 +00:00
wiz 7faf3dc435 English improvement (remove "be"). 2004-10-20 23:48:01 +00:00
dsl 74db501288 Update date - before wiz complains 2004-10-17 18:53:59 +00:00
dsl 7404af49b7 Improve error reporting for invalid tar archives. 2004-10-17 18:51:29 +00:00
dsl 8317fe1276 Add an option --chroot to tar. Causes it to chroot(".") before doing
an extract.  With -h this will cause existing absolute symlinks to be treated
as relative to the current directory.
Helps sysinst handle existing symlinks in the target system.
Remove 'L' from the usage (got spilt into 'h' and 'H' many moons ago)
Add 'S' to usage, and put into correct place in options list.
2004-10-17 18:49:55 +00:00
christos 211a72de86 Add WARNS=3 2004-10-16 18:07:16 +00:00
dan e541469606 teach rcmd about getport move in rsh directory 2004-10-16 09:58:38 +00:00
christos 4fbd9df224 PR/27212: Greg A. Woods: Accept "-C <dirname>" inside filelists in addition
to "-C\n<dirname>".
But we are not making it the default output option as the patch suggests.
2004-10-10 22:05:26 +00:00
christos 1faaf9a7c2 PR/27213: Greg A. Woods: pax doesn't honour SIGPIPE when listing
But always exit, not just on SIGPIPE.
2004-10-10 22:03:08 +00:00
christos d8cc5bab94 PR/27209: Greg A. Woods: typo in comment in pax/tty_subs.c 2004-10-10 21:54:24 +00:00
christos 37fed2119d PR/27208: Greg A. Woods: pax must call options() before using syswarn()
or tty_warn()
2004-10-10 21:53:23 +00:00
enami 87aaf3d70d Fix a bug introduced by previous commit. It breaks export command
with multiple arguments if one of them are already set.  Fix PR#27155
and probably PR#27143.
2004-10-06 10:23:43 +00:00
dsl 5f9b910124 Save the length of each variable in the name table so that we can
compare the lengths and then use memcmp() in the search code.
Speeds up one of my scripts by a facter of 2.
Increase the size of the variable hash table.
Cuts down time for script to execute from 60 seconds to 10.
Move variable search into a new function to hide the implementation
from most of the code, new version is slightly smaller than old.
2004-10-02 12:16:53 +00:00
christos d12e6436f9 Don't forget to FIOCLEX the internal copies of stdout,stderr,stddiag when
we invoke a subshell. Otherwise the executed command gets invoked with
17,18,19 open.
2004-09-28 16:07:01 +00:00
wiz 5107d92cf0 Bump date for -S support. 2004-09-27 07:41:54 +00:00
christos 60cf19985c PR/19490: Julio Merino: Teach tar about --sparse, -S option.
Do it for cpio too.
2004-09-26 23:46:00 +00:00
christos 6885f6ba28 In GNU-tar mode, don't split filenames to prefix+name because GNU tar does
not honor it.
2004-09-26 22:49:05 +00:00
christos d980bf3418 Keep track of the length of the gnu long name/link hack, so that
we can append to it. Modify the code so that file_write is re-entrant,
even in the gnu long name/link hack.

The old code assumed that the buffer already contained the necessary
blocks to satisfy the read file request that contained the long
filename. This is not always the case, specially when we are dealing
with pipes which do shorter reads, thus having more probability
that a long file name will fall across a buffer boundary.

To reproduce, create a tar archive with a lot of gnu-long-names
(pkgsrc/devel/libsigc++2 is a good example), do a tar -tf to get
a list of filenames, compress it and do a tar -tzf to get another
list of the filenames. Notice that the two lists differ.
2004-09-22 15:03:18 +00:00
christos d6bc453dfc update the comment that documents the fields initialized in the array below. 2004-09-22 14:52:00 +00:00
christos 448fdb0c85 fd can be -1 or -2 for the gnu long name/link hack. So check for >= 0
instead of -1 if we need to flush.
2004-09-22 14:51:12 +00:00
hubertf 2fa09966de Change copyright to 2-clause BSD-copyright.
Changed with explicit permission of Thorsten Lockert (tholo sigmasoft com)
2004-09-15 19:45:17 +00:00
jdolecek 0e3af04f6a use native syscallnames[] array for 'aout' and 'aoutm68k' "emulations" - it's
only used for syscall name <-> number translations, and the native array
is guaranteed to be superset of the former 'aout' and 'aoutm68k' arrays

this re-adds 'aoutm68k' support, and replaces change made in 1.14

g/c #include's which are no longer needed (including aout_syscalls.c), and
also add some comments for the emulations[] array
2004-09-12 11:05:43 +00:00
jdolecek c2ce3ec2d5 constify 2004-09-12 09:25:59 +00:00
he 72ed8803cf Remove references to aoutm68k_syscalls.c, following that file's removal. 2004-09-10 18:30:20 +00:00
wiz 89fb08a9ec Bump date for removal of Kerberos option descriptions.
Remove dots at end of SEE ALSO.
2004-09-05 08:48:32 +00:00
manu bd3e12fe2f Kerberos support is broken in rcommands, thus making -K -k and -x options
unavailable. Remove theses options from the man pages (it won't be very
hard to bring them back if we fix kerberos one day)
2004-09-05 08:38:23 +00:00
wiz 86831d25f5 Bump date for laddr. 2004-08-23 17:36:19 +00:00
nathanw 3d720e58fb Add a "laddr" keyword, analagous to "paddr". Useful for finding
struct pcb's.
2004-08-23 16:31:10 +00:00
dsl 7855867cc4 Use HW_PHYSMEM64 to avoid problem with > 2GB memory (and >4GB as well)
Fixes PR/23717 and PR/24092
2004-08-22 18:55:44 +00:00
tron ed868bc7f4 Propery handle "cpio" archives where the last hardlink includes the
data of a file. This fixes PR bin/26514.
2004-08-22 16:46:18 +00:00
christos b635c5b04a Handle RESCUEDIR 2004-08-19 23:05:00 +00:00
christos 79455d444d Handle RESCUEDIR 2004-08-19 23:00:22 +00:00
christos 287d684b47 Deal with RESCUE 2004-08-19 22:31:38 +00:00
christos ea369b9669 Deal with RESCUEDIR 2004-08-19 22:25:49 +00:00
jschauma 1a12f82f4b If a files date is any time in the future (not six months or more),
use "date "+%b %e %Y"" format.  This is what SUSv3 says.
Ok jdolecek, dsl
2004-08-09 20:14:54 +00:00
jschauma 6734ab72b9 Clarify meaning of '-c' flag by using similar wording as for '-u' flag. 2004-08-06 03:17:19 +00:00
yamt 401d92a0c0 indent fix for the previous (ar_io.c rev.1.43) 2004-08-02 10:20:48 +00:00
simonb 73cc67cb1d For the "lid" keyword, change ULONG to INT32 since it's a 32bit type.
From Nicolas Joly in PR bin/26452.
2004-07-28 07:48:22 +00:00
yamt 42ad308b8b for copy mode, show more meaningful infomation on SIGINFO. 2004-07-18 20:58:36 +00:00
enami 56ab99cb0c Drop LSBs when denominator is big. 2004-07-17 00:29:08 +00:00
christos f6f36c8db2 PR/26339: Pavel Cahyna: the 'fc' command can crash non-interactive ksh
Produce an error message instead.
2004-07-16 18:39:18 +00:00
christos 71f73d1673 - Grr! unterminated buffer string in exclude destination buffer
- fix isfoo() ctype macros to take unsigned char.
2004-07-14 12:41:36 +00:00
seb cf788c3115 Add new builtin `wordexp' to support wordexp(3).
From FreeBSD.
Provided in PR lib/26123.
Approved by kleink@.
2004-07-13 15:05:59 +00:00
christos 5dd9099216 PR/25699: David Laight: sh(1) hangs opening a named pipe as stdin for
background process
This happens because we vfork, and then open a named pipe with O_RDONLY
and block in the child. We avoid this, by opening the file with O_NONBLOCK,
and then reset it if we are vforked. XXX: this is an ugly fix.
2004-07-08 03:57:33 +00:00
mycroft 37b5b92c9f Truncate the prompt if too long. Fixes PR 24674, but not with the patch from
there.
2004-07-07 19:46:57 +00:00
mycroft f662a744b6 Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
2004-07-07 19:20:09 +00:00
enami e9bd9c26d8 Remove now unnecesary/incorrect cast. 2004-07-07 01:14:13 +00:00
enami 9bcbd6d9c6 - Remove unnecessary empty line.
- Wrap long line.
2004-07-07 01:10:58 +00:00
martin dc1011f1c9 Available block count may be negative - so make the calculation signed.
This avoids output like:
Filesystem      1K-blocks     Used     Avail Capacity  Mounted on
/dev/wd1a           11799    11276 9223372036854775741   100%    /boot
2004-07-04 15:31:50 +00:00
christos 0dd4809fb6 remove stray debugging left from last commit. 2004-07-02 16:26:53 +00:00
enami 467ca7e2c8 Salvage the `create parent directories and try again' path which is
removed by the previous commit.
2004-07-02 07:17:17 +00:00
mycroft 1ccdf5daeb Make "set -e" once again provide the behavior documented in the man page,
which was unnecessarily changed in revision 1.50 while fixing other bugs.
That is, exit the shell if the last command in a || or && compound statement
is not short-circuited, and exits with a false status.  I.e., the following
will cause the shell to exit:

  set -e
  false || false

While this is not the prescribed behavior in SUSv3, it is what our man page
documents, and it is what all of the following implementations do:

  NetBSD /bin/ksh (pdksh)
  bash
  zsh
  Solaris 9 /bin/sh
  Solaris 9 /usr/xpg4/bin/sh
  Solaris 9 /usr/bin/ksh
  Tru64 /bin/sh
  HP/UX 11 /bin/sh

The "standard" seems to be wrong in this instance.
2004-06-30 09:32:38 +00:00
dsl 60bb0d96f3 Fix treatment of ' inside a 'here document' with a quoted EOF marker.
Fixes a breakage from the previous version.
2004-06-27 10:27:57 +00:00
dsl c6cbc16d26 Correctly apply IFS to unquoted text in ${x-text}.
Fixes PR/26058 and the 'for i in ${x-a b c}; do ...' and ${x-'a b' c}.
I can't find a PR for the latter problem.
Regression test goind in shortly.
2004-06-26 22:09:49 +00:00
dsl 97e8f81436 Remove a broken optimistion that crept in earlier today. 2004-06-26 20:48:44 +00:00
dsl 8e940884ca Kill a diagnostic I accidentally left in. 2004-06-26 14:21:29 +00:00
dsl e4a2a056d2 No functional changes (intended).
Rename some variables, add some comments, and restructure a little.
In preparation for fixing "set ${x-a b c}" and friends.
2004-06-26 14:09:58 +00:00
grant b0cddc5f0d break out of the loop and avoid the infinite loop if attempts to
create, unlink and create all fail.
2004-06-26 13:28:09 +00:00
grant e069813aa1 don't attempt to remove the current directory. 2004-06-26 12:39:06 +00:00
wiz f1891abd4d Sync usage with man page. Closes PR 25861 by Kouichirou Hiratsuka. 2004-06-25 14:27:57 +00:00
wiz b982defe98 Add -v to usage. Closes PR 25862 by Kouichirou Hiratsuka. 2004-06-25 14:25:33 +00:00
christos 6b1f699323 don't keep going if -C failed to chdir(); from OpenBSD 2004-06-21 13:38:51 +00:00
jmc b2f782612f Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944
2004-06-20 22:20:14 +00:00
christos 08df9f4cb1 add -0 argument to handle nul separated file lists. 2004-06-19 02:27:00 +00:00
christos b5370dc2f5 A small standalone program to dump ustar headers, used for debugging. 2004-06-16 14:28:21 +00:00
christos 0deda9612a PR/25934: Dieter Baron: hard links with long names still fail.
As mentioned in the previous commit, the switch statement in the longlink()
needed simplification and it was a bit incorrect. Only depend on the passed
type to determine what kind of gnu longlink to produce. Don't try to deduce
it from the archive file type.
2004-06-16 14:26:24 +00:00
dsl 39cf7788fc Use shell variables to get '(' and '\' inside shell substitution patterns.
Solves problems with different shells having differntly buggy parsers
(and the standard probably allowing random behaviour).
Should fix bin/25938
2004-06-15 23:09:54 +00:00
dsl c6e67e3bf2 Change '\0' to 0 so that the SVR4 'echo' doesn't convert it to a null byte.
Fixes bin/25938
2004-06-15 22:57:27 +00:00
christos 393b592b72 PR/25934: Dieter Baron: tar and hardlinks with long filenames don't work.
- always put the @LongLink tag on the name, not the long-link name.
- pass in what type of long name record we want to create; one for long-name
  or long-link name.
XXX: We should get rid of the switch too.
2004-06-15 21:52:00 +00:00
christos 44eb0cca7b Restructure the code to make it more readable. No functional changes. 2004-06-15 21:49:36 +00:00
christos 24aca7f677 do the special symlink treatment with all negative fd's. 2004-06-15 21:44:55 +00:00
jmmv 0576e4b0be Drop extra space. 2004-06-15 14:08:33 +00:00
christos cf19966782 Undo previous fix, breaks:
#!/bin/sh
echo ${1+"$@"}
./sh.new foo.sh a b c
a b c b c
I'll revisit this when I have some more time.
2004-06-09 12:17:36 +00:00
christos fc5d411571 "for i in ${x-a b c}; do echo $i; done" should print "a\nb\nc\n" not "a b c\n"
like other shells do. mark the expansion for ifs splitting. XXX: linux has a
very complicated fix for this. I wonder why.
2004-06-08 03:29:51 +00:00
christos 95a737969b don't include the printf builtin if we are SMALL; saves 10K. 2004-06-06 07:03:11 +00:00
cjep 0ce4d4d615 Mention -g in synopsis. PR#25800 from Kouichirou Hiratsuka. 2004-06-04 09:25:48 +00:00
hubertf c784286d1a Fix typo: and the -> and then 2004-06-03 19:54:37 +00:00
hannken 8c21bc6224 Add ffs internal snapshots. Written by Marshall Kirk McKusick for FreeBSD.
- Not enabled by default. Needs kernel option FFS_SNAPSHOT.
- Change parameters of ffs_blkfree.
- Let the copy-on-write functions return an error so spec_strategy
    may fail if the copy-on-write fails.
- Change genfs_*lock*() to use vp->v_vnlock instead of &vp->v_lock.
- Add flag B_METAONLY to VOP_BALLOC to return indirect block buffer.
- Add a function ffs_checkfreefile needed for snapshot creation.
- Add special handling of snapshot files:
    Snapshots may not be opened for writing and the attributes are read-only.
    Use the mtime as the time this snapshot was taken.
    Deny mtime updates for snapshot files.
- Add function transferlockers to transfer any waiting processes from
  one lock to another.
- Add vfsop VFS_SNAPSHOT to take a snapshot and make it accessible through
  a vnode.
- Add snapshot support to ls, fsck_ffs and dump.

Welcome to 2.0F.

Approved by: Jason R. Thorpe <thorpej@netbsd.org>
2004-05-25 14:54:55 +00:00
christos 626d1a4171 Keep track of the while level, when popping loops because of a breaksw.
This is nasty...
2004-05-13 15:25:58 +00:00
christos 5820cbfaf6 Welcome to WARNS=3 2004-05-11 17:12:26 +00:00
christos d24b172c21 avoid overflow in strcpy. 2004-05-10 19:11:31 +00:00
grant 4fc8c484c7 - remove an extraneous word
- it's "backward compatibility" not "backwards compatibility"
2004-05-04 13:20:46 +00:00
grant dced68e86f --unlink is the default, the argument is ignored and only accepted for
compatibility with other tar(1) implementations.
2004-05-04 13:13:01 +00:00
christos 69c89ea8a0 Don't exit with 1 on broken archives that mark directories as files for
the benefit of pkgsrc. I would have prefered that people fixed their
archivers instead.
2004-05-03 02:22:54 +00:00
dsl 00a6315e86 Ensure that fd 0, 1 and 2 are not used for the local end of pipelines.
Fixes PR bin/25395
2004-04-30 06:27:59 +00:00
matt 5864f65684 Set the chflags *after* the rename, not before. 2004-04-30 05:14:23 +00:00
christos 78b5033e6d PR/25350: Alan Barrett: Treat the sticky bit specially as non-superusers
cannot set it on non-directories (elvis-2.2_0 extraction failed)
2004-04-27 13:45:45 +00:00
christos 04d1f5de72 PR/25188: Thomas Klausner: pax-as-tar problem with trailing slashes
The problem is with the program that generates the tar file:
-rwxrwxrwx  1 root     wheel          0 Feb  8 16:46 faad2/aacDECdrop/
It creates directory nodes without the 'd' bit set, so that pax thinks
they are files and does the temporary name and dance with them. Added
code to detect this condition, warn about it, and work around it.
2004-04-25 16:20:24 +00:00
christos 57c1f1cfd7 PR/25299: grant beattie: 1.5.3/i386 kernel set archives confuse -current pax
PR/25310: Juan RP: tar can't unpack MS-DOS gzip files correctly
2004-04-25 15:52:30 +00:00
wiz 6af689d38b Grammar improvement by Patrick Welche. 2004-04-23 13:28:58 +00:00
wiz d8dd84fc16 Fix typo noted by Patrick Welche. 2004-04-23 13:28:15 +00:00
simonb 9bc855a931 s/the the/the/ (only in sources that aren't regularly imported from
elsewhere).
2004-04-23 02:58:27 +00:00
wiz 55bf8ce8b5 Refer statvfs instead of removed statfs. 2004-04-21 12:22:27 +00:00
christos 6bd1d6d4db Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
2004-04-21 01:05:31 +00:00
wiz a423ef4af0 Add some articles; use No instead of Li in one place
(more correct, see e.g. PostScript output); bump date for previous.
2004-04-20 20:47:47 +00:00
christos af4f4c568a PR/25207: Hubert Feyrer: tar cores on certain archive contents
Don't forget to cleanup xtmp_name when we fail to create the temporary file.
2004-04-20 20:00:37 +00:00
christos 1f747cc909 PR/25207: Hubert Feyrer: tar cores on certain archive contents
- On ustar archives with a specified prefix directory, arcn->nlen was not
computed properly.
- While I am here cast some snprintf's() to void.
2004-04-20 19:59:54 +00:00
jdolecek c92704dc53 add support for 'length' keyword, for compatibility with GNU expr 2004-04-20 19:44:51 +00:00
jschauma 9bb0acaf30 The correct syntax for csh's pushd with a numeric argument is
pushd +n
not
pushd n
2004-04-20 01:43:03 +00:00
kleink f6f484b31d Un-__P(), ANSIfy, use EXIT_{SUCCESS,FAILURE}, use [gs]etprocname().
From Stefan Krüger in PR bin/24878.
2004-04-19 08:24:56 +00:00
lukem 778dabc229 Correct the description of sbsize; it is parsed in bytes not kbytes. 2004-04-19 01:36:32 +00:00
wiz ae25ed4085 Document rlimit sbsize; case consistency; bump date. 2004-04-17 15:45:08 +00:00
wiz 8e5ab2cd61 Bump date for previous. 2004-04-17 15:42:42 +00:00
christos 6acf809e53 understand rlimit sbsize 2004-04-17 15:40:12 +00:00
christos 7fb1726a27 remove misplaced semi-colons. 2004-04-16 22:46:28 +00:00
christos 25afd895c0 PR/25200: Alan Barrett: bug in pax append mode. This problem was introduced
while trying to fix the tar append mode. Restore the correct 2 null blocks
at the end of file, and disable the old bug compatible mode for gnutar.
2004-04-16 22:45:56 +00:00
mrg fa97f05587 fix bugs in the previous. use snprintf(). fixes the problem reported
in PR#25131.
2004-04-12 14:41:09 +00:00
keihan 27b3f59c96 Revert last, revision 1.46. 2004-04-02 12:53:05 +00:00
keihan 6898598891 ".../newdir" --> "../newdir" 2004-04-02 11:14:24 +00:00
martin abe6f9dc47 Remove duplicate include, fixes PR bin/25018 from Jeff Ito. 2004-04-02 09:08:55 +00:00
tsarna 5f8a756d98 Fix longstanding gap in stty functionality: while many operations had
inverses, "sane" didn't. Now there is symmetry.
2004-04-01 16:10:03 +00:00
mrg 0ade019d3f redo GNU tar --exclude emulation to actually work the same. unfortunately,
because alternation (|) isn't available in "pax -s" RE's, we have to pass
four (yes 4!) different patterns:
	.*\/<pattern>$
	.*\/<pattern>\/.*
	^<pattern>$
	^<pattern>\/.*
instead of the more elegant
	(^|.*\/)<pattern>($|\/.*)

fixes a problem reported by simonb.
2004-04-01 14:54:39 +00:00
jdolecek cf0f7c2614 IPv6 support, based on src/usr.bin/rsh/rsh.c rev. 1.13
fixes PR bin/24940 by Manuel Bouyer
2004-03-28 08:18:25 +00:00
simonb d8f2ef9ae4 Gah, fix uninitialised variable with the "etime" change. _Never_ be
happy with something and then edit a single line before committing
without retesting...
2004-03-27 14:55:24 +00:00
simonb 891960dba2 Add support for the POSIX.2 "args" and "comm" keywords. "args" is just
an alias for "command", and "comm" shows just argv[0] and not the whole
argument list.

Fix for part of PR standards/11224.
2004-03-27 14:52:36 +00:00
simonb 63e11689ca Add support for the POSIX.2 "etime" keyword - shows the elapsed time
since the process was started.  Fix a couple of style nits as well.

Fix for part of PR standards/11224.
2004-03-27 14:49:13 +00:00
simonb a6b219ed94 #define<TAB> 2004-03-27 14:09:10 +00:00
simonb c2c9310515 Use some constants from <tzfile.h>. 2004-03-27 12:59:25 +00:00
simonb abb3201747 Wrap some long lines.
Consisently use (void) in front of printf(...);
A few more white-space nits.
2004-03-27 12:44:08 +00:00
simonb f43fbf8e69 Fix grammar in a comment. 2004-03-27 12:11:55 +00:00
simonb 53474900d5 KNF, ANSFify, de-__P, unC++ify, white space nits. 2004-03-27 12:09:28 +00:00
simonb 56be4f0202 Change the header for the "tty" keyword "TT" instead of "TTY".
Fixed POSIX.2 conformance problem mentioned in standards/11225 from
Ben Harris.
2004-03-27 11:48:31 +00:00
enami 489a45ccd1 Combine two printf()s back to one. There was a reason to split in my
old patch but no reason to do so in the final version.
2004-03-26 20:28:39 +00:00
enami f31e685fc4 Prevent sign extension for positive value, and f_bavail if it is considered
as positive value.
2004-03-26 20:19:03 +00:00
enami efbe8a95d8 Fix an output of df -h when the value is negative; we need to provide
space for minus sign.
2004-03-26 20:07:47 +00:00
enami 5824b24c95 No need to reference through a pointer; just refer the array of
character directly.
2004-03-26 20:00:32 +00:00
enami 2229c36a99 Don't put space before close paren. 2004-03-26 19:53:53 +00:00
wiz 8cb1352961 Sort sections, bump date for previous, and add a comma after e.g.. 2004-03-24 11:37:07 +00:00
fair e008163968 Add an EXAMPLES section to answer PR 22255 2004-03-24 06:55:58 +00:00
jdolecek 217903eeea explicitly use REG_BASIC when calling regcomp(3), instead of 0 2004-03-20 08:45:05 +00:00
enami bf27454854 Use signed 64bit integer type instead of unsigned long long
since f_bavail may be negative.
2004-03-07 01:12:08 +00:00
enami 90ded884a4 Backout recent undocumented change to keep an output same as before. 2004-03-02 23:13:07 +00:00
christos a2989006c9 fix compilation on LP64 systems. 2004-03-02 15:04:55 +00:00
itojun 1e9b827214 cast to unsigned long long before computing to avoid overflow 2004-03-02 03:59:17 +00:00
itojun 96b84a38a0 use unsigned long long to print block count. 2004-03-02 03:50:45 +00:00
jdolecek 47b5291b9c rename variable 'history' to 'histlist' to avoid clash with libedit
history() when this program is crunched into /rescue tools

fixes PR bin/24556 by Kouichirou Hiratsuka
2004-02-26 08:24:03 +00:00
jrf 7800470e15 donlist_sysctl() was overwriting maxslp with vm.uspace. Changed
it to use uspace. See PR bin/23713, approved by christos@netbsd.org.
Thanks to joff@stchome.com for the submission.
2004-02-25 19:56:28 +00:00
wiz 85746c6759 Spell interrupt with two rs. From Peter Postma. 2004-02-24 15:16:04 +00:00
uebayasi d59e9104ff Tar(1)'s -s option needs an argument. Correct option string (s -> s:).
Reported and tested by Tomoaki Imamura.
2004-02-20 05:16:54 +00:00
snj 4aff9cba1e s/nonmathing/nonmatching/ 2004-02-13 23:25:01 +00:00
matt 8fbcc555cf When pax catches a signal and cleans up, make sure to remove any temporary
file that was being extracted to.  This will prevent pax from leaving
droppings when you hit ^C.
2004-02-13 23:10:14 +00:00
wiz e3fc4b66c3 Spell the plural of suffix "suffixes", not "suffices".
Inspired by PR 24400 by Todd Vierling.
2004-02-13 17:56:17 +00:00
wiz d20841bb64 Uppercase CPU, plural is CPUs. 2004-02-13 11:36:08 +00:00
wiz 0568bf7421 Uppercase CPU. 2004-02-13 09:55:51 +00:00
wiz 5fe648aa7a Uppercase CPU where appropriate. 2004-02-13 09:55:24 +00:00
matt 1106d0b028 Nuke extra mkstemp. Use name, not tmp_name with chk_path. 2004-02-13 08:27:12 +00:00
matt b2e2f282bd Back out last change. Since the name is the entire path, prefixing it
with a '.' will not have the desired effect.
2004-02-13 00:11:30 +00:00
matt 272d78cb06 When creating the temporary file, prefix the name with a '.' 2004-02-13 00:07:55 +00:00
matt 99b5d86a5f When restoring files from an archive, initially restore to a temp-file and
once it has been instantiated correctly, rename it to desired name.  This
prevents the problem of partially created files being accessed before they
are complete.  If said file is a shared library, that can cause ramdon core
dumps.
2004-02-12 22:19:18 +00:00
christos e7827bbe92 recognize -k [--keep-old-files] short option. From hubertf. 2004-02-06 18:59:14 +00:00
christos 92ffc695bf While the comment is not correct anymore, this fixes the problem of tar -rf
where tar would skip backwards too much, corrupting the current tar archive
on append.
2004-01-30 20:46:12 +00:00
provos 3afd9aba5f the special filename "" does not receive translation and is going to fail.
previously, systrace would normalize it to $CWD/.; found by Nikolay Sturm
from OpenBSD.
2004-01-24 03:44:46 +00:00
kleink e71a15405c Avoid using structure initializers with struct timeval. 2004-01-21 22:50:56 +00:00
dbj f01a4aa26e minor nit, set out.dbp correctly when constructing final null block
for sparse files.
2004-01-17 21:00:16 +00:00
dbj 6b4933739d add support for conv=sparse
inspired by freebsd, although this patch attempts
to avoid some potential bugs in their implementation.
2004-01-17 20:48:57 +00:00
provos 80b9ef16f9 off-by-one; found by Nikolay Sturm from OpenBSD 2004-01-17 18:54:32 +00:00
dsl f0177aeba6 Put a syntax.c under CVS instead of building if with the mksyntax program.
Kill mksyntax.c - no longer possible to get the 'wrong sort of chars'.
/bin/sh now has no helper binaries.
syntax.c uses C99 initialisers, run time initialisation could be used
for systems where the compiler doesn't support them.
I've used some #defines to help make this possible - but writing the code
starts making it rather messy.
2004-01-17 17:38:12 +00:00
dsl 9cd22030d1 Put syntax.h under CVS instead of having it generated by mksyntax.
Use CHAR_MIN (from limits.h) to determine whether target char are signed
or unsigned - the syntax tables will not be indexed properly.
Rip out all the stuff from mksyntax.c that wrote syntax.h.
syntax.c can stiff be generated incorrectly...
2004-01-17 15:40:09 +00:00
dsl 1fe487ae6e Replace mkinit.c with mkinit.sh
Build mksyntax directly from mksyntax.c so that the -DTARGET_CHAR=xxx
is applied when it is build.
OTOH mksyntax is broken as it tries to determine properties of the
target system by running code on the build system.
2004-01-17 11:47:30 +00:00
dbj cae90fa713 Add C_ASCII and C_EBCDIC to list of options which unset C_BS semantics.
Without this fix, the bs option would cause any of the ascii<->ebcdic
conv options to be ignored.
2004-01-17 05:42:50 +00:00
dsl df348483d0 Replace the C program mknodes.c with a shell script mknodes.sh
(mkinit and mksyntax may also die soon...)
2004-01-16 23:24:38 +00:00
jdolecek 2cc036866c g/c SDEAD 2004-01-11 18:55:33 +00:00
wiz 8d21cba126 Fix typo. 2004-01-11 09:41:55 +00:00
wiz a714cd574d Bump date for previous; |fmt; remove trailing white space.
New sentence, new line.
2004-01-11 09:40:36 +00:00
tls f71666350e Adjust comment to indicate what this code is actually useful for, and that
it's not really "cheap".
2004-01-11 02:17:12 +00:00
tls ac7fdd5957 UFS->FFS 2004-01-11 02:13:14 +00:00
tls e9e0ca4155 Change behaviour of -P option to conform generally to DoD 5220.22-M
standard.  This change inspired by Apple's "Secure Empty Trash" functionality
in MacOS 10.3.  However, it is important to understand that this change
does not -- and can not -- actually achieve conformance to the current
revision of the standard.  To quote the manual page:

     The -P option attempts to conform to U.S. DoD 5220-22.M, "National Indus-
     trial Security Program Operating Manual" ("NISPOM") as updated by Change
     2 and the July 23, 2003 "Clearing & Sanitization Matrix".  However,
     unlike earlier revisions of NISPOM, the 2003 matrix imposes requirements
     which make it clear that the standard does not and can not apply to the
     erasure of individual files, in particular requirements relating to spare
     sector management for an entire magnetic disk.  Because these
     requirements are not met, the -P option does not conform to the standard.

This also makes the -P option a *lot* more expensive than it used to be.
It used to overwrite with 0xff, overwrite with 0x00, overwrite with 0xff,
with an fsync after each write.  Now it overwrites with a random character,
overwrites with 0xff, overwrites with 0x00, reads to validate the 0x00
overwrite, then overwrites with random data -- calling sync() after every
operation in an attempt to force seeks that will clear the data from the
cache of disks that lie about whether data has been committed to the
platters.  Also, the file's opened with O_SYNC|O_RSYNC to cause metadata
updates on every read/write, which should cause still more seeks.

This is better than it used to be, but it's by no means adequate if you
have data you really don't want read by an adversary who can pull the
disk apart.
2004-01-11 02:04:05 +00:00
wiz 3cd33047a8 Replace hard to understand wording with a different
one from further down in the same page. Suggested by jmc@openbsd.
2004-01-10 23:43:30 +00:00
wiz 1cb1c3286e comma-separated with a "-" in between. From Jared Yanovich via jmc@openbsd. 2004-01-08 20:26:46 +00:00
christos c8fc596cbc Simplify previous; if F_CLOSEM fails, just fall back doing the old thing.
Calling stderror here is not safe, because we might have not setjmp()'ed
yet.
2004-01-06 00:20:16 +00:00
jmmv b635f565e7 Homogenize usage messages: make the 'usage' word all lowercase, as this seems
to be the most common practice in our tree.
2004-01-05 23:23:32 +00:00
christos 62a68c898b use F_CLOSEM if it is available. 2004-01-05 23:12:30 +00:00
jmmv b9173dc41c Rewrite the loop in printflg(): if passing -Z to pax with syntax errors
(like executing "pax -Z" by itself), this caused a shr of 32 bits, which is
undefined behavior (C99) if the variable is 32 bits wide, too.  Also solves
a problem where the flgch array could be indexed out of bounds.

Thanks to uwe@ and lha@ for their suggestions... I just found the bug :p
2004-01-05 17:27:46 +00:00
jschauma ad8530d1eb remove unused code left from printescaped() backput as pointed out by Jeff
Ito in PR bin/23969 and PR bin/23970.
2004-01-04 16:04:18 +00:00
jschauma 420b2ac8ff Remove unused code left over from temporary printescaped functionality.
Noted by Jeff Ito in PR bin/23967.
2004-01-04 03:34:00 +00:00
jschauma 4f80cb6337 Remove unused code left over from temporary printescaped functionality.
Noted by Jeff Ito in PR bin/23966.
2004-01-04 03:31:28 +00:00
wiz 07d5d4dfe3 Crossreference -h and -k. Use Aq instead of \*[Lt]\*[Gt]. 2003-12-26 11:19:50 +00:00
simonb ba2dda9f8e Fix bug with previous change- always initialise d.s_block. Now "ls -1sh"
works.
XXX: ls -sh now always uses 4 chars for the size column width even if it
     needs less than that.
2003-12-26 10:51:25 +00:00
simonb c4d01568e0 KNF - wrap long lines. 2003-12-26 10:47:32 +00:00
grant f4c4780250 implement -h(umanize).
from David P. Reese Jr. in PR bin/23870.
2003-12-26 06:19:19 +00:00
wiz 00c8cf496c Add some articles. 2003-12-21 11:18:25 +00:00
wiz 4eb81d63b4 Fix example added in previous. 2003-12-21 11:16:23 +00:00
jdolecek 83f8b02df2 add a note explaining empty string matching via :
this adresses bin/23810 by VaX#n8

bump date and update copyright
2003-12-21 10:02:46 +00:00
jdolecek 9927abce5e add a note to Short-Circuit operators section about the somewhat
nonintuitive evaluation in case there is both || and && specified
pointed out in bin/23814 by VaX#n8
2003-12-21 08:40:29 +00:00
jdolecek 30651d6b04 minor optimization in evalvar()
change sent in bin/23813 by VaX#n8
2003-12-21 08:32:39 +00:00
heas 8e58476bbd correct 2 typos 2003-12-18 15:52:31 +00:00
christos 08f1ceee65 PR/23786: Robert Nestor: wait command returns the wrong status code. This
seems to be an off-by-one error, since njobs is decremented before we use
it. I hope this does not break the vfork case!
2003-12-18 00:56:05 +00:00
christos 9a77f16705 Handle breaksw inside while loop (from tcsh)
Really: test commits on new cvs binary.
2003-12-17 17:32:16 +00:00
mjl 550c4966cd Correct typo in page header for tpgid. 2003-12-16 14:26:46 +00:00
perry 375e81b270 Some file systems, like FAT, have no inodes in the ffs sense and don't
run out of inodes. df -i was saying, however, that such file systems
had 100% of their inodes in use, which would do things like trigger
alarms in scripts looking for file systems that have run out.

Instead, say 0% are in use, which although not strictly true is at
least less wrong, fixes scripts and is less worrying in nightly reports.
2003-12-07 22:42:36 +00:00
perry 9d454b9e0a mention that -h also overrides BLOCKSIZE, and sort around there 2003-12-07 16:18:25 +00:00
wiz 6fc98bf82d Add -C to usage. 2003-11-28 23:32:25 +00:00
wiz 7978aff203 Bump date for previous (hi niels!).
Sort options.
2003-11-28 23:32:02 +00:00
provos 61d0495091 support for cradle mode by marius at monkey.org; cradle mode allows the
systrace UI to be attached and re-attached, it also multiplexes across
systrace process so that one UI can function as central notification
2003-11-28 21:53:32 +00:00
dsl 7983f217c9 Generate command line when SMALL is defined and make buffer full sized.
All the code has been present for a while, and the memory cost is (about)
180 bytes per process.
Fixes PR bin/23545
2003-11-27 21:16:14 +00:00
simonb 493b309b03 Put a few headers back so this compiles again.
Compile problems noticed by Dan Carosone.
2003-11-25 03:40:18 +00:00
matt 2d72f72583 Don't emit any warnings when tar is trying to figure out if the file is
really tar format.  valid CPIO files should not trigger a warning from tar.c
2003-11-24 23:48:47 +00:00
jschauma 2c872ddbbc Also remove headers that are no longer needed. Also pointed out by Mike
Small.
2003-11-24 22:47:02 +00:00
jschauma d772e9e433 Remove unused variable stdout_ok, which was left over from my changes
in September.  Pointed out by Mike Small in a private email.
2003-11-24 22:38:46 +00:00
provos 2244ab26a9 allow underscores in usernames 2003-11-18 05:28:05 +00:00
lukem e606e2dcb2 Improve how various "simple" host tools are built and invoked. 2003-11-16 14:14:18 +00:00
dsainty 39973c5237 Optimise previous change, using fcntl(F_DUPFD) to locate a free descriptor
for us, rather than iterating until satisfied.

Suggested by David Laight.
2003-11-15 14:55:32 +00:00
dsainty 0b16f71074 Avoid corrupting the dd(1) IO streams. This would happen by accidentally
outputting to the files being manipulated by opening a file in the standard IO
descriptor space.  In particular, an output file unlucky enough to be sitting
on descriptor 2 (stderr) is certain to be corrupted.

Addresses PR bin/8521, and passes the recently committed regression test
"bin/dd".
2003-11-15 12:44:54 +00:00
dsl 296844fe72 Posix requires that 'pwd -P' reset the shells saved cwd value - so a
subsequent 'pwd -L' will report the same value.
Update man page to be a closer match to reality.
2003-11-14 20:00:28 +00:00
dsl c0cf1d6b30 This seems to need stdlib.h to get a prototype for abort(). 2003-11-14 10:46:13 +00:00
dsl edecd89511 Add '\n' to "fork failed" trace messages. 2003-11-14 10:27:10 +00:00
wiz 61ea2c0760 file system, not filesystem; e.g. is an abbreviation; use FAT instead of msdos
when describing the file system.
2003-10-30 14:58:23 +00:00
dsl db9b05af0d Make /bin/pwd almost conform to IEEE 1003.1
- Make 'pwd -L' fall back to 'pwd -P' if PWD is incorrect.
- Ignore PWD if it contains "/./" or "/../".
- Garbage collect some redundant code.
It is still non-conformant because posix mandates that the default
be 'pwd -L' (aka ksh), not 'pwd -P' (historic practise everywhere else).
Changing the default will break too much...
2003-10-30 13:52:23 +00:00
dsl df5bd11fb9 Validate the arguments to 'pwd'. Treat -L and -P as per pwd(1).
Note that 'pwd -L' and 'pwd -P' almost always report the same answer as
the shell detects when 'cd' follows a symlink and discards its cached 'pwd'
2003-10-30 09:40:26 +00:00
wiz 6a22b79c1a passwd(5), not passwd(4). From Igor Sobrado in PR 23278. 2003-10-27 08:23:40 +00:00
wiz 4580c6ac21 Do not xref alias(1) since that points to csh(1).
Noted by Igor Sobrado in PR 23278, fixed following a suggestion by Greg A. Woods.
2003-10-27 08:22:21 +00:00
lukem 7568eb663a skip a leading `-' on the arg0 name when calling el_init() 2003-10-27 06:19:29 +00:00
lukem 171d653219 Overhaul how `build.sh tools' are used:
*	Rename "config.h" to "nbtool_config.h" and
	HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
	This makes in more obvious in the source when we're using
	tools/compat/config.h versus "standard autoconf" config.h

    *	Consistently move the inclusion of nbtool_config.h to before
    	<sys/cdefs.h> so that the former can provide __RCSID() (et al),
    	and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
	#if HAVE_NBTOOL_CONFIG_H
	#include "nbtool_config.h"
	#endif
to the top of the source files (for the general case).
2003-10-27 00:12:41 +00:00
lukem 5037f26eb0 don't need -DHAVE_CONFIG_H here 2003-10-26 09:30:55 +00:00
lukem f85d2d1c14 Use ${HOST_SH} instead of `sh'.
If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.
2003-10-26 07:25:33 +00:00
lukem 857ab1bdd0 use ${HOST_SH} instead of /bin/sh 2003-10-26 03:50:07 +00:00
lukem 130ab7336b Rework how MAKEVERBOSE operates:
*	Don't bother prefixing commands with a line of  ${_MKCMD}\
	and instead rely upon "make -s".  This is less intrusive on
	all the Makefiles than the former.  Idea from David Laight.

    *	Rename the variables use to print messages.  The scheme now is:
	    _MKMSG_FOO		Run  _MKMSG 'foo'
	    _MKTARGET_FOO	Run  _MKMSG_FOO ${.TARGET}
	From discussion with Alistair Crooks.
2003-10-21 10:01:19 +00:00
fvdl 84f47d78af Don't initialize an integer field with NULL. 2003-10-21 02:11:21 +00:00
fvdl cf96462927 Don't pass an integer as NULL. 2003-10-21 02:08:14 +00:00
christos 1bbc81a501 Let libedit handle signals so we resize properly. I might change my mind
later on that.
2003-10-19 19:13:21 +00:00
lukem ddff99b7f4 rework to use the newer _MKMSGCREATE (et al) macros 2003-10-19 04:45:01 +00:00
lukem 1e840c4d40 Ensure that $TERM is set in the real environment before calling el_init(3)
when executing "set -o (emacs|vi)".   Fixes [bin/23175] from me.
2003-10-19 01:55:05 +00:00
wiz bbbbcbe44f Fix typos in comments. From Jared Yanovich via jmc@openbsd. 2003-10-19 01:52:45 +00:00
lukem a9d371700c improve MAKEVERBOSE message for HOST_LINKed tools 2003-10-19 00:43:02 +00:00
lukem 29e7d09b65 Support MAKEVERBOSE (XXX: mksyntax is noisy when MAKEVERBOSE=0).
Use DPSRCS appropriately.
2003-10-19 00:35:26 +00:00
lukem 046b9ab451 support MAKEVERBOSE 2003-10-19 00:14:16 +00:00
lukem 51b9502fb1 Link the host tools against tools/compat -lnbcompat since someone decided to
use strlcpy() and snprintf() in the host tools...

Should fix part of [toolchain/22504], and build problems on other
platforms that don't have strlcpy() or snprintf()...
2003-10-18 07:58:35 +00:00
wiz 6c7baec4af Add Xr for dev_mkdb(8), per PR 23168. Increase width in FILES section while here. 2003-10-16 10:00:54 +00:00
agc b2b49933f4 Move Matt Green's code from a 4-clause to a 3-clause licence by removing
the advertising clause. Diffs provided in PR 22396 by Joel Baker, the changes
were confirmed to the board by Matt Green.
2003-10-13 14:22:20 +00:00
agc ed6ed8e698 Move Keith Muller's code from a 4-clause to a 3-clause licence by removing
the advertising clause. Diffs provided in PR 22397 by Joel Baker, confirmed
to the board by Keith Muller.
2003-10-13 07:41:22 +00:00
dsl 13fd6f5a25 Fix rmdir -p x/y/z//
Remove redundant code.
2003-09-29 21:11:15 +00:00
dsl b17e1b5c12 Fix 'set "*" b; case "* b" in "$@") ...' and 'set "*"; case 1 in "${#1}") ...'
Which got broken by the previous fix.
2003-09-22 12:17:24 +00:00
wiz 835710a2a0 Bump date for previous; comma cleanup. 2003-09-22 06:01:43 +00:00
jschauma 21ab633500 After last weeks addition of the '-b' flag, add '-B' and '-w' flags,
suggested by uwe@, inspired by FreeBSD.  The three flags override
each other (and the '-q' flag) and behave as follows:

     -B      Force printing of non-printable characters in file names as
	     \xxx, where xxx is the numeric value of the character in octal.

     -b      As -B, but use C escape codes whenever possible.

     -w      Force raw printing of non-printable characters.  This is the
             default when output is not to a terminal.
2003-09-22 02:43:19 +00:00
itojun 7e1f466773 realloc pedant 2003-09-19 08:46:32 +00:00
itojun c747caaab9 make signal range check consistent. 2003-09-19 05:31:11 +00:00
grant 0faf575771 wait for compression program to finish before exiting.
fix races condition resulting in a zero length archive after pax
exits.

patch from OpenBSD, provided by Joerg Sonnenberger in PR bin/22740.
2003-09-18 09:18:24 +00:00
jmmv 4c79e7620f Drop equal signs from rule definitions; they cause problems with "bison -y". 2003-09-17 17:33:36 +00:00
christos 4dcb41ae2c PR/22640: Paul Jarc: sh mishandles positional parameters in case. Fixed
from FreeBSD PR 56147.
2003-09-17 16:01:19 +00:00
wiz fb2e1913c5 Bump date for previous. 2003-09-14 21:56:25 +00:00
jschauma 6a75fbb636 Following private discussion with kleink@ and hubertf@ and public discussion
on tech-userlevel@, back out printescaped() functionality.
kleink: ``We sell rope.''
2003-09-14 19:20:16 +00:00
jschauma 2ccef82cc4 Implement '-b' option, which, following FreeBSD, Linux and (I think) Solaris
prints octal escapes for nongraphic characters.
2003-09-14 19:16:05 +00:00
jmmv 0ec085e737 Add 'trace' to CLEANFILES, generated when debug is enabled. 2003-09-14 12:11:10 +00:00
jmmv af90286087 Fix crash when DEBUG=2, by opening the log file ASAP. Reviewed by simonb@. 2003-09-14 12:09:29 +00:00
christos e84c1029c6 Comment out unneeded code now that the kernel has been fixed to ignore
trailing slashes.
2003-09-11 17:38:12 +00:00
jmmv e3d9d7109f Add ':' to the list of characters to be escaped. Fixes completion problems
when the filename includes this character.
2003-09-11 10:24:57 +00:00
wiz 29119d0e3b Reinstate paragraph about -E, sort option descriptions, and bump date for -E addition. 2003-09-08 13:13:08 +00:00
wiz 7554e5998d Some more fixes: sort sections, escape some stuff for HTML output. 2003-09-08 13:02:59 +00:00
wiz 25eb7d566d Improved version of OpenBSD's mdoc'ed version of ed(1) (v1.42). 2003-09-08 12:58:41 +00:00
wiz a3390acd07 Punctuation improvement from jmc@openbsd. 2003-09-07 15:58:58 +00:00
wiz 6c3a1a5dfb Some small tweaks from jmc@openbsd:
- .Bk/.Ek for SYNOPSIS
 - .Ev for environment variables
 - fix bogus -offsets
2003-09-06 16:39:34 +00:00
itojun 3efe781f15 plug memory leak. PR bin/22694 2003-09-05 20:16:50 +00:00
wiz 4157dbb127 Sort options (AaBb...). 2003-09-02 08:36:20 +00:00
wiz 5526319b35 In emacs mode, when expanding file names containing characters that should
get quoted with <ESC>*, _do_ quote them.
Patch from Federico Schwindt fgsch@openbsd -- thanks!
[rev 1.25 in OpenBSD version of this file]
2003-08-28 19:53:32 +00:00
wiz 9fdd63d776 From FreeBSD bug report 54294, via Jonathan Gray and then jmc@openbsd:
-l option to ls(1) gives all permissions, not just owner and group.
2003-08-28 19:44:09 +00:00
uwe 9267b09572 Include "config.h" if building as a host program.
Need this to get SIZE_MAX defintion from compat_defs.h on FreeBSD.
2003-08-27 18:36:19 +00:00
junyoung 523866566b Add missing "." 2003-08-27 16:27:35 +00:00
jmmv aba1ca99ae Include strings.h, needed for index's prototype. 2003-08-26 18:14:24 +00:00
jmmv 6d82007582 Use '\0' instead of NULL in two checks (we are not checking for a pointer
value).  While here, add a missing whitespace.
2003-08-26 18:13:25 +00:00
jmmv 5199a59afa s/FD_SETFD/F_SETFD/ 2003-08-26 18:12:33 +00:00
wiz a420e618d0 Push (into yank buffer) words only if force_push is TRUE;
set force_push to TRUE in x_del_bword and x_del_fword.
Fixes behaviour where <meta-y> would put the previously yanked word in the yank buffer another time.
2003-08-26 09:06:50 +00:00
wiz bd6ed3b8c1 From OpenBSD:
revision 1.21
date: 2003/08/02 19:26:15;  author: fgsch;  state: Exp;  lines: +4 -2
On ESC-y ESC-y (yank-pop), also check that there is something to
insert (some text has been killed before). from otto@, fix bug report 3384.

On yank-pop error (no yank before), reset the index to killstack so
another yank-pop does not mangle the prompt if nothing was yanked, and
to avoid replacing a text when it shouldn't
(yank <something> yank-pop yank-pop).
otto@ ok.
2003-08-26 08:52:03 +00:00
wiz a7f5601ea5 Allow single letters to be yanked, not only words of two or more letters. 2003-08-26 08:40:51 +00:00
wiz 77f8e9c131 Add 'return' statement (and whitespace) to sync with OpenBSD version
of the patch committed in v1.12.
2003-08-26 07:35:21 +00:00
wiz ad30231fc4 From OpenBSD:
revision 1.18
date: 2003/08/22 18:17:10;  author: fgsch;  state: Exp;  lines: +2 -2
in word location, fix forward scanning so it correctly account for any
escaped char and not only spaces.
for "foo (bar.a)" and "foo (bar a)", cd foo\ \(bar.<tab> will correctly
expand to foo\ \(bar.a\).
otto@ and pval@ ok.
2003-08-26 07:28:39 +00:00
wiz 80d20cd1d2 From OpenBSD:
revision 1.23
date: 2003/08/23 02:30:59;  author: fgsch;  state: Exp;  lines: +2 -2
under emacs mode, fix the case when the globbed file and the longest
prefix lenghts are equal ("a .b" and "a ab" by instance).
found and tested by otto@.
2003-08-26 07:27:42 +00:00
jmmv 534b18e585 Move an assignment that was using a variable out of scope to fix a build
problem on !NetBSD.
2003-08-25 20:08:12 +00:00
kleink aeaabe9fa8 This is a host tool, so for the time being change SIZE_T_MAX to the
more portable SIZE_MAX; partially addresses PR toolchain/22504 from
Christian Limpach.
2003-08-25 16:38:55 +00:00
wiz ffdf32a762 From OpenBSD:
date: 2000/11/21 22:41:03;  author: millert;  state: Exp;  lines: +2 -1
Add missing break that broke 'kill -s SIGNAME', bug report #1495
Fix from Hiroyuki.HORINOKUCHI@nrj.ericsson.se
2003-08-25 13:23:59 +00:00
cb 5f734a1850 fix a race condition between path resolution in userland
and the subsequent namei(): inform the kernel portion of
valid filenames and then disallow symlink lookups for
those filenames by means of a hook in namei().
with suggestions from provos@

also, add (currently unused) seqnr field to struct
systrace_replace, from provos@
2003-08-25 09:12:42 +00:00
itojun 59a105b48a remove \r (agc, are you using MS-DOS?) 2003-08-22 14:21:12 +00:00
agc 3538d2653b Move 4 more files from UCB 4 clause to 3 clause licence.
Thanks to Julio Merino for pointing them out.
2003-08-22 11:22:23 +00:00
christos e9a8269bb0 remove clause 3 2003-08-21 17:57:53 +00:00
jschauma ca5d0a41d2 Fix two more memory leaks found by Hubert Feyrer. 2003-08-21 04:30:25 +00:00
jschauma 39ff49f1b4 Fix memory leak noted by Hubert Feyrer in private email.
Patch by Hubert Feyrer as well, OK by kleink.
(I'm just fixing it b/c it's my fault to begin with.)
2003-08-20 14:25:54 +00:00
kleink 5d98794ef5 Minor KNF nit from rev. 1.13. 2003-08-20 10:43:55 +00:00
itojun e0e82d2080 typo 2003-08-20 01:28:44 +00:00
itojun ce5d37eae2 use bounded string op 2003-08-13 07:34:09 +00:00
itojun e1e0321817 use bounded string op 2003-08-13 02:51:20 +00:00
agc b5b2954259 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22249, verified by myself.
2003-08-07 09:05:01 +00:00
erh e5f16a4651 Include stdlib.h so EXIT_FAILURE is defined. 2003-08-05 14:55:03 +00:00
jschauma 458ed23412 As discusses a little while back on tech-userlevel:
If stdout is a tty, use vis(3) to print any filenames to prevent garbage
from being printed if the filename contains control- or other non-printable
characters.

While here, sprinkle some EXIT_FAILURE and NOTREACHED where appropriate.
2003-08-04 22:31:21 +00:00
provos ab6fc8a1fd fixed contrived race condition during attachment; from marius@monkey.org 2003-08-02 14:45:08 +00:00
provos 037feaaf20 avoid warning due to name collision. 2003-08-02 14:34:35 +00:00
provos 2e1af85ab0 normalize CWD for cases where CWD has a symlink in it. should solve
problems where CWD policies would not match.
2003-08-02 14:31:10 +00:00
provos 08ab84f25d introduce normalize filename function. 2003-08-02 14:29:33 +00:00
provos 43914d5f2f change CWD handling. CWD is fixed to the CWD of the systrace process. 2003-08-02 14:24:30 +00:00
lukem a93ea220fc Rework how dependency generation is performed:
* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
  This is a change of behaviour.  If a Makefile wants the clean semantics
  it must specifically append to CLEANFILES.
  Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
  that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d  depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".
2003-08-01 17:03:41 +00:00
lukem 8ecf6c5100 revert previous; lossage was caused by local makefile changes 2003-08-01 11:09:38 +00:00
lukem 913e4f842e add explit dependency for lex.c on parse.h 2003-08-01 10:49:26 +00:00
provos 5edbacc575 escape \n and \r, too 2003-08-01 06:15:02 +00:00
provos 4cd77cec75 get rid of unnecessary groupnames array 2003-08-01 05:42:48 +00:00
lukem d2fa162324 move ${DEPENDSRCS} target to after .include <bsd.*.mk> 2003-07-29 01:34:16 +00:00
lukem eb51573bd7 Use ${DEPENDSRCS} as a target instead of .depend, now that
<bsd.dep.mk> builds .depend from .dep files.
2003-07-28 15:25:02 +00:00
itojun e45b6fad8e include des.h, not kerberosIV/des.h 2003-07-23 21:10:36 +00:00
itojun e63468d8cc split MKKERBEROS4 from MKKERBEROS. based on work by lha at stacken.kth.se
(build confirmed with both MKKERBEROS4=yes and MKKERBEROS4=no)
2003-07-23 08:01:24 +00:00
mrg 2512e501f0 note -z is an extention. 2003-07-19 05:43:54 +00:00
lukem f994b2252e doc2html works here now, so remove NOHTML 2003-07-18 02:18:57 +00:00
lukem 82541d904a doc2html works here now, so remove NOHTML=
(not that it worked here, because NOHTML= was provided *after* <bsd.own.mk>...)
2003-07-18 02:18:49 +00:00
wiz 3013c9b400 cpu -> CPU. 2003-07-14 08:58:12 +00:00
itojun a69cd45b93 use bounded string op 2003-07-13 08:31:13 +00:00
itojun 6950184129 use bounded string op 2003-07-13 08:23:39 +00:00
simonb ec137f4f6b Bump ifree/iused field width. 2003-07-12 15:58:54 +00:00
itojun 032ed69f9a strlcpy 2003-07-12 13:23:55 +00:00
lukem 001c68bd94 Rename a large chunk of the make(1) variables which refer to a
program/tool from "FOO" to "TOOL_FOO".  The new variables are:
	TOOL_ASN1_COMPILE  TOOL_CAP_MKDB  TOOL_CAT  TOOL_CKSUM  TOOL_COMPILE_ET
	TOOL_CONFIG  TOOL_CRUNCHGEN  TOOL_CTAGS  TOOL_DB  TOOL_EQN  TOOL_FGEN
	TOOL_GENCAT  TOOL_GROFF  TOOL_HEXDUMP  TOOL_INDXBIB  TOOL_INSTALLBOOT
	TOOL_INSTALL_INFO  TOOL_M4  TOOL_MAKEFS  TOOL_MAKEINFO  TOOL_MAKEWHATIS
	TOOL_MDSETIMAGE  TOOL_MENUC  TOOL_MKCSMAPPER  TOOL_MKESDB
	TOOL_MKLOCALE  TOOL_MKMAGIC  TOOL_MKTEMP  TOOL_MSGC  TOOL_MTREE
	TOOL_PAX  TOOL_PIC  TOOL_PREPMKBOOTIMAGE  TOOL_PWD_MKDB  TOOL_REFER
	TOOL_ROFF_ASCII  TOOL_ROFF_DVI  TOOL_ROFF_HTML  TOOL_ROFF_PS
	TOOL_ROFF_RAW  TOOL_RPCGEN  TOOL_SOELIM  TOOL_SUNLABEL  TOOL_TBL
	TOOL_UUDECODE  TOOL_VGRIND  TOOL_ZIC

For each, provide default in <bsd.sys.mk> of the form:
	TOOL_FOO?=	foo
and for the ${USETOOLS}=="yes" case in <bsd.own.mk>, provide override:
	TOOL_FOO=	${TOOLDIR}/bin/${_TOOL_PREFIX}foo

Document all of these in bsd.README.

This cleans up a chunk of potential (and actual) namespace collision
within our build infrastructure, as well as improves consistency in
the share/mk documentation and provision of appropriate defaults for
each of these variables.
2003-07-10 10:33:58 +00:00
wiz b65146bf4a Bump date for -O change. 2003-07-09 14:42:16 +00:00
simonb 1301238ab7 Add support for gnutar's -O "extract to stdout" option. 2003-07-08 06:00:48 +00:00
wiz face0e9a82 Cm Fl -> Fl. 2003-07-01 10:24:41 +00:00
wiz 5127f8f2c1 Quote some punctuation. 2003-06-27 09:11:12 +00:00
christos d1a05abed1 Revert previous change, and fix the -T problem differently: When the options
of the second argument are exhausted, call the appropriate getopt() routine
to process the rest of the arguments instead of finishing option processing.
Fixes:
	tar cf - -T foo
2003-06-24 16:23:31 +00:00
grant a47ed375c9 backout previous; it was a missing prototype elsewhere.
noted by mrg.
2003-06-24 08:27:30 +00:00
grant 8560ab3c2b add cast to fix an integer -> pointer warning. 2003-06-24 06:41:51 +00:00
grant d884498b98 no need for HAVE_LCHOWN and HAVE_LCHMOD anymore. 2003-06-23 13:33:15 +00:00
christos 051ff2c46c Simplify the way we deal with old argument style. Old way was broken when
tar cf - -T dir
2003-06-23 13:15:15 +00:00
christos 6ebfa08f43 spelling 2003-06-23 13:14:43 +00:00
grant 9432809ee1 consistently use "cannot" instead of "can not". 2003-06-23 13:06:53 +00:00
agc 6377cac711 Add NetBSD RCS Ids. 2003-06-23 11:38:51 +00:00
perry 30b25d1cca ANSIfy, from Petri Koistinen in PR 13975 2003-06-16 17:22:00 +00:00
provos 2268d69749 support for a new kernel message that informs userland that an in-kernel
policy has been freed.  this allows us to enforce the kernel policy size
limit for users while users are still able to execute an arbitary number
of applications;  the protocol change is backwards compatible.
2003-06-03 04:33:44 +00:00
provos c57cb7fe98 escape " and \ to \" and \\; with the help of marius@monkey.org; 2003-06-03 01:20:06 +00:00
provos 70f2418ba2 do not free memory that still may be referenced later 2003-06-01 00:12:34 +00:00
simonb ae46649fa5 Pass a NULL to getbsize() for any arguments that aren't needed, and
remove the otherwise unused variables.
2003-05-30 00:17:25 +00:00
lukem 9014bdbce6 * Document $RCMD_CMD in environ(7).
* Cross-reference rcmd(1), rcmd(3), and environ(7) as appropriate.

Should fix [bin/21670] from Geoff Wing.
2003-05-26 10:18:39 +00:00
wiz 8361a7103e Sync usage with man page. 2003-05-21 06:26:07 +00:00
wiz 9d0fdf5d2a Replace < and > with \*[Lt] and \*[Gt] resp. for HTML output.
Sort options. Bump date for last.
2003-05-21 06:23:29 +00:00
provos bd80d3ced7 permit numberic values for uid and gid; allow "<" and ">" for less and
greater; requested by dugsong
2003-05-20 22:45:13 +00:00
lukem 826a14607a Now that <bsd.prog.mk> DTRT if HOSTPROG is defined (i.e, it is a no-op),
there's no need to special-case .include-ing it.
2003-05-18 07:57:31 +00:00
dsl a9fc176e82 Don't close any script files if vfork is set.
If a fork() is done later in order to feed a 'here' document into a pipe
then it is possible that one end of the pipe might get closed.
2003-05-15 13:26:45 +00:00
dsl 49e6852272 Fix problems with parallel makes. 2003-05-15 10:13:36 +00:00
dsl 6285ef062c Use echo instead of cat to add prologue to builtins.[ch]
Under some circumstances the headers got overwritten.
2003-05-15 10:11:01 +00:00
kleink 7c8d837e74 If both -g and -l options are present, let -l take precedence over -g,
as requested by several users.

POSIX-2001 is unclear on conflicting option letters as far as the -g
option is concerned; a clarification request will be made.

Addresses PR bin/21519 by Geoff Wing.
2003-05-11 08:06:01 +00:00
lukem 17887a5d2c #ifdef HOSTPROG then explicitly use {major,minor,makedev}_netbsd
macros from pack_dev.h instead of the native versions.
Fixes [toolchain/20051] by Valeriy E. Ushakov.
2003-05-09 01:09:13 +00:00
itojun f703f13276 use sizeof for safety 2003-05-09 00:56:56 +00:00
christos dd61e68e1f Use ${HOST_SH} 2003-05-08 13:03:19 +00:00
simonb 7efb28b165 Add a FALLTHROUGH to keep lint happy. 2003-05-07 13:23:32 +00:00
grant 75d0e9d0c0 make -g behave as it should according to SUSv3 (long listing without
owner).

ok'd by kleink@.
2003-05-07 13:00:24 +00:00