Bug 1303702
Summary: | tar --diff always report mode differ | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Pavel Alexeev <pahan> |
Component: | tar | Assignee: | Pavel Raiskup <praiskup> |
Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 23 | CC: | kdudka, ovasik, pahan, praiskup |
Target Milestone: | --- | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2016-02-09 07:08:35 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Pavel Alexeev
2016-02-01 17:18:59 UTC
Hi Pavel, this is not a bug (at least not in --diff). # tar -vv --diff -f apache-activemq-5.13.0-bin.tar.gz -C /opt/activemq/ | grep -e 'Mode differs' -e 'demo/js/$' drwx------ clshann/users 0 2015-11-30 13:53 apache-activemq-5.13.0/webapps-demo/demo/js/ apache-activemq-5.13.0/webapps-demo/demo/js: Mode differs drwxr-xr-x 0/0 0 2015-11-30 13:53 apache-activemq-5.13.0/webapps-demo/demo/js/ You can see that the directory is duplicated within tarball, each time it has different mode. This is valid tarball -- but you must expect that if if you extract, the former mode is replaced with the later (last record wins). That bug not only in --diff, but in --extract inconsistent. Why they are use it in different order? Result should be reproducible. If extract can't extract archive properly (at least owner, rights, attributes) - why it report 0 exit code? If it threat it done correctly - then --diff should not complain it is not. Can you please elaborate what goes wrong? IMO the extraction works fine. When you extract the tarball, the last apache-activemq-5.13.0/webapps-demo/demo/js/ record will succeed. At least on my box, after the tarball extraction: drwxr-xr-x. 4 root root 4096 Nov 30 13:53 apache-activemq-5.13.0/webapps-demo/demo/js/ This is the "status" of the directory after successful extraction. If you try to compare this "status" by --diff with archive contents, it will show error for the "first" record in the archive, because that has: drwx------ clshann/users 0 2015-11-30 13:53 apache-activemq-5.13.0/webapps-demo/demo/js/ How it may be twice in archive? I assume it can't be then extracted correctly to any filesystem, is not? If it legitimate case for some way, it should be then checked as extracted. So, if status of extract returned by last entrance - it also should be compared on make difference. I am wrong? (In reply to Pavel Alexeev from comment #4) > How it may be twice in archive? tar (ustar/pax) archive formats do not limit you in this case -- you may even append to existing tar archive: $ touch a $ tar cf a.tar a a a $ tar tf a.tar a a a > I assume it can't be then extracted correctly to any filesystem, is not? The last record wins during extraction. All archive members are extracted, consecutively from beginning of the archive to the end. This means that if there is some file twice, the later record in archive will replace the former records. > If it legitimate case for some way, it should be then checked as extracted. There is no issue from tar's POV - so there is no need to complain. This is responsibility of archive creator. > So, if status of extract returned by last entrance - it also should be > compared on make difference. I am wrong? All archive records are extracted (and with --diff compared). Ok, thanks for the detailed explanations. I'll continue search more info how it intended to be used in that case. |