1
0
Fork 0

Merging upstream version 0.26.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-17 21:27:57 +01:00
parent 7185f44b62
commit 180f99b04d
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
44 changed files with 610 additions and 505 deletions

View file

@ -22,15 +22,15 @@
#include <cerrno>
#include <cstdio>
#include <fcntl.h>
#include <stdint.h> // for lzlib.h
#include <stdint.h> // for lzlib.h
#include <unistd.h>
#include <utime.h>
#include <sys/stat.h>
#if !defined __FreeBSD__ && !defined __OpenBSD__ && !defined __NetBSD__ && \
!defined __DragonFly__ && !defined __APPLE__ && !defined __OS2__
#include <sys/sysmacros.h> // for major, minor, makedev
#include <sys/sysmacros.h> // for major, minor, makedev
#else
#include <sys/types.h> // for major, minor, makedev
#include <sys/types.h> // for major, minor, makedev
#endif
#include <lzlib.h>
@ -190,7 +190,7 @@ int extract_member( const Cl_options & cl_opts, Archive_reader & ar,
return skip_member( ar, extended, typeflag );
}
const bool islink = ( typeflag == tf_link || typeflag == tf_symlink );
const bool islink = typeflag == tf_link || typeflag == tf_symlink;
errno = 0;
if( !islink &&
( !uid_gid_in_range( extended.get_uid(), extended.get_gid() ) ||
@ -229,7 +229,7 @@ int extract_member( const Cl_options & cl_opts, Archive_reader & ar,
}
const int wsize = ( rest >= bufsize ) ? bufsize : rest;
if( outfd >= 0 && writeblock( outfd, buf, wsize ) != wsize )
{ show_file_error( filename, werr_msg, errno ); return 1; }
{ show_file_error( filename, wr_err_msg, errno ); return 1; }
rest -= wsize;
}
}
@ -347,7 +347,7 @@ bool compare_file_type( std::string & estr, std::string & ostr,
{
char * const buf = new char[st.st_size+1];
long len = readlink( filename, buf, st.st_size );
bool e = ( len != st.st_size );
bool e = len != st.st_size;
if( !e )
{
while( len > 1 && buf[len-1] == '/' ) --len; // trailing '/'
@ -412,6 +412,8 @@ int decode( const Cl_options & cl_opts )
// open archive before changing working directory
const Archive_descriptor ad( cl_opts.archive_name );
if( ad.infd < 0 ) return 1;
if( ad.name.size() && ad.indexed && ad.lzip_index.multi_empty() )
{ show_file_error( ad.namep, empty_msg ); close( ad.infd ); return 2; }
const bool c_present = option_C_present( cl_opts.parser ) &&
cl_opts.program_mode != m_list;