[BusyBox] busybox 1.0, tar and hard links -- bug or feature?
Jean Wolter
jw5 at os.inf.tu-dresden.de
Mon Sep 8 13:16:48 MDT 2003
Hello,
tar xf foo.tar doesn't handle hard links correctly. If it encounters a
hard link it creates a normal file.
In data_extract_all() busybox checks, whether it is a hard link or
not, but it does so only if CONFIG_CPIO is enabled. If I add a check
for CONFIG_TAR, busybox tar handles hard links correctly.
Is this a bug or a feature?
regards,
Jean
PS: the diff:
--- data_extract_all.c 23 Aug 2003 09:31:45 -0000 1.1.1.1
+++ data_extract_all.c 8 Sep 2003 10:15:43 -0000
@@ -42,7 +42,7 @@
/* Create the filesystem entry */
switch(file_header->mode & S_IFMT) {
case S_IFREG: {
-#ifdef CONFIG_CPIO
+#if defined CONFIG_CPIO || defined CONFIG_TAR
if (file_header->link_name && file_header->size == 0) {
/* hard link */
res = link(file_header->link_name, file_header->name);
More information about the busybox
mailing list