Commit Graph

2207 Commits

Author SHA1 Message Date
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