-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tar: fail early for bad options #978
Conversation
mknos
commented
Mar 4, 2025
- Add missing getopts() return value check
- This version of tar didn't have a usage string, so add one
- Don't list -c in usage string for now because archive creation isn't implemented
- Unconditionally use Compress::Zlib because it is a core library
* Add missing getopts() return value check * This version of tar didn't have a usage string, so add one * Don't list -c in usage string for now because archive creation isn't implemented * Unconditionally use Compress::Zlib because it is a core library
Pull Request Test Coverage Report for Build 13655550118Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
bin/tar
Outdated
@@ -13,34 +13,21 @@ License: | |||
|
|||
use strict; | |||
|
|||
use Compress::Zlib qw(gzopen); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a v5.10 module, so we can't rely on it being there. The conditional check should still be there,.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback. New commit added which restores the module-exists check, without conditionally changing the personality of getopts().
As a test I created an archive with GNU tar 1.34, listed the entries with perl tar -tf x.tar
, compressed the archive with gzip 1.12 and did a detailed list of compressed archive with perl tar -tvzf x.tar.gz
.