Commit Graph

2191 Commits

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