Commit Graph

37 Commits

Author SHA1 Message Date
Paul Eggert
ba2ef4d075 Update copyright year. 2000-01-07 23:02:32 +00:00
Paul Eggert
53f16a5971 (extr_init): If we run out of memory, invoke apply_delayed_set_stat.
(set_mode): Use Use error message functions to report errors consistently.
(set_stat): Likewise.
(repair_delayed_set_stat): Quote file names with colons if possible.
(prepare_to_extract): Don't complain if we can't remove ".".
(extract_sparse_file): Use consistent message for unexpected EOF.
Use error message functions to report errors consistently.
(extract_archive): Use consistent message for unexpected EOF.
Use error message functions to report errors consistently.
Quote file names with colons if possible.
(apply_delayed_set_stat): New function.
(apply_nonancestor_delayed_set_stat): Renamed from apply_delayed_set_stat.
Don't remove head if it doesn't apply.
(fatal_exit): Invoke apply_delayed_set_stat with no args.
2000-01-07 19:25:23 +00:00
Paul Eggert
6e9d1539b6 (<quotearg.h>): New include.
(enum permstatus): New enum.
(struct delayed_set_stat): file_name is now at end of buffer, to avoid
two mallocs.  New members file_name_len, invert_permissions, permstatus.
(extr_init): Remove hack that silently adjusted newdir_umask.
(set_mode, set_stat): New args invert_permissions, permstatus, typeflag.
Use these args to decide whether and how to set modes.
(set_mode, set_stat, prepare_to_extract, extract_sparse_file, extract_archive):
Don't assume that gettext preserves errno.
(set_stat): Remove arg symlink_flag; subsumed by typeflag.
(delay_set_stat, repair_delayed_set_stat): New functions.
(make_directories): Avoid mkdir where last part of path is "..".
Create a struct delayed_set_stat for each directory made.
(prepare_to_extract): Renamed from unlink_destination, and
return 0 immediately if to_stdout_option; all callers changed.
(maybe_recoverable): New parameter interdir_made.
Add support for --overwrite.
(extract_sparse_file, extract_archive):
Quote arbitrary strings in diagnostics.
(extract_archive): By default, warn about ".." in member names, and skip them.
Don't open files with O_NONBLOCK or O_APPEND.
Open with O_TRUNC only if --overwrite; otherwise, use O_EXCL to avoid
overwriting them.  Pass only rwxrwxrwx permissions to `open' and `mkdir',
minus the current umask.  Keep track of intermediate directories made,
to avoid looping when making x/../x when x doesn't exist; the
earlier code solved this in a different way that didn't fit well
into the new scheme.  Don't extract permissions onto existing
directories unless --overwrite is given.  Do not add -wx------
permissions to new directories permanently; just do it temporarily.
Remove no-longer-needed hack with MSDOS and directory time stamps.
(apply_delayed_set_stat): New argument specifies which directories to
fix statuses of.  Do not wait until the end of extraction to fix
statuses; instead, fix a directory's status once we exit that directory.
This requires less memory and does the right thing in some cases
where the old method didn't.
(fatal_exit): New function.
1999-12-13 03:26:04 +00:00
Paul Eggert
c9f5ead8de Remove bogus errno FIXMEs. 1999-12-03 13:04:17 +00:00
Paul Eggert
7be178a4d4 (set_stat): Remove duplicate code. 1999-11-07 21:06:38 +00:00
Paul Eggert
5ae88d8a13 (<time.h>): No need to include.
(time): No need to declare.
(now): Remove variable.
(extr_init): Don't initialize `now'.
Increment same_permissions_option and same_owner_option if we_are_root
is nonzero; this supports the new --no-same-owner option.
(set_stat): Use start_time instead of `now'.
1999-09-21 15:13:33 +00:00
Paul Eggert
c270f6f1b2 Lint cleanup. 1999-08-23 09:55:55 +00:00
Paul Eggert
72290b64a6 (extract_sparse_file, extract_archive): Don't assume find_next_block yields nonnull.
(extract_archive): Fix sparse array bug: we did not find end of array
correctly.
1999-08-18 07:52:26 +00:00
Paul Eggert
5e0e027651 (make_directories): Do not chown intermediate directories, even
if we are root.
1999-08-16 08:13:20 +00:00
Paul Eggert
bda50f104b (time): Don't declare if defined.
(extr_init): Remove unneeded cast around 0 arg to time.
1999-08-14 07:10:19 +00:00
Paul Eggert
c402183f88 (extract_archive): Open files with O_NONBLOCK instead of O_NDELAY. 1999-08-11 12:47:01 +00:00
Paul Eggert
9cb6f5c466 this matches historical practice.
(unlink_destination): New function, which checks for unlink failures.
(maybe_recoverable): Stay quiet if -U.
(extract_archive): Use O_EXCL if unlink_first_option.
Report unlink failures.
Use HAVE_SYMLINK, not S_ISLNK, to determine whether symlink exists.
Use HAVE_MKFIFO || defined mkfifo, not S_ISFIFO, to determine whether
mkfifo exists.
1999-07-20 07:09:27 +00:00
Paul Eggert
6a8c91fef3 (extract_archive): Test whether S_IFCHR and S_IFBLK are nonzero,
not whether they are defined, for consistency with other tests.
1999-07-12 13:03:58 +00:00
Paul Eggert
0f32adce25 (extr_init, make_directories, extract_archive):
Do not assume mode bits have traditional Unix values.
(set_mode): Use %04 not %0.4 format.
(extract_sparse_file): Do not use data_block uninitialized.
Check for lseek failures; use portable lseek whence values.
1999-07-02 21:25:09 +00:00
Paul Eggert
6290150c47 Fix copyright notice. 1999-07-01 21:01:44 +00:00
Paul Eggert
1521a94b11 Handle EINTR correctly; use STDIN_FILENO instead of 0, etc. 1999-06-29 02:26:25 +00:00
Paul Eggert
7381ee26dd (extract_archive): Fix bug when extracting sparse files: they were
trashing the tar file header.
1999-02-01 07:51:19 +00:00
Paul Eggert
53a5ac41d2 (set_stat): chmod after chown even when not root; if we are using
--same-owner this is needed e.g. on Solaris 2.5.1.
1998-11-30 22:17:11 +00:00
Paul Eggert
49086e2770 (newdir_umask, current_umask): Now mode_t.
(extract_sparse_file): Args now use off_t.

(set_mode, set_stat, make_directories, extract_sparse_file,
extract_archive): Use off_t, size_t, ssize_t when appropriate.  Remove
now-useless casts.  Use unsigned long to print *_t types, except use
STRINGIFY_BIGINT for off_t.
1997-10-31 00:58:55 +00:00
Paul Eggert
818c240503 GNU tar 1.12 1997-04-23 00:05:57 +00:00
François Pinard
a295fffa66 *** empty log message *** 1994-11-16 02:46:28 +00:00
François Pinard
604e1433aa *** empty log message *** 1994-11-16 02:46:25 +00:00
François Pinard
32841f71ca *** empty log message *** 1994-11-16 02:46:22 +00:00
François Pinard
d61947f130 *** empty log message *** 1994-11-16 02:46:19 +00:00
François Pinard
9276277081 *** empty log message *** 1994-11-16 02:46:17 +00:00
François Pinard
0435e380a9 *** empty log message *** 1994-11-16 02:46:14 +00:00
François Pinard
2017294abd *** empty log message *** 1994-11-16 02:46:11 +00:00
François Pinard
84bff04c0d *** empty log message *** 1994-11-16 02:46:08 +00:00
François Pinard
7a8e060e78 *** empty log message *** 1994-11-16 02:46:06 +00:00
François Pinard
a7d353a9f0 *** empty log message *** 1994-11-16 02:46:03 +00:00
François Pinard
f420331fb4 *** empty log message *** 1994-11-16 02:46:00 +00:00
François Pinard
5b394b2c7e *** empty log message *** 1994-11-16 02:45:55 +00:00
François Pinard
67766d811b *** empty log message *** 1994-11-16 02:45:52 +00:00
François Pinard
c50f453516 *** empty log message *** 1994-11-16 02:45:50 +00:00
François Pinard
9f97e2257e *** empty log message *** 1994-11-16 02:45:43 +00:00
François Pinard
dc8eef4ae4 Initial revision 1994-11-16 02:45:32 +00:00
François Pinard
4dd93dc46e *** empty log message *** 1994-11-16 02:45:29 +00:00