From: Sebastian Andrzej Siewior <sebast...@breakpoint.cc>

xz refuses to decompress a file which has more than one hard link. It
can be reproduced byi (as per Vincent):
|$ echo foo > file1
|$ xz file1
|$ ln file1.xz file2.xz
|$ xz -d file1.xz
|xz: file1.xz: Input file has more than one hard link, skipping

This behaviour is consistent with `gzip' and `bzip2' but it is not
documented. The `--force' option would ignore this restriction.

I traced it back in `gzip' to the 90s but the change was not documented
as such. It was moved, altered but not documented. At some point the
error was restricted to <= 2 which might be related to disk quota.

Ignore hard link count on input.

Debian BTS: https://bugs.debian.org/975981
Reported-by: Vincent Lefevre <vinc...@vinc17.net>
Signed-off-by: Sebastian Andrzej Siewior <sebast...@breakpoint.cc>
---
 src/xz/file_io.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/src/xz/file_io.c b/src/xz/file_io.c
index 0ba8db8fbc4cc..7fa17431c5dbc 100644
--- a/src/xz/file_io.c
+++ b/src/xz/file_io.c
@@ -697,13 +697,6 @@ io_open_src_real(file_pair *pair)
                                        pair->src_name);
                        goto error;
                }
-
-               if (pair->src_st.st_nlink > 1) {
-                       message_warning(_("%s: Input file has more "
-                                       "than one hard link, "
-                                       "skipping"), pair->src_name);
-                       goto error;
-               }
        }
 
        // If it is something else than a regular file, wait until
-- 
2.30.0.rc2


Reply via email to