Commit 50527ede authored by Bdale Garbee's avatar Bdale Garbee
Browse files

clean up old patches no longer in use

parent 8655d6d5
This diff is collapsed.
Description: Allow package to build with glibc-2.16
'gets' has been removed from glibc-2.16 but gnulib still refers to it
causing build failures.
The simple fix for now is just to put a check around the reference in
lib/stdio.in.h
A new release made with a new gnulib is a better fix.
.
tar (1.26-5) unstable; urgency=low
.
* Fix gnu/stdio.in.h to build with glibc-2.16 (gets removed)
Author: Wookey <wookey@wookware.org>
Last-Update: 2012-11-5
Bug : http://lists.gnu.org/archive/html/bug-gnulib/2012-03/msg00186.html
Bug-Debian: http://bugs.debian.org/687986
Forwarded: not-needed
--- tar-1.26.orig/gnu/stdio.in.h
+++ tar-1.26/gnu/stdio.in.h
@@ -164,7 +164,9 @@ _GL_WARN_ON_USE (fflush, "fflush is not
so any use of gets warrants an unconditional warning. Assume it is
always declared, since it is required by C89. */
#undef gets
+#ifdef HAVE_RAW_DECL_GETS
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+#endif
#if @GNULIB_FOPEN@
# if @REPLACE_FOPEN@
Description: link extraction fix
tar (1.26+dfsg-6) unstable; urgency=low
.
* cherry-pick upstream commit at Paul Eggert's suggestion to address link
extraction issue, closes: #452365
Author: Bdale Garbee <bdale@gag.com>
Bug-Debian: http://bugs.debian.org/452365
--- tar-1.26+dfsg.orig/src/extract.c
+++ tar-1.26+dfsg/src/extract.c
@@ -110,12 +110,15 @@ struct delayed_link
/* The next delayed link in the list. */
struct delayed_link *next;
- /* The device, inode number and ctime of the placeholder. Use
- ctime, not mtime, to make false matches less likely if some
- other process removes the placeholder. */
+ /* The device, inode number and birthtime of the placeholder.
+ birthtime.tv_nsec is negative if the birthtime is not available.
+ Don't use mtime as this would allow for false matches if some
+ other process removes the placeholder. Don't use ctime as
+ this would cause race conditions and other screwups, e.g.,
+ when restoring hard-linked symlinks. */
dev_t dev;
ino_t ino;
- struct timespec ctime;
+ struct timespec birthtime;
/* True if the link is symbolic. */
bool is_symlink;
@@ -268,6 +271,15 @@ set_mode (char const *file_name,
}
}
+/* Return true if A and B are the same birthtimes.
+ Unavailable birthtimes, which have negative tv_nsec members,
+ all compare equal to each other. */
+static bool
+same_birthtime (struct timespec a, struct timespec b)
+{
+ return (a.tv_nsec == b.tv_nsec && (a.tv_nsec < 0 || a.tv_sec == b.tv_sec));
+}
+
/* Check time after successfully setting FILE_NAME's time stamp to T. */
static void
check_time (char const *file_name, struct timespec t)
@@ -1076,7 +1088,7 @@ create_placeholder_file (char *file_name
delayed_link_head = p;
p->dev = st.st_dev;
p->ino = st.st_ino;
- p->ctime = get_stat_ctime (&st);
+ p->birthtime = get_stat_birthtime (&st);
p->is_symlink = is_symlink;
if (is_symlink)
{
@@ -1134,7 +1146,7 @@ extract_link (char *file_name, int typef
if (ds->change_dir == chdir_current
&& ds->dev == st1.st_dev
&& ds->ino == st1.st_ino
- && timespec_cmp (ds->ctime, get_stat_ctime (&st1)) == 0)
+ && same_birthtime (ds->birthtime, get_stat_birthtime (&st1)))
{
struct string_list *p = xmalloc (offsetof (struct string_list, string)
+ strlen (file_name) + 1);
@@ -1500,7 +1512,7 @@ apply_delayed_links (void)
if (fstatat (chdir_fd, source, &st, AT_SYMLINK_NOFOLLOW) == 0
&& st.st_dev == ds->dev
&& st.st_ino == ds->ino
- && timespec_cmp (get_stat_ctime (&st), ds->ctime) == 0)
+ && same_birthtime (get_stat_birthtime (&st), ds->birthtime))
{
/* Unlink the placeholder, then create a hard link if possible,
a symbolic link otherwise. */
pristine-tar.diff
listed03-linux-only
pristine_tar_compat
From d88b2a613f4b1a5554e8c34c8f75b91abff5f0e9 Mon Sep 17 00:00:00 2001
From: Sergey Poznyakoff <gray@gnu.org.ua>
Date: Tue, 15 Nov 2011 10:58:32 +0000
Subject: Fix operation of --verify in conjunction with --listed-incremental
* src/common.h (clear_directory_table): New proto.
* src/incremen.c (clear_directory_table): New function.
* src/compare.c (diff_dumpdir): Take a pointer to struct
tar_stat_info as argument.
Initialize its fd.
(diff_archive): Update call to diff_dumpdir.
(verify_volume): Call clear_directory_table.
---
diff --git a/src/common.h b/src/common.h
index 0b9bd7a..6074ac3 100644
--- a/src/common.h
+++ b/src/common.h
@@ -522,6 +522,7 @@ void update_parent_directory (struct tar_stat_info *st);
size_t dumpdir_size (const char *p);
bool is_dumpdir (struct tar_stat_info *stat_info);
+void clear_directory_table (void);
/* Module list.c. */
diff --git a/src/compare.c b/src/compare.c
index 273269a..185a61a 100644
--- a/src/compare.c
+++ b/src/compare.c
@@ -359,31 +359,47 @@ dumpdir_cmp (const char *a, const char *b)
}
static void
-diff_dumpdir (void)
+diff_dumpdir (struct tar_stat_info *dir)
{
const char *dumpdir_buffer;
dev_t dev = 0;
struct stat stat_data;
- if (deref_stat (current_stat_info.file_name, &stat_data) != 0)
+ if (deref_stat (dir->file_name, &stat_data) != 0)
{
if (errno == ENOENT)
- stat_warn (current_stat_info.file_name);
+ stat_warn (dir->file_name);
else
- stat_error (current_stat_info.file_name);
+ stat_error (dir->file_name);
}
else
dev = stat_data.st_dev;
- dumpdir_buffer = directory_contents (scan_directory (&current_stat_info));
+ if (dir->fd == 0)
+ {
+ void (*diag) (char const *) = NULL;
+ int fd = subfile_open (dir->parent, dir->orig_file_name, open_read_flags);
+ if (fd < 0)
+ diag = open_diag;
+ else if (fstat (fd, &dir->stat))
+ diag = stat_diag;
+ else
+ dir->fd = fd;
+ if (diag)
+ {
+ file_removed_diag (dir->orig_file_name, false, diag);
+ return;
+ }
+ }
+ dumpdir_buffer = directory_contents (scan_directory (dir));
if (dumpdir_buffer)
{
- if (dumpdir_cmp (current_stat_info.dumpdir, dumpdir_buffer))
- report_difference (&current_stat_info, _("Contents differ"));
+ if (dumpdir_cmp (dir->dumpdir, dumpdir_buffer))
+ report_difference (dir, _("Contents differ"));
}
else
- read_and_process (&current_stat_info, process_noop);
+ read_and_process (dir, process_noop);
}
static void
@@ -446,7 +462,7 @@ diff_multivol (void)
void
diff_archive (void)
{
-
+
set_next_block_after (current_header);
/* Print the block from current_header and current_stat_info. */
@@ -498,7 +514,7 @@ diff_archive (void)
case GNUTYPE_DUMPDIR:
case DIRTYPE:
if (is_dumpdir (&current_stat_info))
- diff_dumpdir ();
+ diff_dumpdir (&current_stat_info);
diff_dir ();
break;
@@ -530,6 +546,8 @@ verify_volume (void)
WARN((0, 0,
_("Verification may fail to locate original files.")));
+ clear_directory_table ();
+
if (!diff_buffer)
diff_init ();
diff --git a/src/incremen.c b/src/incremen.c
index b2ab5bf..69cbd59 100644
--- a/src/incremen.c
+++ b/src/incremen.c
@@ -300,6 +300,24 @@ dirlist_replace_prefix (const char *pref, const char *repl)
replace_prefix (&dp->name, pref, pref_len, repl, repl_len);
}
+void
+clear_directory_table (void)
+{
+ struct directory *dp;
+
+ if (directory_table)
+ hash_clear (directory_table);
+ if (directory_meta_table)
+ hash_clear (directory_meta_table);
+ for (dp = dirhead; dp; )
+ {
+ struct directory *next = dp->next;
+ free_directory (dp);
+ dp = next;
+ }
+ dirhead = dirtail = NULL;
+}
+
/* Create and link a new directory entry for directory NAME, having a
device number DEV and an inode number INO, with NFS indicating
whether it is an NFS device and FOUND indicating whether we have
@@ -327,7 +345,8 @@ note_directory (char const *name, struct timespec mtime,
if (! ((directory_table
|| (directory_table = hash_initialize (0, 0,
hash_directory_canonical_name,
- compare_directory_canonical_names, 0)))
+ compare_directory_canonical_names,
+ 0)))
&& hash_insert (directory_table, directory)))
xalloc_die ();
>From 6689e8db4f53f6a0bed3d1bc4ed12d31eaa3bf51 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Tue, 17 Jan 2012 22:21:52 -0800
Subject: [PATCH] tar: port --overwrite symlink test to GNU/Hurd
Problem reported by Pino Toscano in
<http://lists.gnu.org/archive/html/bug-tar/2012-01/msg00040.html>.
* gnulib.modules: Add fcntl-h, which defines
HAVE_WORKING_O_NOFOLLOW.
* src/extract.c (open_output_file): Use HAVE_WORKING_O_NOFOLLOW,
not O_NOFOLLOW, when testing whther O_NOFOLLOW works.
This file is a placeholder. It will be replaced with the actual ChangeLog
by make dist. Run make ChangeLog if you wish to create it earlier.
---
gnulib.modules | 1 +
src/extract.c | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/extract.c b/src/extract.c
index 55f3eb8..bd5e7bf 100644
--- a/src/extract.c
+++ b/src/extract.c
@@ -887,7 +887,8 @@ open_output_file (char const *file_name, int typeflag, mode_t mode,
/* If O_NOFOLLOW is needed but does not work, check for a symlink
separately. There's a race condition, but that cannot be avoided
on hosts lacking O_NOFOLLOW. */
- if (! O_NOFOLLOW && overwriting_old_files && ! dereference_option)
+ if (! HAVE_WORKING_O_NOFOLLOW
+ && overwriting_old_files && ! dereference_option)
{
struct stat st;
if (fstatat (chdir_fd, file_name, &st, AT_SYMLINK_NOFOLLOW) == 0
--
1.7.10.4
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment