[BusyBox] unexpected behavior in tar -x

drwho drwho at f34r.com
Fri Nov 21 00:08:22 MST 2003


cat tinydns.tar | ../busybox tar -x
tar: Couldnt remove old file: Is a directory

 if the folder already exists it die's I do not
think this is expected behavior.. Probably
should stat and see if it is a directory then
handle that case differently..

the offending code is in 
data_extract_all

        /* Check if the file already exists */
        if (archive_handle->flags & ARCHIVE_EXTRACT_UNCONDITIONAL) {
                /* Remove the existing entry if it exists */
                if ((unlink(file_header->name) == -1) && (errno != ENOENT)) {
                        bb_perror_msg_and_die("Couldnt remove old file %s",file_header->name);
                }
        }

Regards



More information about the busybox mailing list