Easy steps to reproduce: create 2 files with short names (e.g. a.txt and b.txt) create an archive containing these files: ar -q short.ar a.txt b.txt busybox ar correctly interprets this file: ar -t short.ar create 2 files with long names (e.g. thisisalongfilename.txt thisisanotherlongfilename.txt) create an archive containing these files: ar -q long.ar thisisalongfilename.txt thisisanotherlongfilename.txt busybox ar command fails with "invalid ar header": ar -t long.ar See source file archival/libunarchive/get_header_ar.c. Function get_header_ar() attempts to read mode, date, uid, gid and size from the file file header; this works for "short" headers but fails for "long" headers. Function get_header_ar() does check for long file headers, but this check is not performed until after attempting to read the file header. I created the archive files using Ubuntu 8.04. I'm using BusyBox v1.13.1 (2009-09-16 11:20:36 EDT) multi-call binary (with CONFIG_FEATURE_AR_LONG_FILENAMES=y) but a check of the 1.15.1 source code shows this bug still exists.
I forgot to say that I'm using BusyBox v1.13.1 on a Linux system with the 2.6.31 kernel.
Created attachment 661 [details] Fix Please try this patch
I tried the patch, it works. Busybox ar command correctly interprets short and long headers.