Compare commits
2 Commits
release-1.
...
release-1.
Author | SHA1 | Date | |
---|---|---|---|
a7a9c29943 | |||
408eb3f5c6 |
27
ChangeLog
27
ChangeLog
@ -1,29 +1,4 @@
|
|||||||
libisofs-1.5.6.pl01.tar.gz Mon Jun 12 2023
|
libisofs-1.5.4.tar.gz Sun Feb 07 2021
|
||||||
===============================================================================
|
|
||||||
* Bug fix: On non-GNU/Linux systems ssize_t was not defined in rockridge.h .
|
|
||||||
Report and fix proposal by Rui Chen.
|
|
||||||
|
|
||||||
libisofs-1.5.6.tar.gz Wed Jun 07 2023
|
|
||||||
===============================================================================
|
|
||||||
* Bug fix: iso_write_opts_set_part_like_isohybrid() did not cause a MBR
|
|
||||||
partition table if the partitions are data files in the ISO
|
|
||||||
rather than appended
|
|
||||||
* Bug fix: The lseek methods of IsoFileSource for local filesystem and loaded
|
|
||||||
ISO returned libisofs error codes as positive off_t numbers
|
|
||||||
* Bug fix: Freshly cloned data files from imported image were not marked as
|
|
||||||
imported. Thanks to Ivan Shmakov. (Closes: #1022851)
|
|
||||||
* Bug fix: Size of further CE area was calculated wrong if its CE entry ended
|
|
||||||
exactly at a block boundary
|
|
||||||
* New iso_write_opts_set_system_area() option bits 16:
|
|
||||||
GPT "Legacy BIOS bootable" and 17: GPT writable
|
|
||||||
* New API calls iso_assess_written_features(), iso_read_image_feature_named(),
|
|
||||||
iso_read_image_features_text()
|
|
||||||
* Allowed lseekable device files with iso_tree_add_new_cut_out_node().
|
|
||||||
Proof-of-concept by Ivan Shmakov.
|
|
||||||
* New API call iso_write_opts_set_max_ce_entries()
|
|
||||||
|
|
||||||
|
|
||||||
libisofs-1.5.4.tar.gz Sat Jan 30 2021
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
* Bug fix: Large amounts of AAIP data or many long file names could cause with
|
* Bug fix: Large amounts of AAIP data or many long file names could cause with
|
||||||
zisofs an unreadable filesystem after the warning "Calculated and
|
zisofs an unreadable filesystem after the warning "Calculated and
|
||||||
|
19
README
19
README
@ -5,7 +5,7 @@
|
|||||||
Released under GNU General Public License version 2 or later.
|
Released under GNU General Public License version 2 or later.
|
||||||
See COPYING file for details.
|
See COPYING file for details.
|
||||||
|
|
||||||
Copyright (C) 2008 - 2021 Vreixo Formoso,
|
Copyright (C) 2008 - 2018 Vreixo Formoso,
|
||||||
Mario Danic,
|
Mario Danic,
|
||||||
Vladimir Serbinenko,
|
Vladimir Serbinenko,
|
||||||
Thomas Schmitt
|
Thomas Schmitt
|
||||||
@ -15,24 +15,25 @@ libisofs is part of the libburnia project (libburnia-project.org)
|
|||||||
|
|
||||||
Download, Build and Installation
|
Download, Build and Installation
|
||||||
|
|
||||||
libisofs code is maintained in a git repository at dev.lovelyhq.com
|
libisofs code is maintained in a Bazaar repository at Launchpad
|
||||||
(https://dev.lovelyhq.com/libburnia/libisofs). You can download it with:
|
(https://launchpad.net/libisofs/). You can download it with:
|
||||||
|
|
||||||
$ git clone https://dev.lovelyhq.com/libburnia/libisofs.git
|
$ bzr branch lp:libisofs/for-libisoburn
|
||||||
|
|
||||||
Our build system is based on autotools. For preparing the build you will need
|
Our build system is based on autotools. For preparing the build you will need
|
||||||
autotools of at least version 1.7. If you have downloaded the code from the
|
autotools of at least version 1.7. If you have download the code from the
|
||||||
repository, first of all you need to execute
|
repository, first of all you need to execute
|
||||||
|
|
||||||
./bootstrap
|
./autogen.sh
|
||||||
|
|
||||||
in the toplevel directory ./libisofs, in order to execute autotools.
|
on toplevel dir to execute autotools.
|
||||||
|
|
||||||
Alternatively you may unpack a release tarball for which you do not need
|
Alternatively you may unpack a release tarball for which you do not need
|
||||||
autotools installed. For the most recent release of libisofs see:
|
autotools installed. For the most recent release of libisofs see:
|
||||||
https://dev.lovelyhq.com/libburnia/web/wiki/Releases
|
http://libburnia-project.org/wiki/Releases
|
||||||
|
|
||||||
To build libisofs go into its toplevel directory and execute
|
To build libisofs it should be sufficient to go into its toplevel directory
|
||||||
|
and execute
|
||||||
|
|
||||||
./configure --prefix=/usr
|
./configure --prefix=/usr
|
||||||
make
|
make
|
||||||
|
13
configure.ac
13
configure.ac
@ -1,4 +1,4 @@
|
|||||||
AC_INIT([libisofs], [1.5.6], [http://libburnia-project.org])
|
AC_INIT([libisofs], [1.5.4], [http://libburnia-project.org])
|
||||||
AC_PREREQ([2.50])
|
AC_PREREQ([2.50])
|
||||||
dnl AC_CONFIG_HEADER([config.h])
|
dnl AC_CONFIG_HEADER([config.h])
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ dnl If LIBISOFS_*_VERSION changes, be sure to change AC_INIT above to match.
|
|||||||
dnl
|
dnl
|
||||||
LIBISOFS_MAJOR_VERSION=1
|
LIBISOFS_MAJOR_VERSION=1
|
||||||
LIBISOFS_MINOR_VERSION=5
|
LIBISOFS_MINOR_VERSION=5
|
||||||
LIBISOFS_MICRO_VERSION=6
|
LIBISOFS_MICRO_VERSION=4
|
||||||
LIBISOFS_VERSION=$LIBISOFS_MAJOR_VERSION.$LIBISOFS_MINOR_VERSION.$LIBISOFS_MICRO_VERSION
|
LIBISOFS_VERSION=$LIBISOFS_MAJOR_VERSION.$LIBISOFS_MINOR_VERSION.$LIBISOFS_MICRO_VERSION
|
||||||
|
|
||||||
AC_SUBST(LIBISOFS_MAJOR_VERSION)
|
AC_SUBST(LIBISOFS_MAJOR_VERSION)
|
||||||
@ -51,10 +51,10 @@ AC_SUBST(LIBISOFS_VERSION)
|
|||||||
|
|
||||||
dnl Libtool versioning
|
dnl Libtool versioning
|
||||||
LT_RELEASE=$LIBISOFS_MAJOR_VERSION.$LIBISOFS_MINOR_VERSION
|
LT_RELEASE=$LIBISOFS_MAJOR_VERSION.$LIBISOFS_MINOR_VERSION
|
||||||
dnl 2023.05.07 development jump has not yet happened
|
dnl 2021.01.30 development jump has not yet happened
|
||||||
dnl SONAME = 98 - 92 = 6 . Library name = libisofs.6.92.0
|
dnl SONAME = 97 - 91 = 6 . Library name = libisofs.6.91.0
|
||||||
LT_CURRENT=98
|
LT_CURRENT=97
|
||||||
LT_AGE=92
|
LT_AGE=91
|
||||||
LT_REVISION=0
|
LT_REVISION=0
|
||||||
LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
|
LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
|
||||||
|
|
||||||
@ -73,6 +73,7 @@ dnl AM_MAINTAINER_MODE
|
|||||||
AM_PROG_CC_C_O
|
AM_PROG_CC_C_O
|
||||||
AC_C_CONST
|
AC_C_CONST
|
||||||
AC_C_INLINE
|
AC_C_INLINE
|
||||||
|
AC_C_BIGENDIAN
|
||||||
|
|
||||||
dnl Large file support
|
dnl Large file support
|
||||||
AC_SYS_LARGEFILE
|
AC_SYS_LARGEFILE
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
To be included by aaip_0_2.c for Linux
|
To be included by aaip_0_2.c for Linux
|
||||||
|
|
||||||
Copyright (c) 2009 - 2022 Thomas Schmitt
|
Copyright (c) 2009 - 2018 Thomas Schmitt
|
||||||
|
|
||||||
This file is part of the libisofs project; you can redistribute it and/or
|
This file is part of the libisofs project; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License version 2
|
modify it under the terms of the GNU General Public License version 2
|
||||||
@ -77,44 +77,6 @@ int aaip_local_attr_support(int flag)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* -------------------------- Error reporting ----------------------------- */
|
|
||||||
|
|
||||||
|
|
||||||
/* Report an error with local ACL or xattr calls.
|
|
||||||
@param flag bit0-7: mode 0=NO_GET_LOCAL , 1=NO_SET_LOCAL
|
|
||||||
*/
|
|
||||||
static
|
|
||||||
void aaip_local_error(char *function_name, char *path, int err, int flag)
|
|
||||||
{
|
|
||||||
int mode, err_code;
|
|
||||||
|
|
||||||
mode= (flag & 255);
|
|
||||||
if(mode == 1)
|
|
||||||
err_code= ISO_AAIP_NO_SET_LOCAL_S;
|
|
||||||
else
|
|
||||||
err_code= ISO_AAIP_NO_GET_LOCAL_S;
|
|
||||||
if(err > 0) {
|
|
||||||
if(path[0])
|
|
||||||
iso_msg_submit(-1, err_code, 0,
|
|
||||||
"Function %s(\"%s\") failed with errno %d '%s'",
|
|
||||||
function_name, path, err, strerror(err));
|
|
||||||
else
|
|
||||||
iso_msg_submit(-1, err_code, 0, "Function %s() failed with %d '%s'",
|
|
||||||
function_name, err, strerror(err));
|
|
||||||
} else {
|
|
||||||
if(path[0])
|
|
||||||
iso_msg_submit(-1, err_code, 0,
|
|
||||||
"Function %s(\"%s\") failed without error code",
|
|
||||||
function_name, path);
|
|
||||||
else
|
|
||||||
iso_msg_submit(-1, err_code, 0,
|
|
||||||
"Function %s() failed without error code",
|
|
||||||
function_name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ------------------------------ Getters --------------------------------- */
|
/* ------------------------------ Getters --------------------------------- */
|
||||||
|
|
||||||
/* Obtain the ACL of the given file in long text form.
|
/* Obtain the ACL of the given file in long text form.
|
||||||
@ -219,10 +181,8 @@ static int get_single_attr(char *path, char *name, size_t *value_length,
|
|||||||
value_ret= getxattr(path, name, NULL, 0);
|
value_ret= getxattr(path, name, NULL, 0);
|
||||||
else
|
else
|
||||||
value_ret= lgetxattr(path, name, NULL, 0);
|
value_ret= lgetxattr(path, name, NULL, 0);
|
||||||
if(value_ret == -1) {
|
if(value_ret == -1)
|
||||||
aaip_local_error((flag & 32) ? "getxattr" : "lgetxattr", path, errno, 0);
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
|
||||||
*value_bytes= calloc(value_ret + 1, 1);
|
*value_bytes= calloc(value_ret + 1, 1);
|
||||||
if(*value_bytes == NULL)
|
if(*value_bytes == NULL)
|
||||||
return(-1);
|
return(-1);
|
||||||
@ -231,7 +191,6 @@ static int get_single_attr(char *path, char *name, size_t *value_length,
|
|||||||
else
|
else
|
||||||
value_ret= lgetxattr(path, name, *value_bytes, value_ret);
|
value_ret= lgetxattr(path, name, *value_bytes, value_ret);
|
||||||
if(value_ret == -1) {
|
if(value_ret == -1) {
|
||||||
aaip_local_error((flag & 32) ? "getxattr" : "lgetxattr", path, errno, 0);
|
|
||||||
free(*value_bytes);
|
free(*value_bytes);
|
||||||
*value_bytes= NULL;
|
*value_bytes= NULL;
|
||||||
*value_length= 0;
|
*value_length= 0;
|
||||||
@ -316,13 +275,10 @@ ex:;
|
|||||||
else
|
else
|
||||||
list_size= llistxattr(path, list, 0);
|
list_size= llistxattr(path, list, 0);
|
||||||
if(list_size == -1) {
|
if(list_size == -1) {
|
||||||
if(errno == ENOSYS) { /* Function not implemented */
|
if(errno == ENOSYS) /* Function not implemented */
|
||||||
list_size= 0; /* Handle as if xattr was disabled at compile time */
|
list_size= 0; /* Handle as if xattr was disabled at compile time */
|
||||||
} else {
|
else
|
||||||
aaip_local_error((flag & 32) ? "listxattr" : "llistxattr", path, errno,
|
|
||||||
0);
|
|
||||||
{ret= -1; goto ex;}
|
{ret= -1; goto ex;}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if(list_size > 0) {
|
if(list_size > 0) {
|
||||||
list= calloc(list_size, 1);
|
list= calloc(list_size, 1);
|
||||||
@ -332,11 +288,8 @@ ex:;
|
|||||||
list_size= listxattr(path, list, list_size);
|
list_size= listxattr(path, list, list_size);
|
||||||
else
|
else
|
||||||
list_size= llistxattr(path, list, list_size);
|
list_size= llistxattr(path, list, list_size);
|
||||||
if(list_size == -1) {
|
if(list_size == -1)
|
||||||
aaip_local_error((flag & 32) ? "listxattr" : "llistxattr", path, errno,
|
|
||||||
0);
|
|
||||||
{ret= -1; goto ex;}
|
{ret= -1; goto ex;}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
for(i= 0; i < list_size; i+= strlen(list + i) + 1)
|
for(i= 0; i < list_size; i+= strlen(list + i) + 1)
|
||||||
num_names++;
|
num_names++;
|
||||||
@ -490,14 +443,11 @@ int aaip_set_acl_text(char *path, char *text, int flag)
|
|||||||
|
|
||||||
acl= acl_from_text(text);
|
acl= acl_from_text(text);
|
||||||
if(acl == NULL) {
|
if(acl == NULL) {
|
||||||
aaip_local_error("acl_from_text", "", errno, 1);
|
|
||||||
ret= -1; goto ex;
|
ret= -1; goto ex;
|
||||||
}
|
}
|
||||||
ret= acl_set_file(path, (flag & 1) ? ACL_TYPE_DEFAULT : ACL_TYPE_ACCESS, acl);
|
ret= acl_set_file(path, (flag & 1) ? ACL_TYPE_DEFAULT : ACL_TYPE_ACCESS, acl);
|
||||||
if(ret == -1) {
|
if(ret == -1)
|
||||||
aaip_local_error("acl_set_file", path, errno, 1);
|
|
||||||
goto ex;
|
goto ex;
|
||||||
}
|
|
||||||
ret= 1;
|
ret= 1;
|
||||||
ex:
|
ex:
|
||||||
if(acl != NULL)
|
if(acl != NULL)
|
||||||
@ -583,11 +533,8 @@ int aaip_set_attr_list(char *path, size_t num_attrs, char **names,
|
|||||||
list_size= listxattr(path, list, list_size);
|
list_size= listxattr(path, list, list_size);
|
||||||
else
|
else
|
||||||
list_size= llistxattr(path, list, list_size);
|
list_size= llistxattr(path, list, list_size);
|
||||||
if(list_size == -1) {
|
if(list_size == -1)
|
||||||
aaip_local_error((flag & 32) ? "listxattr" : "llistxattr", path, errno,
|
|
||||||
1);
|
|
||||||
{ret= -5; goto ex;}
|
{ret= -5; goto ex;}
|
||||||
}
|
|
||||||
for(i= 0; i < (size_t) list_size; i+= strlen(list + i) + 1) {
|
for(i= 0; i < (size_t) list_size; i+= strlen(list + i) + 1) {
|
||||||
if(!(flag & 8))
|
if(!(flag & 8))
|
||||||
if(strncmp(list + i, "user.", 5))
|
if(strncmp(list + i, "user.", 5))
|
||||||
@ -596,11 +543,8 @@ int aaip_set_attr_list(char *path, size_t num_attrs, char **names,
|
|||||||
ret= removexattr(path, list + i);
|
ret= removexattr(path, list + i);
|
||||||
else
|
else
|
||||||
ret= lremovexattr(path, list + i);
|
ret= lremovexattr(path, list + i);
|
||||||
if(ret == -1) {
|
if(ret == -1)
|
||||||
aaip_local_error((flag & 32) ? "removexattr" : "lremovexattr", path,
|
|
||||||
errno, 1);
|
|
||||||
{ret= -5; goto ex;}
|
{ret= -5; goto ex;}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
free(list); list= NULL;
|
free(list); list= NULL;
|
||||||
}
|
}
|
||||||
@ -643,8 +587,6 @@ int aaip_set_attr_list(char *path, size_t num_attrs, char **names,
|
|||||||
else
|
else
|
||||||
ret= lsetxattr(path, names[i], values[i], value_lengths[i], 0);
|
ret= lsetxattr(path, names[i], values[i], value_lengths[i], 0);
|
||||||
if(ret == -1) {
|
if(ret == -1) {
|
||||||
aaip_local_error((flag & 32) ? "setxattr" : "lsetxattr", path, errno,
|
|
||||||
1);
|
|
||||||
register_errno(errnos, i);
|
register_errno(errnos, i);
|
||||||
end_ret= -4;
|
end_ret= -4;
|
||||||
continue;
|
continue;
|
||||||
|
@ -743,12 +743,26 @@ configure.ac
|
|||||||
libisofs/libisofs.h
|
libisofs/libisofs.h
|
||||||
Version leap to 1.5.4.
|
Version leap to 1.5.4.
|
||||||
|
|
||||||
30 Jan 2021 [2d1fec2]
|
30 Jan 2021 []
|
||||||
ChangeLog
|
ChangeLog
|
||||||
libisofs/changelog.txt
|
libisofs/changelog.txt
|
||||||
Updated change log
|
Updated change log
|
||||||
|
|
||||||
------------------------------------ release - libisofs-1.5.4 - 30 Jan 2021
|
07 Feb 2021 [release-1.5.4.branch: 408eb3f]
|
||||||
|
libisofs/rockridge.c
|
||||||
|
Bug fix: Large amounts of AAIP data or many long file names could cause with
|
||||||
|
zisofs an unreadable filesystem after the warning "Calculated and written
|
||||||
|
ECMA-119 tree end differ"
|
||||||
|
|
||||||
|
07 Feb 2021 [release-1.5.4.branch: ]
|
||||||
|
ChangeLog
|
||||||
|
libisofs/changelog.txt
|
||||||
|
Updated change log
|
||||||
|
|
||||||
|
------------------------------------ release - libisofs-1.5.4 - 07 Feb 2021
|
||||||
|
* Bug fix: Large amounts of AAIP data or many long file names could cause with
|
||||||
|
zisofs an unreadable filesystem after the warning "Calculated and
|
||||||
|
written ECMA-119 tree end differ"
|
||||||
* Bug fix: Big-Endian MIPS Volume Header boot file size was rounded up to
|
* Bug fix: Big-Endian MIPS Volume Header boot file size was rounded up to
|
||||||
full 2048. Thanks René Rebe.
|
full 2048. Thanks René Rebe.
|
||||||
* Bug fix: El Torito production failed if no catalog path is given and the
|
* Bug fix: El Torito production failed if no catalog path is given and the
|
||||||
@ -767,237 +781,6 @@ Updated change log
|
|||||||
* New API calls iso_read_image_features_tree_loaded() and
|
* New API calls iso_read_image_features_tree_loaded() and
|
||||||
iso_read_image_features_rr_loaded()
|
iso_read_image_features_rr_loaded()
|
||||||
|
|
||||||
30 Jan 2021 [5add62b]
|
|
||||||
configure.ac
|
|
||||||
libisofs/libisofs.h
|
|
||||||
Version leap to 1.5.5
|
|
||||||
|
|
||||||
01 Feb 2021 [058f18d]
|
|
||||||
libisofs/rockridge.c
|
|
||||||
Bug fix: Large amounts of AAIP data or many long file names could cause with
|
|
||||||
zisofs an unreadable filesystem after the warning "Calculated and written
|
|
||||||
ECMA-119 tree end differ"
|
|
||||||
|
|
||||||
03 Feb 2021 [98aea0c]
|
|
||||||
libisofs/rockridge.c
|
|
||||||
Heuristic fix for a new problem introduced by commit 058f18d
|
|
||||||
|
|
||||||
07 Feb 2021 [release-1.5.4.branch: 408eb3f]
|
|
||||||
libisofs/rockridge.c
|
|
||||||
Bug fix: Large amounts of AAIP data or many long file names could cause with
|
|
||||||
zisofs an unreadable filesystem after the warning "Calculated and written
|
|
||||||
ECMA-119 tree end differ"
|
|
||||||
|
|
||||||
07 Feb 2021 [release-1.5.4.branch: a7a9c29]
|
|
||||||
ChangeLog
|
|
||||||
libisofs/changelog.txt
|
|
||||||
Updated change log
|
|
||||||
|
|
||||||
------------------------------------ release - libisofs-1.5.4 - 07 Feb 2021
|
|
||||||
* Bug fix: Large amounts of AAIP data or many long file names could cause with
|
|
||||||
zisofs an unreadable filesystem after the warning "Calculated and
|
|
||||||
written ECMA-119 tree end differ"
|
|
||||||
|
|
||||||
28 Feb 2021 [7d248c4]
|
|
||||||
libisofs/fs_image.c
|
|
||||||
Ignore mad MBR partitions which extend outside of medium size
|
|
||||||
|
|
||||||
28 Feb 2021 [9e38918]
|
|
||||||
libisofs/rockridge.c
|
|
||||||
Leave prediction of first CE gap to susp_*_to_ce() functions
|
|
||||||
|
|
||||||
12 Mar 2021 [75499bc]
|
|
||||||
libisofs/filters/zisofs.c
|
|
||||||
Silenced a warning on 32 bit about value ISO_ZISOFS_V1_LIMIT too large for int
|
|
||||||
|
|
||||||
25 May 2021 [1c4c04d]
|
|
||||||
libisofs/libisofs.h
|
|
||||||
libisofs/ecma119.c
|
|
||||||
libisofs/system_area.c
|
|
||||||
New iso_write_opts_set_system_area() option bits 16: GPT "Legacy BIOS bootable"
|
|
||||||
and 17: GPT writable
|
|
||||||
|
|
||||||
02 Sep 2021 [80a0691]
|
|
||||||
configure.ac
|
|
||||||
Removed unneeded configure.ac macro AC_C_BIGENDIAN
|
|
||||||
|
|
||||||
28 Oct 2021 [3e61a61]
|
|
||||||
README
|
|
||||||
Updated URLs, build instructions, and copyright in README file
|
|
||||||
|
|
||||||
22 Apr 2022 [da8e3e6]
|
|
||||||
libisofs/fs_image.c
|
|
||||||
Exempted MBR partitions of type 0xEE from being ignored due to wrong size
|
|
||||||
|
|
||||||
23 Apr 2022 [99251ad]
|
|
||||||
libisofs/system_area.c
|
|
||||||
Avoid to overwrite the loaded MBR partition table just because partition offset is 16
|
|
||||||
|
|
||||||
23 Apr 2022 [1d61b51]
|
|
||||||
libisofs/system_area.c
|
|
||||||
libisofs/make_isohybrid_mbr.c
|
|
||||||
Bug fix: iso_write_opts_set_part_like_isohybrid() did not cause a MBR partition
|
|
||||||
table if the partitions are data files in the ISO rather than appended
|
|
||||||
|
|
||||||
23 Apr 2022 [da00291]
|
|
||||||
libisofs/make_isohybrid_mbr.c
|
|
||||||
Let the original isohybrid GPT obey system_area() option bit 17: GPT writable
|
|
||||||
|
|
||||||
26 Apr 2022 [2af1749]
|
|
||||||
libisofs/fs_local.c
|
|
||||||
libisofs/fs_image.c
|
|
||||||
Bug fix: The lseek methods of IsoFileSource for local filesystem and loaded
|
|
||||||
ISO returned libisofs error codes as positive off_t numbers
|
|
||||||
|
|
||||||
26 Apr 2022 [f457a4f]
|
|
||||||
libisofs/stream.c
|
|
||||||
Added missing stream type names to a diagnostic function
|
|
||||||
|
|
||||||
26 Apr 2022 [011e2e8]
|
|
||||||
libisofs/libisofs.h
|
|
||||||
libisofs/tree.c
|
|
||||||
libisofs/stream.c
|
|
||||||
libisofs/fsource.h
|
|
||||||
libisofs/fsource.c
|
|
||||||
Allowed lseekable device files with iso_tree_add_new_cut_out_node(). Proof-of-concept by Ivan Shmakov.
|
|
||||||
|
|
||||||
13 May 2022 [ad55ec7]
|
|
||||||
libisofs/system_area.c
|
|
||||||
libisofs/make_isohybrid_mbr.c
|
|
||||||
Avoided automatic MBR partition type 0x00 with
|
|
||||||
iso_write_opts_set_part_like_isohybrid() if partitions do not overlap
|
|
||||||
|
|
||||||
30 May 2022 [c6cb7df]
|
|
||||||
libisofs/tree.c
|
|
||||||
libisofs/stream.c
|
|
||||||
libisofs/fsource.h
|
|
||||||
libisofs/fsource.c
|
|
||||||
Widened the lseek capacity determination to SEEK_SET with wanted size
|
|
||||||
|
|
||||||
20 Sep 2022 [9b7ccc9]
|
|
||||||
libisofs/libisofs.h
|
|
||||||
libisofs/aaip-os-linux.c
|
|
||||||
Improved error messages in case of failing Linux-specific ACL or xattr functions
|
|
||||||
|
|
||||||
20 Sep 2022 [83e5832]
|
|
||||||
libisofs/libisofs.h
|
|
||||||
libisofs/libisofs.ver
|
|
||||||
libisofs/image.h
|
|
||||||
libisofs/image.c
|
|
||||||
libisofs/fs_image.c
|
|
||||||
libisofs/tree.c
|
|
||||||
libisofs/messages.c
|
|
||||||
libisofs/util.h
|
|
||||||
libisofs/util.c
|
|
||||||
New API calls iso_assess_written_features(), iso_read_image_feature_named(),
|
|
||||||
iso_read_image_features_text()
|
|
||||||
|
|
||||||
07 Oct 2022 [71772ba]
|
|
||||||
libisofs/fs_image.c
|
|
||||||
Fixed assessment of omit_version_numbers and no_force_dots
|
|
||||||
|
|
||||||
27 Oct 2022 [acb4bd1]
|
|
||||||
libisofs/tree.c
|
|
||||||
Bug fix: Freshly cloned data files from imported image were not marked as
|
|
||||||
imported
|
|
||||||
|
|
||||||
13 Dec 2022 [d35435b]
|
|
||||||
libisofs/rockridge.c
|
|
||||||
Bug fix: Size of further CE area was calculated wrong if its CE entry ended
|
|
||||||
exactly at a block boundary
|
|
||||||
|
|
||||||
11 Jan 2023 [7109ba5]
|
|
||||||
libisofs/rockridge_read.c
|
|
||||||
Prevented endless CE loops when reading a very bad ISO fileystem
|
|
||||||
|
|
||||||
22 Jan 2023 [bd41540]
|
|
||||||
libisofs/libisofs.h
|
|
||||||
libisofs/node.h
|
|
||||||
libisofs/node.c
|
|
||||||
libisofs/ecma119.h
|
|
||||||
libisofs/ecma119.c
|
|
||||||
libisofs/rockridge.h
|
|
||||||
libisofs/rockridge.c
|
|
||||||
libisofs/messages.c
|
|
||||||
libisofs/libisofs.ver
|
|
||||||
New API call iso_write_opts_set_max_ce_entries()
|
|
||||||
|
|
||||||
14 Apr 2023 [cdc7f52]
|
|
||||||
libisofs/ecma119.h
|
|
||||||
libisofs/ecma119.c
|
|
||||||
libisofs/joliet.c
|
|
||||||
Reduced number of warnings about special files or symlinks in Joliet
|
|
||||||
|
|
||||||
07 Jun 2023 [c2d17b1]
|
|
||||||
configure.ac
|
|
||||||
libisofs/libisofs.h
|
|
||||||
Version leap to 1.5.6
|
|
||||||
|
|
||||||
07 Jun 2023 [170318c]
|
|
||||||
ChangeLog
|
|
||||||
libisofs/changelog.txt
|
|
||||||
Updated change log
|
|
||||||
|
|
||||||
------------------------------------ release - libisofs-1.5.6 - 07 Jun 2023
|
|
||||||
* New iso_write_opts_set_system_area() option bits 16:
|
|
||||||
GPT "Legacy BIOS bootable" and 17: GPT writable
|
|
||||||
* New API calls iso_assess_written_features(), iso_read_image_feature_named(),
|
|
||||||
iso_read_image_features_text()
|
|
||||||
* Allowed lseekable device files with iso_tree_add_new_cut_out_node().
|
|
||||||
Proof-of-concept by Ivan Shmakov.
|
|
||||||
* New API call iso_write_opts_set_max_ce_entries()
|
|
||||||
* Bug fix: iso_write_opts_set_part_like_isohybrid() did not cause a MBR
|
|
||||||
partition table if the partitions are data files in the ISO
|
|
||||||
rather than appended
|
|
||||||
* Bug fix: The lseek methods of IsoFileSource for local filesystem and loaded
|
|
||||||
ISO returned libisofs error codes as positive off_t numbers
|
|
||||||
* Bug fix: Freshly cloned data files from imported image were not marked as
|
|
||||||
imported. Thanks to Ivan Shmakov. (Closes: #1022851)
|
|
||||||
* Bug fix: Size of further CE area was calculated wrong if its CE entry ended
|
|
||||||
exactly at a block boundary
|
|
||||||
|
|
||||||
|
|
||||||
12 Jun 2023 [branch-1.5.6.pl01: ]
|
|
||||||
libisofs/rockridge.h
|
|
||||||
ChangeLog
|
|
||||||
libisofs/changelog.txt
|
|
||||||
Bug fix: On non-GNU/Linux systems ssize_t was not defined in rockridge.h .
|
|
||||||
Report and fix proposal by Rui Chen.
|
|
||||||
|
|
||||||
------------------------------- release - libisofs-1.5.6.pl01 - 12 Jun 2023
|
|
||||||
* Bug fix: On non-GNU/Linux systems ssize_t was not defined in rockridge.h .
|
|
||||||
Report and fix proposal by Rui Chen.
|
|
||||||
|
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
|
||||||
Todo about iso_read_image_feature_named() :
|
|
||||||
Declared but not yet filled:
|
|
||||||
{"hfsplus", 0, 0, 0, NULL},
|
|
||||||
{"fat", 0, 0, 0, NULL},
|
|
||||||
{"hfsp_serial_number", 0, 1, 0, NULL},
|
|
||||||
{"hfsp_block_size", 0, 0, 0, NULL},
|
|
||||||
{"hardlinks", 0, 0, 0, NULL},
|
|
||||||
{"rr_reloc_dir", 0, 1, 0, NULL},
|
|
||||||
{"rr_reloc_flags", 0, 0, 0, NULL, 0},
|
|
||||||
{"allow_7bit_ascii", 0, 0, 0, NULL}, ??? How to recognize this ?
|
|
||||||
{"scdbackup_tag_name", 0, 1, 0, NULL},
|
|
||||||
{"scdbackup_tag_time", 0, 1, 0, NULL},
|
|
||||||
{"always_gmt", 0, 0, 0, NULL},
|
|
||||||
IsoWriteOpts properties not yet covered by above list:
|
|
||||||
??? dir_rec_mtime
|
|
||||||
??? sort_files
|
|
||||||
??? output_charset
|
|
||||||
??? appendable
|
|
||||||
??? ms_block
|
|
||||||
??? data_start_lba
|
|
||||||
??? tail_blocks
|
|
||||||
??? vol_*_time
|
|
||||||
??? vol_uuid
|
|
||||||
??? system_area_data
|
|
||||||
??? system_area_size
|
|
||||||
??? system_area_options
|
|
||||||
??? partition_offset
|
|
||||||
??? partition_secs_per_head , partition_heads_per_cyl
|
|
||||||
??? Other properties of partitions and boot equipment
|
|
||||||
|
|
||||||
|
------------------------------------ release - libisofs- -
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Vreixo Formoso
|
* Copyright (c) 2007 Vreixo Formoso
|
||||||
* Copyright (c) 2007 Mario Danic
|
* Copyright (c) 2007 Mario Danic
|
||||||
* Copyright (c) 2009 - 2023 Thomas Schmitt
|
* Copyright (c) 2009 - 2019 Thomas Schmitt
|
||||||
*
|
*
|
||||||
* This file is part of the libisofs project; you can redistribute it and/or
|
* This file is part of the libisofs project; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License version 2
|
* modify it under the terms of the GNU General Public License version 2
|
||||||
@ -205,24 +205,17 @@ size_t calc_dirent_len(Ecma119Image *t, Ecma119Node *n)
|
|||||||
* taking into account the continuation areas.
|
* taking into account the continuation areas.
|
||||||
*/
|
*/
|
||||||
static
|
static
|
||||||
ssize_t calc_dir_size(Ecma119Image *t, Ecma119Node *dir, size_t *ce)
|
size_t calc_dir_size(Ecma119Image *t, Ecma119Node *dir, size_t *ce)
|
||||||
{
|
{
|
||||||
size_t i, len;
|
size_t i, len;
|
||||||
ssize_t ret;
|
|
||||||
size_t ce_len = 0;
|
size_t ce_len = 0;
|
||||||
|
|
||||||
/* size of "." and ".." entries */
|
/* size of "." and ".." entries */
|
||||||
len = 34 + 34;
|
len = 34 + 34;
|
||||||
if (t->opts->rockridge) {
|
if (t->opts->rockridge) {
|
||||||
ret = rrip_calc_len(t, dir, 1, 34, &ce_len, *ce);
|
len += rrip_calc_len(t, dir, 1, 34, &ce_len, *ce);
|
||||||
if (ret < 0)
|
|
||||||
return ret;
|
|
||||||
len += ret;
|
|
||||||
*ce += ce_len;
|
*ce += ce_len;
|
||||||
ret = rrip_calc_len(t, dir, 2, 34, &ce_len, *ce);
|
len += rrip_calc_len(t, dir, 2, 34, &ce_len, *ce);
|
||||||
if (ret < 0)
|
|
||||||
return ret;
|
|
||||||
len += ret;
|
|
||||||
*ce += ce_len;
|
*ce += ce_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,10 +228,8 @@ ssize_t calc_dir_size(Ecma119Image *t, Ecma119Node *dir, size_t *ce)
|
|||||||
for (section = 0; section < nsections; ++section) {
|
for (section = 0; section < nsections; ++section) {
|
||||||
size_t dirent_len = calc_dirent_len(t, child);
|
size_t dirent_len = calc_dirent_len(t, child);
|
||||||
if (t->opts->rockridge) {
|
if (t->opts->rockridge) {
|
||||||
ret = rrip_calc_len(t, child, 0, dirent_len, &ce_len, *ce);
|
dirent_len += rrip_calc_len(t, child, 0, dirent_len, &ce_len,
|
||||||
if (ret < 0)
|
*ce);
|
||||||
return ret;
|
|
||||||
dirent_len += ret;
|
|
||||||
*ce += ce_len;
|
*ce += ce_len;
|
||||||
}
|
}
|
||||||
remaining = BLOCK_SIZE - (len % BLOCK_SIZE);
|
remaining = BLOCK_SIZE - (len % BLOCK_SIZE);
|
||||||
@ -264,18 +255,14 @@ ssize_t calc_dir_size(Ecma119Image *t, Ecma119Node *dir, size_t *ce)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int calc_dir_pos(Ecma119Image *t, Ecma119Node *dir)
|
void calc_dir_pos(Ecma119Image *t, Ecma119Node *dir)
|
||||||
{
|
{
|
||||||
size_t i, len;
|
size_t i, len;
|
||||||
ssize_t ret;
|
|
||||||
size_t ce_len = 0;
|
size_t ce_len = 0;
|
||||||
|
|
||||||
t->ndirs++;
|
t->ndirs++;
|
||||||
dir->info.dir->block = t->curblock;
|
dir->info.dir->block = t->curblock;
|
||||||
ret = calc_dir_size(t, dir, &ce_len);
|
len = calc_dir_size(t, dir, &ce_len);
|
||||||
if (ret < 0)
|
|
||||||
return (int) ret;
|
|
||||||
len = ret;
|
|
||||||
t->curblock += DIV_UP(len, BLOCK_SIZE);
|
t->curblock += DIV_UP(len, BLOCK_SIZE);
|
||||||
if (t->opts->rockridge) {
|
if (t->opts->rockridge) {
|
||||||
t->curblock += DIV_UP(ce_len, BLOCK_SIZE);
|
t->curblock += DIV_UP(ce_len, BLOCK_SIZE);
|
||||||
@ -283,12 +270,9 @@ int calc_dir_pos(Ecma119Image *t, Ecma119Node *dir)
|
|||||||
for (i = 0; i < dir->info.dir->nchildren; i++) {
|
for (i = 0; i < dir->info.dir->nchildren; i++) {
|
||||||
Ecma119Node *child = dir->info.dir->children[i];
|
Ecma119Node *child = dir->info.dir->children[i];
|
||||||
if (child->type == ECMA119_DIR) {
|
if (child->type == ECMA119_DIR) {
|
||||||
ret = calc_dir_pos(t, child);
|
calc_dir_pos(t, child);
|
||||||
if (ret < 0)
|
|
||||||
return (int) ret;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ISO_SUCCESS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -321,7 +305,6 @@ int ecma119_writer_compute_data_blocks(IsoImageWriter *writer)
|
|||||||
Ecma119Image *target;
|
Ecma119Image *target;
|
||||||
uint32_t path_table_size;
|
uint32_t path_table_size;
|
||||||
size_t ndirs;
|
size_t ndirs;
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (writer == NULL) {
|
if (writer == NULL) {
|
||||||
return ISO_ASSERT_FAILURE;
|
return ISO_ASSERT_FAILURE;
|
||||||
@ -332,9 +315,7 @@ int ecma119_writer_compute_data_blocks(IsoImageWriter *writer)
|
|||||||
/* compute position of directories */
|
/* compute position of directories */
|
||||||
iso_msg_debug(target->image->id, "Computing position of dir structure");
|
iso_msg_debug(target->image->id, "Computing position of dir structure");
|
||||||
target->ndirs = 0;
|
target->ndirs = 0;
|
||||||
ret = calc_dir_pos(target, target->root);
|
calc_dir_pos(target, target->root);
|
||||||
if (ret < 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
/* compute length of pathlist */
|
/* compute length of pathlist */
|
||||||
iso_msg_debug(target->image->id, "Computing length of pathlist");
|
iso_msg_debug(target->image->id, "Computing length of pathlist");
|
||||||
@ -357,9 +338,7 @@ int ecma119_writer_compute_data_blocks(IsoImageWriter *writer)
|
|||||||
/* Take into respect the second directory tree */
|
/* Take into respect the second directory tree */
|
||||||
ndirs = target->ndirs;
|
ndirs = target->ndirs;
|
||||||
target->ndirs = 0;
|
target->ndirs = 0;
|
||||||
ret = calc_dir_pos(target, target->partition_root);
|
calc_dir_pos(target, target->partition_root);
|
||||||
if (ret < 0)
|
|
||||||
return ret;
|
|
||||||
if (target->ndirs != ndirs) {
|
if (target->ndirs != ndirs) {
|
||||||
iso_msg_submit(target->image->id, ISO_ASSERT_FAILURE, 0,
|
iso_msg_submit(target->image->id, ISO_ASSERT_FAILURE, 0,
|
||||||
"Number of directories differs in ECMA-119 partiton_tree");
|
"Number of directories differs in ECMA-119 partiton_tree");
|
||||||
@ -2758,11 +2737,7 @@ int ecma119_image_new(IsoImage *src, IsoWriteOpts *in_opts, Ecma119Image **img)
|
|||||||
target->filesrc_start = 0;
|
target->filesrc_start = 0;
|
||||||
target->filesrc_blocks = 0;
|
target->filesrc_blocks = 0;
|
||||||
|
|
||||||
target->curr_ce_entries = 0;
|
|
||||||
|
|
||||||
target->joliet_ucs2_failures = 0;
|
target->joliet_ucs2_failures = 0;
|
||||||
target->joliet_symlinks = 0;
|
|
||||||
target->joliet_specials = 0;
|
|
||||||
|
|
||||||
/* If partitions get appended, then the backup GPT cannot be part of
|
/* If partitions get appended, then the backup GPT cannot be part of
|
||||||
the ISO filesystem.
|
the ISO filesystem.
|
||||||
@ -3292,16 +3267,6 @@ int ecma119_image_new(IsoImage *src, IsoWriteOpts *in_opts, Ecma119Image **img)
|
|||||||
* even modified by the read thread (look inside bs_* functions)
|
* even modified by the read thread (look inside bs_* functions)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (target->joliet_symlinks > 0) {
|
|
||||||
iso_msg_submit(target->image->id, ISO_FILE_IGNORED, 0,
|
|
||||||
"Number of symbolic links omitted from Joliet tree: %lu",
|
|
||||||
target->joliet_symlinks);
|
|
||||||
}
|
|
||||||
if (target->joliet_specials > 0) {
|
|
||||||
iso_msg_submit(target->image->id, ISO_FILE_IGNORED, 0,
|
|
||||||
"Number of special files omitted from Joliet tree: %lu",
|
|
||||||
target->joliet_specials);
|
|
||||||
}
|
|
||||||
*img = target;
|
*img = target;
|
||||||
return ISO_SUCCESS;
|
return ISO_SUCCESS;
|
||||||
|
|
||||||
@ -3646,8 +3611,6 @@ int iso_write_opts_new(IsoWriteOpts **opts, int profile)
|
|||||||
wopts->hfsp_block_size = 0;
|
wopts->hfsp_block_size = 0;
|
||||||
memset(wopts->gpt_disk_guid, 0, 16);
|
memset(wopts->gpt_disk_guid, 0, 16);
|
||||||
wopts->gpt_disk_guid_mode = 0;
|
wopts->gpt_disk_guid_mode = 0;
|
||||||
wopts->max_ce_entries = 31; /* Linux hates >= RR_MAX_CE_ENTRIES = 32 */
|
|
||||||
wopts->max_ce_drop_attr = 2; /* If needed drop non-isofs fattr and ACL */
|
|
||||||
|
|
||||||
*opts = wopts;
|
*opts = wopts;
|
||||||
return ISO_SUCCESS;
|
return ISO_SUCCESS;
|
||||||
@ -4244,7 +4207,7 @@ int iso_write_opts_set_system_area(IsoWriteOpts *opts, char data[32768],
|
|||||||
opts->system_area_size = 32768;
|
opts->system_area_size = 32768;
|
||||||
}
|
}
|
||||||
if (!(flag & 4))
|
if (!(flag & 4))
|
||||||
opts->system_area_options = options & 0x3ffff;
|
opts->system_area_options = options & 0xffff;
|
||||||
return ISO_SUCCESS;
|
return ISO_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4440,17 +4403,6 @@ int iso_write_opts_set_gpt_guid(IsoWriteOpts *opts, uint8_t guid[16], int mode)
|
|||||||
return ISO_SUCCESS;
|
return ISO_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int iso_write_opts_set_max_ce_entries(IsoWriteOpts *opts, uint32_t num,
|
|
||||||
int flag)
|
|
||||||
{
|
|
||||||
if (num > 100000)
|
|
||||||
return ISO_TOO_MANY_CE;
|
|
||||||
if (num == 0)
|
|
||||||
num = 1;
|
|
||||||
opts->max_ce_entries = num;
|
|
||||||
opts->max_ce_drop_attr = flag & 15;
|
|
||||||
return ISO_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @param flag
|
* @param flag
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Vreixo Formoso
|
* Copyright (c) 2007 Vreixo Formoso
|
||||||
* Copyright (c) 2009 - 2023 Thomas Schmitt
|
* Copyright (c) 2009 - 2019 Thomas Schmitt
|
||||||
*
|
*
|
||||||
* This file is part of the libisofs project; you can redistribute it and/or
|
* This file is part of the libisofs project; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License version 2
|
* modify it under the terms of the GNU General Public License version 2
|
||||||
@ -543,17 +543,6 @@ struct iso_write_opts {
|
|||||||
*/
|
*/
|
||||||
uint8_t gpt_disk_guid[16];
|
uint8_t gpt_disk_guid[16];
|
||||||
int gpt_disk_guid_mode;
|
int gpt_disk_guid_mode;
|
||||||
|
|
||||||
/* Maximum number of CE entries per file */
|
|
||||||
uint32_t max_ce_entries;
|
|
||||||
/* Whether to try dropping AAIP data on too many CE:
|
|
||||||
bit0-3 = Mode:
|
|
||||||
0 = throw ISO_TOO_MANY_CE, without trying to drop anything
|
|
||||||
1 = drop non-isofs fattr
|
|
||||||
2 = drop ACL if dropping non-isofs fattr does not suffice
|
|
||||||
*/
|
|
||||||
int max_ce_drop_attr;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct ecma119_image Ecma119Image;
|
typedef struct ecma119_image Ecma119Image;
|
||||||
@ -924,15 +913,6 @@ struct ecma119_image
|
|||||||
uint32_t filesrc_start;
|
uint32_t filesrc_start;
|
||||||
uint32_t filesrc_blocks;
|
uint32_t filesrc_blocks;
|
||||||
|
|
||||||
/* Number of CE entries in currently processed node */
|
|
||||||
uint32_t curr_ce_entries;
|
|
||||||
|
|
||||||
/* Count of symbolic links and special files which could not be represented
|
|
||||||
in Joliet.
|
|
||||||
*/
|
|
||||||
unsigned long joliet_symlinks;
|
|
||||||
unsigned long joliet_specials;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define BP(a,b) [(b) - (a) + 1]
|
#define BP(a,b) [(b) - (a) + 1]
|
||||||
|
@ -46,9 +46,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/* The lowest size of a file which shall not be represented by zisofs v1 */
|
/* The lowest size of a file which shall not be represented by zisofs v1 */
|
||||||
/* The constant 4294967296 causes protests about int size on 32 bit machines */
|
#define ISO_ZISOFS_V1_LIMIT 4294967296
|
||||||
#define ISO_ZISOFS_V1_LIMIT ((off_t) (1 << 16) * (off_t) (1 << 16))
|
|
||||||
|
|
||||||
|
|
||||||
/* zisofs2: Test value for small mixed-version ISOs: 1 million
|
/* zisofs2: Test value for small mixed-version ISOs: 1 million
|
||||||
ISO_ZISOFS_V1_LIMIT 1000000
|
ISO_ZISOFS_V1_LIMIT 1000000
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -337,7 +337,7 @@ off_t lfs_lseek(IsoFileSource *src, off_t offset, int flag)
|
|||||||
int whence;
|
int whence;
|
||||||
|
|
||||||
if (src == NULL) {
|
if (src == NULL) {
|
||||||
return (off_t)((int) ISO_NULL_POINTER);
|
return (off_t)ISO_NULL_POINTER;
|
||||||
}
|
}
|
||||||
switch (flag) {
|
switch (flag) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -347,7 +347,7 @@ off_t lfs_lseek(IsoFileSource *src, off_t offset, int flag)
|
|||||||
case 2:
|
case 2:
|
||||||
whence = SEEK_END; break;
|
whence = SEEK_END; break;
|
||||||
default:
|
default:
|
||||||
return (off_t)((int) ISO_WRONG_ARG_VALUE);
|
return (off_t)ISO_WRONG_ARG_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
data = src->data;
|
data = src->data;
|
||||||
@ -360,19 +360,19 @@ off_t lfs_lseek(IsoFileSource *src, off_t offset, int flag)
|
|||||||
/* error on read */
|
/* error on read */
|
||||||
switch (errno) {
|
switch (errno) {
|
||||||
case ESPIPE:
|
case ESPIPE:
|
||||||
ret = (off_t)((int) ISO_FILE_ERROR);
|
ret = (off_t)ISO_FILE_ERROR;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ret = (off_t)((int) ISO_ERROR);
|
ret = (off_t)ISO_ERROR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
case 2: /* directory */
|
case 2: /* directory */
|
||||||
return (off_t)((int) ISO_FILE_IS_DIR);
|
return (off_t)ISO_FILE_IS_DIR;
|
||||||
default:
|
default:
|
||||||
return (off_t)((int) ISO_FILE_NOT_OPENED);
|
return (off_t)ISO_FILE_NOT_OPENED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Vreixo Formoso
|
* Copyright (c) 2007 Vreixo Formoso
|
||||||
* Copyright (c) 2022 Thomas Schmitt
|
|
||||||
*
|
*
|
||||||
* This file is part of the libisofs project; you can redistribute it and/or
|
* This file is part of the libisofs project; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License version 2
|
* modify it under the terms of the GNU General Public License version 2
|
||||||
@ -134,104 +133,3 @@ int iso_file_source_get_aa_string(IsoFileSource *src,
|
|||||||
return src->class->get_aa_string(src, aa_string, flag);
|
return src->class->get_aa_string(src, aa_string, flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* @flag bit0= Open and close src
|
|
||||||
bit1= Try iso_file_source_lseek(, 0) (=SEEK_SET) with wanted_size
|
|
||||||
@return <0 iso_file_source_lseek failed , >= 0 readable capacity
|
|
||||||
*/
|
|
||||||
off_t iso_file_source_lseek_capacity(IsoFileSource *src, off_t wanted_size,
|
|
||||||
int flag)
|
|
||||||
{
|
|
||||||
int ret, opened = 0;
|
|
||||||
off_t end, old, reset;
|
|
||||||
struct stat info;
|
|
||||||
|
|
||||||
ret = iso_file_source_stat(src, &info);
|
|
||||||
if (ret < 0) {
|
|
||||||
end = -1;
|
|
||||||
goto ex;
|
|
||||||
}
|
|
||||||
if (S_ISDIR(info.st_mode) || S_ISLNK(info.st_mode) ||
|
|
||||||
S_ISFIFO(info.st_mode) || S_ISSOCK(info.st_mode)) {
|
|
||||||
/* open(2) on fifo can block and have side effects.
|
|
||||||
Active Unix sockets have not been tested but they make as few sense
|
|
||||||
as directories or symbolic links.
|
|
||||||
*/
|
|
||||||
end = -1;
|
|
||||||
goto ex;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (flag & 1) {
|
|
||||||
ret = iso_file_source_open(src);
|
|
||||||
if (ret < 0) {
|
|
||||||
end = -1;
|
|
||||||
goto ex;
|
|
||||||
}
|
|
||||||
opened = 1;
|
|
||||||
}
|
|
||||||
old = iso_file_source_lseek(src, 0, 1);
|
|
||||||
if (old < 0) {
|
|
||||||
end = -1;
|
|
||||||
goto ex;
|
|
||||||
}
|
|
||||||
if(flag & 2) {
|
|
||||||
end = iso_file_source_lseek(src, wanted_size, 0);
|
|
||||||
} else {
|
|
||||||
end = iso_file_source_lseek(src, 0, 2);
|
|
||||||
}
|
|
||||||
if (end < 0) {
|
|
||||||
end = -1;
|
|
||||||
goto ex;
|
|
||||||
}
|
|
||||||
reset = iso_file_source_lseek(src, old, 0);
|
|
||||||
if (reset != old) {
|
|
||||||
end = -1;
|
|
||||||
goto ex;
|
|
||||||
}
|
|
||||||
ex:;
|
|
||||||
if (opened) {
|
|
||||||
iso_file_source_close(src);
|
|
||||||
}
|
|
||||||
return end;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Determine whether src is random-access readable and return its capacity.
|
|
||||||
@flag bit0= For iso_file_source_lseek_capacity(): Open and close src
|
|
||||||
bit1= wanted_size is valid
|
|
||||||
*/
|
|
||||||
off_t iso_file_source_determine_capacity(IsoFileSource *src, off_t wanted_size,
|
|
||||||
int flag)
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
off_t src_size, src_seek_size= -1;
|
|
||||||
struct stat info;
|
|
||||||
|
|
||||||
ret = iso_file_source_stat(src, &info);
|
|
||||||
if (ret < 0) {
|
|
||||||
return (off_t) -1;
|
|
||||||
}
|
|
||||||
if (S_ISREG(info.st_mode)) {
|
|
||||||
return info.st_size;
|
|
||||||
}
|
|
||||||
src_size = iso_file_source_lseek_capacity(src, wanted_size, (flag & 1));
|
|
||||||
if (src_size > 0) {
|
|
||||||
return src_size;
|
|
||||||
}
|
|
||||||
if (!(flag & 2)) {
|
|
||||||
if (src_size == 0) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
src_seek_size= src_size;
|
|
||||||
|
|
||||||
src_size = iso_file_source_lseek_capacity(src, wanted_size,
|
|
||||||
2 | (flag & 1));
|
|
||||||
if (src_size >= 0) {
|
|
||||||
return src_size;
|
|
||||||
} else if (src_seek_size >= 0) {
|
|
||||||
return src_seek_size;
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Vreixo Formoso
|
* Copyright (c) 2007 Vreixo Formoso
|
||||||
* Copyright (c) 2009 - 2022 Thomas Schmitt
|
* Copyright (c) 2009 - 2016 Thomas Schmitt
|
||||||
*
|
*
|
||||||
* This file is part of the libisofs project; you can redistribute it and/or
|
* This file is part of the libisofs project; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License version 2
|
* modify it under the terms of the GNU General Public License version 2
|
||||||
@ -49,14 +49,4 @@ int iso_ifs_source_clone(IsoFileSource *old_source, IsoFileSource **new_source,
|
|||||||
int flag);
|
int flag);
|
||||||
|
|
||||||
|
|
||||||
off_t iso_file_source_lseek_capacity(IsoFileSource *src, off_t wanted_size,
|
|
||||||
int flag);
|
|
||||||
|
|
||||||
/* Determine whether src is random-access readable and return its capacity.
|
|
||||||
*/
|
|
||||||
off_t iso_file_source_determine_capacity(IsoFileSource *src, off_t wanted_size,
|
|
||||||
int flag);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /*LIBISO_FSOURCE_H_*/
|
#endif /*LIBISO_FSOURCE_H_*/
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Vreixo Formoso
|
* Copyright (c) 2007 Vreixo Formoso
|
||||||
* Copyright (c) 2009 - 2022 Thomas Schmitt
|
* Copyright (c) 2009 - 2015 Thomas Schmitt
|
||||||
*
|
*
|
||||||
* This file is part of the libisofs project; you can redistribute it and/or
|
* This file is part of the libisofs project; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License version 2
|
* modify it under the terms of the GNU General Public License version 2
|
||||||
@ -204,10 +204,6 @@ int iso_image_new(const char *name, IsoImage **image)
|
|||||||
img->collision_warnings = 0;
|
img->collision_warnings = 0;
|
||||||
img->imported_sa_info = NULL;
|
img->imported_sa_info = NULL;
|
||||||
img->blind_on_local_get_attrs = 0;
|
img->blind_on_local_get_attrs = 0;
|
||||||
img->do_deeper_tree_inspection = 0;
|
|
||||||
img->tree_loaded = 0;
|
|
||||||
img->rr_loaded = 0;
|
|
||||||
img->tree_compliance = NULL;
|
|
||||||
|
|
||||||
*image = img;
|
*image = img;
|
||||||
return ISO_SUCCESS;
|
return ISO_SUCCESS;
|
||||||
@ -275,8 +271,6 @@ void iso_image_unref(IsoImage *image)
|
|||||||
free(image->system_area_data);
|
free(image->system_area_data);
|
||||||
iso_image_free_checksums(image, 0);
|
iso_image_free_checksums(image, 0);
|
||||||
iso_imported_sa_unref(&(image->imported_sa_info), 0);
|
iso_imported_sa_unref(&(image->imported_sa_info), 0);
|
||||||
if (image->tree_compliance != NULL)
|
|
||||||
iso_write_opts_free(image->tree_compliance);
|
|
||||||
free(image);
|
free(image);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Vreixo Formoso
|
* Copyright (c) 2007 Vreixo Formoso
|
||||||
* Copyright (c) 2009 - 2022 Thomas Schmitt
|
* Copyright (c) 2009 - 2017 Thomas Schmitt
|
||||||
*
|
*
|
||||||
* This file is part of the libisofs project; you can redistribute it and/or
|
* This file is part of the libisofs project; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License version 2
|
* modify it under the terms of the GNU General Public License version 2
|
||||||
@ -252,13 +252,6 @@ struct Iso_Image
|
|||||||
*/
|
*/
|
||||||
int blind_on_local_get_attrs;
|
int blind_on_local_get_attrs;
|
||||||
|
|
||||||
/* Deeper tree inspection when reading an IsoImage assesses traces of the
|
|
||||||
used write options.
|
|
||||||
*/
|
|
||||||
int do_deeper_tree_inspection;
|
|
||||||
int tree_loaded; /* 0=ISO 9660/ECMA-119 1=Joliet 2=ISO 9660:1999 */
|
|
||||||
int rr_loaded; /* 0=plain ISO 9660/ECMA-119 1=Rock Ridge */
|
|
||||||
IsoWriteOpts *tree_compliance;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -450,9 +443,5 @@ int iso_imported_sa_new(struct iso_imported_sys_area **sa_info, int flag);
|
|||||||
|
|
||||||
int iso_imported_sa_unref(struct iso_imported_sys_area **sa_info, int flag);
|
int iso_imported_sa_unref(struct iso_imported_sys_area **sa_info, int flag);
|
||||||
|
|
||||||
void iso_image_assess_ecma119_name(IsoImage *image, struct stat *info,
|
|
||||||
char *path, char *name);
|
|
||||||
void iso_image_assess_joliet_name(IsoImage *image, struct stat *info,
|
|
||||||
char *path, char *name);
|
|
||||||
|
|
||||||
#endif /*LIBISO_IMAGE_H_*/
|
#endif /*LIBISO_IMAGE_H_*/
|
||||||
|
@ -301,36 +301,14 @@ int create_tree(Ecma119Image *t, IsoNode *iso, JolietNode **tree, int pathlen)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case LIBISO_SYMLINK:
|
case LIBISO_SYMLINK:
|
||||||
t->joliet_symlinks++;
|
|
||||||
if (t->joliet_symlinks == 1) {
|
|
||||||
char *ipath = iso_tree_get_node_path(iso);
|
|
||||||
/* This first ret might indicate the need to abort */
|
|
||||||
ret = iso_msg_submit(t->image->id, ISO_FILE_IGNORED, 0,
|
|
||||||
"Cannot add %s to Joliet tree. Symlinks can only be added to a "
|
|
||||||
"Rock Ridge tree.", ipath);
|
|
||||||
free(ipath);
|
|
||||||
} else {
|
|
||||||
if (t->joliet_symlinks == 2)
|
|
||||||
iso_msg_submit(t->image->id, ISO_FILE_IGNORED, 0,
|
|
||||||
"More symbolic links were omitted from Joliet tree.");
|
|
||||||
ret = 0;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case LIBISO_SPECIAL:
|
case LIBISO_SPECIAL:
|
||||||
t->joliet_specials++;
|
{
|
||||||
if (t->joliet_specials == 1) {
|
|
||||||
char *ipath = iso_tree_get_node_path(iso);
|
char *ipath = iso_tree_get_node_path(iso);
|
||||||
/* This first ret might indicate the need to abort */
|
|
||||||
ret = iso_msg_submit(t->image->id, ISO_FILE_IGNORED, 0,
|
ret = iso_msg_submit(t->image->id, ISO_FILE_IGNORED, 0,
|
||||||
"Cannot add %s to Joliet tree. "
|
"Cannot add %s to Joliet tree. %s can only be added to a "
|
||||||
"Special files can only be added to a Rock Ridge tree.",
|
"Rock Ridge tree.", ipath, (iso->type == LIBISO_SYMLINK ?
|
||||||
ipath);
|
"Symlinks" : "Special files"));
|
||||||
free(ipath);
|
free(ipath);
|
||||||
} else {
|
|
||||||
if (t->joliet_specials == 2)
|
|
||||||
iso_msg_submit(t->image->id, ISO_FILE_IGNORED, 0,
|
|
||||||
"More special files were omitted from Joliet tree.");
|
|
||||||
ret = 0;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007-2008 Vreixo Formoso, Mario Danic
|
* Copyright (c) 2007-2008 Vreixo Formoso, Mario Danic
|
||||||
* Copyright (c) 2009-2023 Thomas Schmitt
|
* Copyright (c) 2009-2021 Thomas Schmitt
|
||||||
*
|
*
|
||||||
* This file is part of the libisofs project; you can redistribute it and/or
|
* This file is part of the libisofs project; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License version 2
|
* modify it under the terms of the GNU General Public License version 2
|
||||||
@ -94,7 +94,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
#define iso_lib_header_version_major 1
|
#define iso_lib_header_version_major 1
|
||||||
#define iso_lib_header_version_minor 5
|
#define iso_lib_header_version_minor 5
|
||||||
#define iso_lib_header_version_micro 6
|
#define iso_lib_header_version_micro 4
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get version of the libisofs library at runtime.
|
* Get version of the libisofs library at runtime.
|
||||||
@ -2277,19 +2277,9 @@ int iso_write_opts_set_fifo_size(IsoWriteOpts *opts, size_t fifo_size);
|
|||||||
* Is normally combined with options bit0.
|
* Is normally combined with options bit0.
|
||||||
* Will not be in effect if options bit1 is set.
|
* Will not be in effect if options bit1 is set.
|
||||||
* bit15= Only with System area type MBR but not with CHRP
|
* bit15= Only with System area type MBR but not with CHRP
|
||||||
* @since 1.4.4
|
|
||||||
* Enforce MBR "bootable/active" flag. In worst case by dummy
|
* Enforce MBR "bootable/active" flag. In worst case by dummy
|
||||||
* partition of type 0x00 which occupies block 0.
|
* partition of type 0x00 which occupies block 0.
|
||||||
* bit16= "Legacy BIOS bootable" in GPT
|
* @since 1.4.4
|
||||||
* @since 1.5.6
|
|
||||||
* If this bit is set and a GPT partition for the ISO 9660
|
|
||||||
* filesystem gets written, then set the GPT partition flags bit 2
|
|
||||||
* "Legacy BIOS bootable".
|
|
||||||
* bit17= ISO not read-only
|
|
||||||
* @since 1.5.6
|
|
||||||
* Do not set GPT partition flag bit 60 "read-only" for the
|
|
||||||
* ISO 9660 filesystem partition, if such a partition gets
|
|
||||||
* written.
|
|
||||||
* @param flag
|
* @param flag
|
||||||
* bit0 = invalidate any attached system area data. Same as data == NULL
|
* bit0 = invalidate any attached system area data. Same as data == NULL
|
||||||
* (This re-activates eventually loaded image System Area data.
|
* (This re-activates eventually loaded image System Area data.
|
||||||
@ -2684,39 +2674,6 @@ int iso_write_opts_set_efi_bootp(IsoWriteOpts *opts, char *image_path,
|
|||||||
int iso_write_opts_set_gpt_guid(IsoWriteOpts *opts, uint8_t guid[16],
|
int iso_write_opts_set_gpt_guid(IsoWriteOpts *opts, uint8_t guid[16],
|
||||||
int mode);
|
int mode);
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the maximum number of SUSP CE entries and thus continuation areas.
|
|
||||||
* Each continuation area can hold at most 2048 bytes of SUSP data (Rock Ridge
|
|
||||||
* or AAIP). The first area can be smaller. There might be some waste at the
|
|
||||||
* end of each area.
|
|
||||||
* When the maximum number is exceeded during ISO filesystem production
|
|
||||||
* then possibly xattr and ACL get removed or error ISO_TOO_MANY_CE gets
|
|
||||||
* reported and filesystem production is prevented.
|
|
||||||
*
|
|
||||||
* Files with 32 or more CE entries do not show up in mounted filesystems on
|
|
||||||
* Linux. So the default setting is 31 with drop mode 2. If a higher limit is
|
|
||||||
* chosen and 31 gets surpassed, then a warning message gets reported.
|
|
||||||
*
|
|
||||||
* @param opts
|
|
||||||
* The option set to be manipulated.
|
|
||||||
* @param num
|
|
||||||
* The maximum number of CE entries per file.
|
|
||||||
* Not more than 100000 may be set here.
|
|
||||||
* 0 gets silently mapped to 1, because the root directory needs one CE.
|
|
||||||
* @param flag
|
|
||||||
* bit0-bit3 = Drop mode: What to do with AAIP data on too many CE:
|
|
||||||
* 0 = throw ISO_TOO_MANY_CE, without dropping anything
|
|
||||||
* 1 = permanently drop non-isofs fattr from IsoNode and
|
|
||||||
* retry filesystem production
|
|
||||||
* 2 = drop ACL if dropping non-isofs fattr does not suffice
|
|
||||||
* @return
|
|
||||||
* ISO_SUCCESS or ISO_TOO_MANY_CE
|
|
||||||
*
|
|
||||||
* @since 1.5.6
|
|
||||||
*/
|
|
||||||
int iso_write_opts_set_max_ce_entries(IsoWriteOpts *opts, uint32_t num,
|
|
||||||
int flag);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate a pseudo-random GUID suitable for iso_write_opts_set_gpt_guid().
|
* Generate a pseudo-random GUID suitable for iso_write_opts_set_gpt_guid().
|
||||||
*
|
*
|
||||||
@ -3278,40 +3235,7 @@ int iso_image_import(IsoImage *image, IsoDataSource *src, IsoReadOpts *opts,
|
|||||||
IsoReadImageFeatures **features);
|
IsoReadImageFeatures **features);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Assess features of the importable directory trees of src and an estimation
|
* Destroy an IsoReadImageFeatures object obtained with iso_image_import.
|
||||||
* of the write options which would cause the recognized features.
|
|
||||||
* This goes deeper than the feature assessment of iso_image_import(), e.g. by
|
|
||||||
* inspecting file names.
|
|
||||||
*
|
|
||||||
* For the parameters "src", "opts", and "features" see also the description of
|
|
||||||
* iso_image_import().
|
|
||||||
*
|
|
||||||
* @param src
|
|
||||||
* Data Source from which old image will be read.
|
|
||||||
* @param opts
|
|
||||||
* Options for image import. Settings about tree choice will be ignored.
|
|
||||||
* @param features
|
|
||||||
* Returns the pointer to a newly allocated and filled IsoReadImageFeatures
|
|
||||||
* object. NULL is not allowed, other than with iso_image_import().
|
|
||||||
* If *features is returned as non-NULL, then it should be freed with
|
|
||||||
* iso_read_image_features_destroy() when no more needed.
|
|
||||||
* @param write_opts
|
|
||||||
* Returns the pointer to a newly allocated and filled IsoWriteOpts object.
|
|
||||||
* If *write_opts is returned as non-NULL, then it should be freed with
|
|
||||||
* iso_write_opts_free() when no more needed.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* 1 on success, < 0 on error
|
|
||||||
*
|
|
||||||
* @since 1.5.6
|
|
||||||
*/
|
|
||||||
int iso_assess_written_features(IsoDataSource *src, IsoReadOpts *opts,
|
|
||||||
IsoReadImageFeatures **features,
|
|
||||||
IsoWriteOpts **write_opts);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Destroy an IsoReadImageFeatures object obtained with iso_image_import() or
|
|
||||||
* iso_assess_written_features().
|
|
||||||
*
|
*
|
||||||
* @since 0.6.2
|
* @since 0.6.2
|
||||||
*/
|
*/
|
||||||
@ -3369,99 +3293,6 @@ int iso_read_image_features_tree_loaded(IsoReadImageFeatures *f);
|
|||||||
*/
|
*/
|
||||||
int iso_read_image_features_rr_loaded(IsoReadImageFeatures *f);
|
int iso_read_image_features_rr_loaded(IsoReadImageFeatures *f);
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a named feature as text, num_value, or pt_value depending on its type.
|
|
||||||
* The set of named features includes the features which can be inquired by
|
|
||||||
* own iso_read_image_features_*() functions:
|
|
||||||
* size See iso_read_image_features_get_size()
|
|
||||||
* rockridge See iso_read_image_features_has_rockridge()
|
|
||||||
* iso_write_opts_set_rockridge()
|
|
||||||
* joliet See iso_read_image_features_has_joliet()
|
|
||||||
* iso_write_opts_set_joliet()
|
|
||||||
* iso1999 See iso_read_image_features_has_iso1999()
|
|
||||||
* iso_write_opts_set_iso1999()
|
|
||||||
* eltorito See iso_read_image_features_has_eltorito()
|
|
||||||
* tree_loaded See iso_read_image_features_tree_loaded()
|
|
||||||
* rr_loaded See iso_read_image_features_rr_loaded()
|
|
||||||
* Other named features are:
|
|
||||||
* tree_loaded_text Text form of "tree_loaded":
|
|
||||||
* 0="ISO9660", 1="Joliet", 2="ISO9660:1999"
|
|
||||||
* aaip 1=AAIP information was seen, 0= no AAIP seen
|
|
||||||
* Detected traces of potential write option settings:
|
|
||||||
* iso_level See iso_write_opts_set_iso_level()
|
|
||||||
* untranslated_name_len See iso_write_opts_set_untranslated_name_len()
|
|
||||||
* allow_dir_id_ext See iso_write_opts_set_allow_dir_id_ext()
|
|
||||||
* omit_version_numbers See iso_write_opts_set_omit_version_numbers()
|
|
||||||
* allow_deep_paths See iso_write_opts_set_allow_deep_paths()
|
|
||||||
* allow_longer_paths See iso_write_opts_set_allow_longer_paths()
|
|
||||||
* max_37_char_filenames See iso_write_opts_set_max_37_char_filenames()
|
|
||||||
* no_force_dots See iso_write_opts_set_no_force_dots()
|
|
||||||
* allow_lowercase See iso_write_opts_set_allow_lowercase()
|
|
||||||
* allow_full_ascii See iso_write_opts_set_allow_full_ascii()
|
|
||||||
* relaxed_vol_atts See iso_write_opts_set_relaxed_vol_atts()
|
|
||||||
* joliet_longer_paths See iso_write_opts_set_joliet_longer_paths()
|
|
||||||
* joliet_long_names See iso_write_opts_set_joliet_long_names()
|
|
||||||
* joliet_utf16 See iso_write_opts_set_joliet_utf16()
|
|
||||||
* rrip_version_1_10 See iso_write_opts_set_rrip_version_1_10()
|
|
||||||
* rrip_1_10_px_ino See iso_write_opts_set_rrip_1_10_px_ino()
|
|
||||||
* aaip_susp_1_10 See iso_write_opts_set_aaip_susp_1_10()
|
|
||||||
* record_md5_session See iso_write_opts_set_record_md5() param session
|
|
||||||
* record_md5_files See iso_write_opts_set_record_md5() param files
|
|
||||||
*
|
|
||||||
* @param f
|
|
||||||
* A features object returned by iso_image_import() or
|
|
||||||
* iso_assess_written_features().
|
|
||||||
* @param name
|
|
||||||
* The name of the feature to be inquired.
|
|
||||||
* @param text
|
|
||||||
* If text is not NULL, *text returns a textual representation of the
|
|
||||||
* reply. Dispose *text by free(2) when no longer needed.
|
|
||||||
* @param type
|
|
||||||
* Returns which of num_value or pt_value is valid:
|
|
||||||
* 0= *num_value is valid
|
|
||||||
* 1= *pt_value is valid
|
|
||||||
* @param num_value
|
|
||||||
* Returns the numerical value of the feature if type == 0.
|
|
||||||
* @param pt_value
|
|
||||||
* Returns a pointer to a memory area inside the features object if type
|
|
||||||
* is 1. The area is not necessarily 0-terminated.
|
|
||||||
* Do _not_ dispose *pt_value and do not use it after f was disposed.
|
|
||||||
* @param pt_size
|
|
||||||
* Returns the size of the pt_value memory area if type is 1.
|
|
||||||
* This counting includes a terminating 0-byte if it is present.
|
|
||||||
* @return
|
|
||||||
* 0 = Feature was not yet examined. Reply is not valid.
|
|
||||||
* 1 = Reply is valid
|
|
||||||
* ISO_UNDEF_READ_FEATURE = Given name is not known
|
|
||||||
* <0 = other error
|
|
||||||
*
|
|
||||||
* @since 1.5.6
|
|
||||||
*/
|
|
||||||
int iso_read_image_feature_named(IsoReadImageFeatures *f, char *name,
|
|
||||||
char **text, int *type,
|
|
||||||
int64_t *num_value, void **pt_value,
|
|
||||||
size_t *pt_size);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get all validly assessed named features as one single 0-terminated string
|
|
||||||
* consisting of single lines for each feature.
|
|
||||||
*
|
|
||||||
* @param f
|
|
||||||
* A features object returned by iso_image_import() or
|
|
||||||
* iso_assess_written_features().
|
|
||||||
* @param with_values
|
|
||||||
* If set to 1: return lines of form name=value\n
|
|
||||||
* If set to 0: return lines of form name\n
|
|
||||||
* @param feature_text
|
|
||||||
* Returns the result string. Dispose by free(2) when no longer needed.
|
|
||||||
* @return
|
|
||||||
* 1 = result is valid, <0 indicates error
|
|
||||||
*
|
|
||||||
* @since 1.5.6
|
|
||||||
*/
|
|
||||||
int iso_read_image_features_text(IsoReadImageFeatures *f, int with_values,
|
|
||||||
char **feature_text);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Increments the reference counting of the given image.
|
* Increments the reference counting of the given image.
|
||||||
*
|
*
|
||||||
@ -6508,9 +6339,8 @@ int iso_tree_add_new_node(IsoImage *image, IsoDir *parent, const char *name,
|
|||||||
* according to iso_image_set_truncate_mode().
|
* according to iso_image_set_truncate_mode().
|
||||||
* Its directory path depends on the parent node.
|
* Its directory path depends on the parent node.
|
||||||
* @param path
|
* @param path
|
||||||
* The absolute path of the random-access capable file in the local
|
* The absolute path of the file in the local filesystem. For now
|
||||||
* filesystem. Only regular files and device files are supported.
|
* only regular files and symlinks to regular files are supported.
|
||||||
* On Linux, only regular files and block device offer random-access.
|
|
||||||
* @param offset
|
* @param offset
|
||||||
* Byte number in the given file from where to start reading data.
|
* Byte number in the given file from where to start reading data.
|
||||||
* @param size
|
* @param size
|
||||||
@ -6528,11 +6358,8 @@ int iso_tree_add_new_node(IsoImage *image, IsoDir *parent, const char *name,
|
|||||||
* ISO_NODE_NAME_NOT_UNIQUE, a node with same name already exists
|
* ISO_NODE_NAME_NOT_UNIQUE, a node with same name already exists
|
||||||
* ISO_OUT_OF_MEM
|
* ISO_OUT_OF_MEM
|
||||||
* ISO_RR_NAME_TOO_LONG
|
* ISO_RR_NAME_TOO_LONG
|
||||||
* ISO_WRONG_ARG_VALUE, if path is not suitable for random access
|
|
||||||
*
|
*
|
||||||
* @since 0.6.4
|
* @since 0.6.4
|
||||||
*
|
|
||||||
* Device files as path: @since 1.5.6
|
|
||||||
*/
|
*/
|
||||||
int iso_tree_add_new_cut_out_node(IsoImage *image, IsoDir *parent,
|
int iso_tree_add_new_cut_out_node(IsoImage *image, IsoDir *parent,
|
||||||
const char *name, const char *path,
|
const char *name, const char *path,
|
||||||
@ -9113,13 +8940,9 @@ int iso_conv_name_chars(IsoWriteOpts *opts, char *name, size_t name_len,
|
|||||||
|
|
||||||
/** Error with reading ACL or xattr from local file (FAILURE, HIGH, -341) */
|
/** Error with reading ACL or xattr from local file (FAILURE, HIGH, -341) */
|
||||||
#define ISO_AAIP_NO_GET_LOCAL 0xE830FEAB
|
#define ISO_AAIP_NO_GET_LOCAL 0xE830FEAB
|
||||||
/** Error with reading ACL or xattr from local file (SORRY, HIGH, -341) */
|
|
||||||
#define ISO_AAIP_NO_GET_LOCAL_S 0xE030FEAB
|
|
||||||
|
|
||||||
/** Error with attaching ACL or xattr to local file (FAILURE, HIGH, -342) */
|
/** Error with attaching ACL or xattr to local file (FAILURE, HIGH, -342) */
|
||||||
#define ISO_AAIP_NO_SET_LOCAL 0xE830FEAA
|
#define ISO_AAIP_NO_SET_LOCAL 0xE830FEAA
|
||||||
/** Error with attaching ACL or xattr to local file (SORRY, HIGH, -342) */
|
|
||||||
#define ISO_AAIP_NO_SET_LOCAL_S 0xE030FEAA
|
|
||||||
|
|
||||||
/** Unallowed attempt to set an xattr with non-userspace name
|
/** Unallowed attempt to set an xattr with non-userspace name
|
||||||
(FAILURE, HIGH, -343) */
|
(FAILURE, HIGH, -343) */
|
||||||
@ -9431,20 +9254,6 @@ int iso_conv_name_chars(IsoWriteOpts *opts, char *name, size_t name_len,
|
|||||||
/** Cannot obtain size of zisofs compressed stream (FAILURE, HIGH, -425) */
|
/** Cannot obtain size of zisofs compressed stream (FAILURE, HIGH, -425) */
|
||||||
#define ISO_ZISOFS_UNKNOWN_SIZE 0xE830FE57
|
#define ISO_ZISOFS_UNKNOWN_SIZE 0xE830FE57
|
||||||
|
|
||||||
/** Undefined IsoReadImageFeatures name (SORRY, HIGH, -426) */
|
|
||||||
#define ISO_UNDEF_READ_FEATURE 0xE030FE56
|
|
||||||
|
|
||||||
/** Too many CE entries for single file (FAILURE,HIGH, -427) */
|
|
||||||
#define ISO_TOO_MANY_CE 0xE830FE55
|
|
||||||
|
|
||||||
/** Too many CE entries for single file when mounted by Linux
|
|
||||||
(WARNING,HIGH, -428) */
|
|
||||||
#define ISO_TOO_MANY_CE_FOR_LINUX 0xD030FE54
|
|
||||||
|
|
||||||
/** Too many CE entries for single file, omitting attributes
|
|
||||||
(WARNING,HIGH, -429) */
|
|
||||||
#define ISO_CE_REMOVING_ATTR 0xD030FE53
|
|
||||||
|
|
||||||
|
|
||||||
/* Internal developer note:
|
/* Internal developer note:
|
||||||
Place new error codes directly above this comment.
|
Place new error codes directly above this comment.
|
||||||
|
@ -21,7 +21,6 @@ el_torito_set_load_seg;
|
|||||||
el_torito_set_load_size;
|
el_torito_set_load_size;
|
||||||
el_torito_set_no_bootable;
|
el_torito_set_no_bootable;
|
||||||
el_torito_set_selection_crit;
|
el_torito_set_selection_crit;
|
||||||
iso_assess_written_features;
|
|
||||||
iso_conv_name_chars;
|
iso_conv_name_chars;
|
||||||
iso_crc32_gpt;
|
iso_crc32_gpt;
|
||||||
iso_data_source_new_from_file;
|
iso_data_source_new_from_file;
|
||||||
@ -230,7 +229,6 @@ iso_node_xinfo_make_clonable;
|
|||||||
iso_node_zf_by_magic;
|
iso_node_zf_by_magic;
|
||||||
iso_nowtime;
|
iso_nowtime;
|
||||||
iso_obtain_msgs;
|
iso_obtain_msgs;
|
||||||
iso_read_image_feature_named;
|
|
||||||
iso_read_image_features_destroy;
|
iso_read_image_features_destroy;
|
||||||
iso_read_image_features_get_size;
|
iso_read_image_features_get_size;
|
||||||
iso_read_image_features_has_eltorito;
|
iso_read_image_features_has_eltorito;
|
||||||
@ -238,7 +236,6 @@ iso_read_image_features_has_iso1999;
|
|||||||
iso_read_image_features_has_joliet;
|
iso_read_image_features_has_joliet;
|
||||||
iso_read_image_features_has_rockridge;
|
iso_read_image_features_has_rockridge;
|
||||||
iso_read_image_features_rr_loaded;
|
iso_read_image_features_rr_loaded;
|
||||||
iso_read_image_features_text;
|
|
||||||
iso_read_image_features_tree_loaded;
|
iso_read_image_features_tree_loaded;
|
||||||
iso_read_opts_auto_input_charset;
|
iso_read_opts_auto_input_charset;
|
||||||
iso_read_opts_free;
|
iso_read_opts_free;
|
||||||
@ -350,7 +347,6 @@ iso_write_opts_set_joliet_long_names;
|
|||||||
iso_write_opts_set_joliet_longer_paths;
|
iso_write_opts_set_joliet_longer_paths;
|
||||||
iso_write_opts_set_joliet_utf16;
|
iso_write_opts_set_joliet_utf16;
|
||||||
iso_write_opts_set_max_37_char_filenames;
|
iso_write_opts_set_max_37_char_filenames;
|
||||||
iso_write_opts_set_max_ce_entries;
|
|
||||||
iso_write_opts_set_ms_block;
|
iso_write_opts_set_ms_block;
|
||||||
iso_write_opts_set_no_force_dots;
|
iso_write_opts_set_no_force_dots;
|
||||||
iso_write_opts_set_old_empty;
|
iso_write_opts_set_old_empty;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2002 - 2008 H. Peter Anvin
|
* Copyright (c) 2002 - 2008 H. Peter Anvin
|
||||||
* Copyright (c) 2008 - 2022 Thomas Schmitt
|
* Copyright (c) 2008 - 2015 Thomas Schmitt
|
||||||
* with special credits to Matthew Garrett for isohybrid with GPT and APM
|
* with special credits to Matthew Garrett for isohybrid with GPT and APM
|
||||||
*
|
*
|
||||||
* This file is part of the libisofs project; you can redistribute it and/or
|
* This file is part of the libisofs project; you can redistribute it and/or
|
||||||
@ -420,8 +420,8 @@ int assess_isohybrid_gpt_apm(Ecma119Image *t, int *gpt_count, int gpt_idx[128],
|
|||||||
0x00, 0x53, 0x46, 0x48, 0x00, 0x00, 0xaa, 0x11,
|
0x00, 0x53, 0x46, 0x48, 0x00, 0x00, 0xaa, 0x11,
|
||||||
0xaa, 0x11, 0x00, 0x30, 0x65, 0x43, 0xec, 0xac
|
0xaa, 0x11, 0x00, 0x30, 0x65, 0x43, 0xec, 0xac
|
||||||
};
|
};
|
||||||
uint8_t *uuid, *type_guid;
|
uint8_t *uuid;
|
||||||
uint64_t gpt_flags = (((uint64_t) 1) << 60) | 1;
|
static uint64_t gpt_flags = (((uint64_t) 1) << 60) | 1;
|
||||||
|
|
||||||
*gpt_count = 0;
|
*gpt_count = 0;
|
||||||
*apm_count = 0;
|
*apm_count = 0;
|
||||||
@ -504,20 +504,12 @@ int assess_isohybrid_gpt_apm(Ecma119Image *t, int *gpt_count, int gpt_idx[128],
|
|||||||
memset(gpt_name, 0, 72);
|
memset(gpt_name, 0, 72);
|
||||||
sprintf((char *) gpt_name, "ISOHybrid");
|
sprintf((char *) gpt_name, "ISOHybrid");
|
||||||
iso_ascii_utf_16le(gpt_name);
|
iso_ascii_utf_16le(gpt_name);
|
||||||
if (t->opts->iso_gpt_flag & 1)
|
|
||||||
type_guid = t->opts->iso_gpt_type_guid;
|
|
||||||
else
|
|
||||||
type_guid = basic_data_uuid;
|
|
||||||
if (t->system_area_options & (1 << 16))
|
|
||||||
gpt_flags|= 4; /* Legacy BIOS bootable */
|
|
||||||
if (t->opts->system_area_options & (1 << 17))
|
|
||||||
gpt_flags &= ~(((uint64_t) 1) << 60); /* Not read-only */
|
|
||||||
/* Let it be open ended. iso_write_gpt() will truncate it as needed. */
|
/* Let it be open ended. iso_write_gpt() will truncate it as needed. */
|
||||||
block_count = 0xffffffff;
|
block_count = 0xffffffff;
|
||||||
ret = iso_quick_gpt_entry(t->gpt_req, &(t->gpt_req_count),
|
ret = iso_quick_gpt_entry(t->gpt_req, &(t->gpt_req_count),
|
||||||
(uint64_t) t->opts->partition_offset * 4,
|
(uint64_t) t->opts->partition_offset * 4,
|
||||||
((uint64_t) block_count) * 4,
|
((uint64_t) block_count) * 4,
|
||||||
type_guid, zero_uuid, gpt_flags,
|
basic_data_uuid, zero_uuid, gpt_flags,
|
||||||
(uint8_t *) gpt_name);
|
(uint8_t *) gpt_name);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
@ -633,23 +625,18 @@ static uint32_t iso_make_mbr_id(Ecma119Image *t, int flag)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* @param flag bit0= make own random MBR Id from current time
|
* @param flag bit0= make own random MBR Id from current time
|
||||||
* or from overridden modification time
|
* >>> or from overridden modification time
|
||||||
* bit1= create protective MBR as of UEFI/GPT specs
|
* bit1= create protective MBR as of UEFI/GPT specs
|
||||||
* bit2= write only partition table
|
|
||||||
* do not insert APM mockup head
|
|
||||||
* do not treat bytes before code as isohybrid MBR
|
|
||||||
* do not create MBR id
|
|
||||||
* bit3= replace fs_type 0x00 by 0x17 if appropriate
|
|
||||||
*/
|
*/
|
||||||
int make_isolinux_mbr(uint32_t *img_blocks, Ecma119Image *t,
|
int make_isolinux_mbr(uint32_t *img_blocks, Ecma119Image *t,
|
||||||
int part_offset, int part_number, int fs_type,
|
int part_offset, int part_number, int fs_type,
|
||||||
uint8_t *buf, int flag)
|
uint8_t *buf, int flag)
|
||||||
{
|
{
|
||||||
uint32_t id, part, nominal_part_size, mbr_part_start;
|
uint32_t id, part, nominal_part_size;
|
||||||
off_t hd_img_blocks, hd_boot_lba;
|
off_t hd_img_blocks, hd_boot_lba;
|
||||||
char *wpt, *fs_type_wpt = NULL;
|
char *wpt;
|
||||||
uint32_t boot_lba;
|
uint32_t boot_lba;
|
||||||
int head_count, sector_count, ret, part_is_in_img = 0;
|
int head_count, sector_count, ret;
|
||||||
int gpt_count = 0, gpt_idx[128], apm_count = 0, gpt_cursor, i;
|
int gpt_count = 0, gpt_idx[128], apm_count = 0, gpt_cursor, i;
|
||||||
|
|
||||||
if (t->bootsrc[0] == NULL)
|
if (t->bootsrc[0] == NULL)
|
||||||
@ -675,45 +662,40 @@ int make_isolinux_mbr(uint32_t *img_blocks, Ecma119Image *t,
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if(flag & 4) {
|
/* The rest of APM has already been written by iso_write_apm().
|
||||||
wpt= (char *) buf + 446;
|
But the isohybrid APM head differs from the hfsplus_writer APM head.
|
||||||
|
*/
|
||||||
|
ret = insert_apm_head(buf, apm_count);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
/* Padding of image_size to a multiple of sector_count*head_count
|
||||||
|
happens already at compute time and is implemented by
|
||||||
|
an appropriate increase of Ecma119Image->tail_blocks.
|
||||||
|
*/
|
||||||
|
|
||||||
|
wpt = (char *) buf + 432;
|
||||||
|
|
||||||
|
/* write qword boot_lba # Offset 432
|
||||||
|
*/
|
||||||
|
hd_boot_lba = ((off_t) boot_lba) * (off_t) 4;
|
||||||
|
lsb_to_buf(&wpt, hd_boot_lba & 0xffffffff, 32, 0);
|
||||||
|
lsb_to_buf(&wpt, hd_boot_lba >> 32, 32, 0);
|
||||||
|
|
||||||
|
/* write dword mbr_id # Offset 440
|
||||||
|
(here some 32-bit random value with no crypto strength)
|
||||||
|
*/
|
||||||
|
if (flag & 1) {
|
||||||
|
id = iso_make_mbr_id(t, 0);
|
||||||
|
lsb_to_buf(&wpt, id, 32, 0);
|
||||||
} else {
|
} else {
|
||||||
|
wpt+= 4;
|
||||||
/* The rest of APM has already been written by iso_write_apm().
|
|
||||||
But the isohybrid APM head differs from the hfsplus_writer APM head.
|
|
||||||
*/
|
|
||||||
ret = insert_apm_head(buf, apm_count);
|
|
||||||
if (ret < 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
/* Padding of image_size to a multiple of sector_count*head_count
|
|
||||||
happens already at compute time and is implemented by
|
|
||||||
an appropriate increase of Ecma119Image->tail_blocks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
wpt = (char *) buf + 432;
|
|
||||||
|
|
||||||
/* write qword boot_lba # Offset 432
|
|
||||||
*/
|
|
||||||
hd_boot_lba = ((off_t) boot_lba) * (off_t) 4;
|
|
||||||
lsb_to_buf(&wpt, hd_boot_lba & 0xffffffff, 32, 0);
|
|
||||||
lsb_to_buf(&wpt, hd_boot_lba >> 32, 32, 0);
|
|
||||||
|
|
||||||
/* write dword mbr_id # Offset 440
|
|
||||||
(here some 32-bit random value with no crypto strength)
|
|
||||||
*/
|
|
||||||
if (flag & 1) {
|
|
||||||
id = iso_make_mbr_id(t, 0);
|
|
||||||
lsb_to_buf(&wpt, id, 32, 0);
|
|
||||||
} else {
|
|
||||||
wpt+= 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* write word 0 # Offset 444
|
|
||||||
*/
|
|
||||||
lsb_to_buf(&wpt, 0, 16, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* write word 0 # Offset 444
|
||||||
|
*/
|
||||||
|
lsb_to_buf(&wpt, 0, 16, 0);
|
||||||
|
|
||||||
/* # Offset 446
|
/* # Offset 446
|
||||||
*/
|
*/
|
||||||
gpt_cursor= 0;
|
gpt_cursor= 0;
|
||||||
@ -731,13 +713,6 @@ int make_isolinux_mbr(uint32_t *img_blocks, Ecma119Image *t,
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Will this hit the part_number partition ? */
|
|
||||||
mbr_part_start = iso_read_lsb((uint8_t *) (wpt + 8), 4);
|
|
||||||
if (mbr_part_start > 0 &&
|
|
||||||
mbr_part_start < hd_img_blocks + part_offset)
|
|
||||||
part_is_in_img = 1;
|
|
||||||
|
|
||||||
wpt+= 16;
|
wpt+= 16;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -753,7 +728,6 @@ int make_isolinux_mbr(uint32_t *img_blocks, Ecma119Image *t,
|
|||||||
else
|
else
|
||||||
lsb_to_buf(&wpt, 0x80, 8, 0);
|
lsb_to_buf(&wpt, 0x80, 8, 0);
|
||||||
lba512chs_to_buf(&wpt, part_offset, head_count, sector_count);
|
lba512chs_to_buf(&wpt, part_offset, head_count, sector_count);
|
||||||
fs_type_wpt = wpt;
|
|
||||||
lsb_to_buf(&wpt, fs_type, 8, 0);
|
lsb_to_buf(&wpt, fs_type, 8, 0);
|
||||||
lba512chs_to_buf(&wpt, hd_img_blocks - 1, head_count, sector_count);
|
lba512chs_to_buf(&wpt, hd_img_blocks - 1, head_count, sector_count);
|
||||||
lsb_to_buf(&wpt, part_offset, 32, 0);
|
lsb_to_buf(&wpt, part_offset, 32, 0);
|
||||||
@ -768,17 +742,6 @@ int make_isolinux_mbr(uint32_t *img_blocks, Ecma119Image *t,
|
|||||||
*/
|
*/
|
||||||
lsb_to_buf(&wpt, 0xaa55, 16, 0);
|
lsb_to_buf(&wpt, 0xaa55, 16, 0);
|
||||||
|
|
||||||
/* Check whether automatically determined fs_type 0x00 can become 0x17 */
|
|
||||||
if ((flag & 8) && fs_type_wpt != NULL && fs_type == 0x00 &&
|
|
||||||
t->opts->iso_mbr_part_type != fs_type && !part_is_in_img) {
|
|
||||||
if (t->opts->iso_mbr_part_type >= 0 &&
|
|
||||||
t->opts->iso_mbr_part_type <= 255) {
|
|
||||||
lsb_to_buf(&fs_type_wpt, t->opts->iso_mbr_part_type, 8, 0);
|
|
||||||
} else {
|
|
||||||
lsb_to_buf(&fs_type_wpt, 0x17, 8, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Vreixo Formoso
|
* Copyright (c) 2007 Vreixo Formoso
|
||||||
* Copyright (c) 2009 - 2023 Thomas Schmitt
|
* Copyright (c) 2009 - 2016 Thomas Schmitt
|
||||||
*
|
*
|
||||||
* This file is part of the libisofs project; you can redistribute it and/or
|
* This file is part of the libisofs project; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License version 2
|
* modify it under the terms of the GNU General Public License version 2
|
||||||
@ -392,10 +392,8 @@ const char *iso_error_to_msg(int errcode)
|
|||||||
case ISO_AAIP_BAD_AASTRING:
|
case ISO_AAIP_BAD_AASTRING:
|
||||||
return "Error with decoding AAIP info for ACL or xattr";
|
return "Error with decoding AAIP info for ACL or xattr";
|
||||||
case ISO_AAIP_NO_GET_LOCAL:
|
case ISO_AAIP_NO_GET_LOCAL:
|
||||||
case ISO_AAIP_NO_GET_LOCAL_S:
|
|
||||||
return "Error with reading ACL or xattr from local file";
|
return "Error with reading ACL or xattr from local file";
|
||||||
case ISO_AAIP_NO_SET_LOCAL:
|
case ISO_AAIP_NO_SET_LOCAL:
|
||||||
case ISO_AAIP_NO_SET_LOCAL_S:
|
|
||||||
return "Error with attaching ACL or xattr to local file";
|
return "Error with attaching ACL or xattr to local file";
|
||||||
case ISO_AAIP_NON_USER_NAME:
|
case ISO_AAIP_NON_USER_NAME:
|
||||||
return "Unallowed attempt to set an xattr with non-userspace name";
|
return "Unallowed attempt to set an xattr with non-userspace name";
|
||||||
@ -565,14 +563,6 @@ const char *iso_error_to_msg(int errcode)
|
|||||||
return "Prevented zisofs block pointer counter underrun";
|
return "Prevented zisofs block pointer counter underrun";
|
||||||
case ISO_ZISOFS_UNKNOWN_SIZE:
|
case ISO_ZISOFS_UNKNOWN_SIZE:
|
||||||
return "Cannot obtain size of zisofs compressed stream";
|
return "Cannot obtain size of zisofs compressed stream";
|
||||||
case ISO_UNDEF_READ_FEATURE:
|
|
||||||
return "Undefined IsoReadImageFeatures name";
|
|
||||||
case ISO_TOO_MANY_CE:
|
|
||||||
return "Too many CE entries for single file";
|
|
||||||
case ISO_TOO_MANY_CE_FOR_LINUX:
|
|
||||||
return "Too many CE entries for single file when mounted by Linux";
|
|
||||||
case ISO_CE_REMOVING_ATTR:
|
|
||||||
return "Too many CE entries for single file, removing attributes";
|
|
||||||
default:
|
default:
|
||||||
return "Unknown error";
|
return "Unknown error";
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Vreixo Formoso
|
* Copyright (c) 2007 Vreixo Formoso
|
||||||
* Copyright (c) 2009 - 2023 Thomas Schmitt
|
* Copyright (c) 2009 - 2020 Thomas Schmitt
|
||||||
*
|
*
|
||||||
* This file is part of the libisofs project; you can redistribute it and/or
|
* This file is part of the libisofs project; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License version 2
|
* modify it under the terms of the GNU General Public License version 2
|
||||||
@ -2046,60 +2046,13 @@ int iso_node_set_attrs(IsoNode *node, size_t num_attrs, char **names,
|
|||||||
}
|
}
|
||||||
ret = 1;
|
ret = 1;
|
||||||
ex:;
|
ex:;
|
||||||
/* Dispose merged list if it was created */
|
/* Dispose eventual merged list */
|
||||||
iso_node_merge_xattr(node, num_attrs, names, value_lengths, values,
|
iso_node_merge_xattr(node, num_attrs, names, value_lengths, values,
|
||||||
&m_num, &m_names, &m_value_lengths, &m_values, 1 << 15);
|
&m_num, &m_names, &m_value_lengths, &m_values, 1 << 15);
|
||||||
/* Dispose ACL if saved */
|
|
||||||
iso_node_get_acl_text(node, &a_acl, &d_acl, 1 << 15);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* @param flag
|
|
||||||
bit0= delete ACL, too
|
|
||||||
*/
|
|
||||||
int iso_node_remove_fattr(IsoNode *node, int flag)
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
size_t num_attrs, *value_lengths = NULL, i, w;
|
|
||||||
char **names = NULL, **values = NULL;
|
|
||||||
|
|
||||||
ret = iso_node_get_attrs(node, &num_attrs, &names, &value_lengths, &values,
|
|
||||||
flag & 1);
|
|
||||||
if (ret < 0)
|
|
||||||
goto ex;
|
|
||||||
|
|
||||||
/* Delete variables of all namespaces except isofs */
|
|
||||||
w = 0;
|
|
||||||
for (i = 0; i < num_attrs; i++) {
|
|
||||||
if (strncmp(names[i], "isofs.", 6) != 0) {
|
|
||||||
free(names[i]);
|
|
||||||
names[i] = NULL;
|
|
||||||
free(values[i]);
|
|
||||||
values[i] = NULL;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (w != i) {
|
|
||||||
/* move i to w , nullify i */
|
|
||||||
names[w] = names[i];
|
|
||||||
names[i] = NULL;
|
|
||||||
values[w] = values[i];
|
|
||||||
values[i] = NULL;
|
|
||||||
value_lengths[w] = value_lengths[i];
|
|
||||||
}
|
|
||||||
w++;
|
|
||||||
}
|
|
||||||
num_attrs = w;
|
|
||||||
ret = iso_node_set_attrs(node, num_attrs, names, value_lengths, values,
|
|
||||||
(flag & 1) | 8);
|
|
||||||
ex:;
|
|
||||||
if (names != NULL)
|
|
||||||
iso_node_get_attrs(NULL, &num_attrs, &names, &value_lengths, &values,
|
|
||||||
1 << 15);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static
|
static
|
||||||
int iso_decode_acl(unsigned char *v_data, size_t v_len, size_t *consumed,
|
int iso_decode_acl(unsigned char *v_data, size_t v_len, size_t *consumed,
|
||||||
char **text, size_t *text_fill, int flag)
|
char **text, size_t *text_fill, int flag)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Vreixo Formoso
|
* Copyright (c) 2007 Vreixo Formoso
|
||||||
* Copyright (c) 2009 - 2023 Thomas Schmitt
|
* Copyright (c) 2009 - 2020 Thomas Schmitt
|
||||||
*
|
*
|
||||||
* This file is part of the libisofs project; you can redistribute it and/or
|
* This file is part of the libisofs project; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License version 2
|
* modify it under the terms of the GNU General Public License version 2
|
||||||
@ -422,12 +422,6 @@ int iso_aa_get_attrs(unsigned char *aa_string, size_t *num_attrs,
|
|||||||
int iso_aa_lookup_attr(unsigned char *aa_string, char *name,
|
int iso_aa_lookup_attr(unsigned char *aa_string, char *name,
|
||||||
size_t *value_length, char **value, int flag);
|
size_t *value_length, char **value, int flag);
|
||||||
|
|
||||||
/**
|
|
||||||
* Delete variables of all namespaces except isofs
|
|
||||||
*
|
|
||||||
* @param flag bit0= delete ACL, too
|
|
||||||
*/
|
|
||||||
int iso_node_remove_fattr(IsoNode *node, int flag);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to identify and manage ZF parameters which do not stem from ZF
|
* Function to identify and manage ZF parameters which do not stem from ZF
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Vreixo Formoso
|
* Copyright (c) 2007 Vreixo Formoso
|
||||||
* Copyright (c) 2007 Mario Danic
|
* Copyright (c) 2007 Mario Danic
|
||||||
* Copyright (c) 2009 - 2023 Thomas Schmitt
|
* Copyright (c) 2009 - 2020 Thomas Schmitt
|
||||||
*
|
*
|
||||||
* This file is part of the libisofs project; you can redistribute it and/or
|
* This file is part of the libisofs project; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License version 2
|
* modify it under the terms of the GNU General Public License version 2
|
||||||
@ -94,7 +94,7 @@ int susp_append_ce(Ecma119Image *t, struct susp_info *susp, uint8_t *data)
|
|||||||
/* Insert CE entry (actual CE size later by susp_update_CE_sizes) */
|
/* Insert CE entry (actual CE size later by susp_update_CE_sizes) */
|
||||||
ret = susp_make_CE(t, &CE, (uint32_t) (susp->ce_block +
|
ret = susp_make_CE(t, &CE, (uint32_t) (susp->ce_block +
|
||||||
susp->ce_len / BLOCK_SIZE + 1),
|
susp->ce_len / BLOCK_SIZE + 1),
|
||||||
(uint32_t) 0, (uint32_t) 0);
|
(uint32_t) 0, (uint32_t) 2048);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
susp->ce_susp_fields[susp->n_ce_susp_fields] = CE;
|
susp->ce_susp_fields[susp->n_ce_susp_fields] = CE;
|
||||||
@ -618,15 +618,13 @@ int rrip_add_SL(Ecma119Image *t, struct susp_info *susp, uint8_t **comp,
|
|||||||
|
|
||||||
/* @param flag bit1= care about crossing block boundaries */
|
/* @param flag bit1= care about crossing block boundaries */
|
||||||
static
|
static
|
||||||
int susp_calc_add_to_ce(Ecma119Image *t, size_t *ce, size_t base_ce, int add,
|
int susp_calc_add_to_ce(size_t *ce, size_t base_ce, int add, int flag)
|
||||||
int flag)
|
|
||||||
{
|
{
|
||||||
if (flag & 2) {
|
if (flag & 2) {
|
||||||
/* Account for inserted CE before size exceeds block size */
|
/* Account for inserted CE before size exceeds block size */
|
||||||
if ((*ce + base_ce + add + ISO_CE_ENTRY_SIZE - 1) / BLOCK_SIZE !=
|
if ((*ce + base_ce + add + ISO_CE_ENTRY_SIZE - 1) / BLOCK_SIZE !=
|
||||||
(*ce + base_ce) / BLOCK_SIZE) {
|
(*ce + base_ce) / BLOCK_SIZE) {
|
||||||
/* Insert CE and padding */
|
/* Insert CE and padding */
|
||||||
t->curr_ce_entries++;
|
|
||||||
*ce += ISO_CE_ENTRY_SIZE;
|
*ce += ISO_CE_ENTRY_SIZE;
|
||||||
if ((*ce + base_ce) % BLOCK_SIZE)
|
if ((*ce + base_ce) % BLOCK_SIZE)
|
||||||
*ce += BLOCK_SIZE - ((*ce + base_ce) % BLOCK_SIZE);
|
*ce += BLOCK_SIZE - ((*ce + base_ce) % BLOCK_SIZE);
|
||||||
@ -660,12 +658,12 @@ int aaip_add_AL(Ecma119Image *t, struct susp_info *susp,
|
|||||||
es_extra = 5;
|
es_extra = 5;
|
||||||
if (*sua_free < num_data + es_extra || *ce_len > 0) {
|
if (*sua_free < num_data + es_extra || *ce_len > 0) {
|
||||||
if (es_extra > 0)
|
if (es_extra > 0)
|
||||||
susp_calc_add_to_ce(t, ce_len, ce_mem, es_extra, flag & 2);
|
susp_calc_add_to_ce(ce_len, ce_mem, es_extra, flag & 2);
|
||||||
done = 0;
|
done = 0;
|
||||||
for (aapt = *data; !done; aapt += aapt[2]) {
|
for (aapt = *data; !done; aapt += aapt[2]) {
|
||||||
done = !(aapt[4] & 1);
|
done = !(aapt[4] & 1);
|
||||||
len = aapt[2];
|
len = aapt[2];
|
||||||
susp_calc_add_to_ce(t, ce_len, ce_mem, len, flag & 2);
|
susp_calc_add_to_ce(ce_len, ce_mem, len, flag & 2);
|
||||||
count += len;
|
count += len;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -706,7 +704,7 @@ int aaip_add_AL(Ecma119Image *t, struct susp_info *susp,
|
|||||||
} else {
|
} else {
|
||||||
ret = susp_append(t, susp, cpt);
|
ret = susp_append(t, susp, cpt);
|
||||||
}
|
}
|
||||||
if (ret < 0)
|
if (ret == -1)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
free(*data);
|
free(*data);
|
||||||
@ -932,6 +930,27 @@ int susp_add_ES(Ecma119Image *t, struct susp_info *susp, int to_ce, int seqno)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A field beginning by 0 causes rrip_write_ce_fields() to pad up to the
|
||||||
|
* next block.
|
||||||
|
*/
|
||||||
|
static
|
||||||
|
int pseudo_susp_add_PAD(Ecma119Image *t, struct susp_info *susp)
|
||||||
|
{
|
||||||
|
unsigned char *pad;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
pad = malloc(1);
|
||||||
|
if (pad == NULL)
|
||||||
|
return ISO_OUT_OF_MEM;
|
||||||
|
pad[0] = 0;
|
||||||
|
ret = susp_append_ce(t, susp, pad);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
return ISO_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* see doc/zisofs_format.txt : "ZF System Use Entry Format"
|
* see doc/zisofs_format.txt : "ZF System Use Entry Format"
|
||||||
* see doc/zisofs2_format.txt : "ZF System Use Entry Format", "Z2 ..."
|
* see doc/zisofs2_format.txt : "ZF System Use Entry Format", "Z2 ..."
|
||||||
@ -1080,7 +1099,7 @@ int add_zf_field(Ecma119Image *t, Ecma119Node *n, struct susp_info *info,
|
|||||||
|
|
||||||
/* Account for field size */
|
/* Account for field size */
|
||||||
if (*sua_free < 16 || *ce_len > 0) {
|
if (*sua_free < 16 || *ce_len > 0) {
|
||||||
susp_calc_add_to_ce(t, ce_len, base_ce, 16, flag & 2);
|
susp_calc_add_to_ce(ce_len, base_ce, 16, flag & 2);
|
||||||
} else {
|
} else {
|
||||||
*sua_free -= 16;
|
*sua_free -= 16;
|
||||||
}
|
}
|
||||||
@ -1141,37 +1160,46 @@ int aaip_xinfo_cloner(void *old_data, void **new_data, int flag)
|
|||||||
* <0= error:
|
* <0= error:
|
||||||
* -1= not enough SUA space for 28 bytes of CE entry
|
* -1= not enough SUA space for 28 bytes of CE entry
|
||||||
* -2= out of memory
|
* -2= out of memory
|
||||||
* (int) ISO_TOO_MANY_CE
|
|
||||||
*/
|
*/
|
||||||
static
|
static
|
||||||
int susp_calc_nm_sl_al(Ecma119Image *t, Ecma119Node *n, size_t space,
|
int susp_calc_nm_sl_al(Ecma119Image *t, Ecma119Node *n, size_t space,
|
||||||
size_t *su_size, size_t *ce, size_t base_ce, int flag)
|
size_t *su_size, size_t *ce, size_t base_ce, int flag)
|
||||||
{
|
{
|
||||||
char *name;
|
char *name;
|
||||||
size_t namelen, su_mem, ce_mem;
|
size_t namelen, su_mem, ce_mem, ce_prepad = 0;
|
||||||
void *xipt;
|
void *xipt;
|
||||||
size_t num_aapt = 0, sua_free = 0;
|
size_t num_aapt = 0, sua_free = 0;
|
||||||
int ret;
|
int ret;
|
||||||
uint8_t *aapt;
|
uint8_t *aapt;
|
||||||
uint32_t curr_ce_entries_mem;
|
|
||||||
|
|
||||||
#ifdef Libisofs_ce_calc_debug_extrA
|
#ifdef Libisofs_ce_calc_debug_extrA
|
||||||
|
|
||||||
if (n->node->name != NULL)
|
if (n->node->name != NULL)
|
||||||
fprintf(stderr, "libburn_DEBUG: susp_calc_nm_sl_al : %u %.f %s \n",
|
fprintf(stderr, "libburn_DEBUG: susp_calc_nm_sl_al : %.f %s \n",
|
||||||
(unsigned int) t->curr_ce_entries,
|
|
||||||
(double) base_ce, n->node->name);
|
(double) base_ce, n->node->name);
|
||||||
|
|
||||||
#endif /* Libisofs_ce_calc_debug_extrA */
|
#endif /* Libisofs_ce_calc_debug_extrA */
|
||||||
|
|
||||||
su_mem = *su_size;
|
su_mem = *su_size;
|
||||||
ce_mem = *ce;
|
ce_mem = *ce;
|
||||||
curr_ce_entries_mem = t->curr_ce_entries;
|
|
||||||
if (*ce > 0 && !(flag & 1))
|
if (*ce > 0 && !(flag & 1))
|
||||||
goto unannounced_ca;
|
goto unannounced_ca;
|
||||||
|
|
||||||
if (flag & 2)
|
if (flag & 2) {
|
||||||
flag |= 1;
|
flag |= 1;
|
||||||
|
if (base_ce % BLOCK_SIZE) {
|
||||||
|
|
||||||
|
#ifdef Libisofs_ce_calc_debuG
|
||||||
|
|
||||||
|
fprintf(stderr,
|
||||||
|
"\nlibburn_DEBUG: Accounting for %d bytes CE padding : %s\n\n",
|
||||||
|
(int) (BLOCK_SIZE - (base_ce % BLOCK_SIZE)), n->node->name);
|
||||||
|
|
||||||
|
#endif /* Libisofs_ce_calc_debuG */
|
||||||
|
|
||||||
|
ce_prepad = BLOCK_SIZE - (base_ce % BLOCK_SIZE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
namelen = 0;
|
namelen = 0;
|
||||||
name = get_rr_fname(t, n->node->name);
|
name = get_rr_fname(t, n->node->name);
|
||||||
@ -1181,11 +1209,12 @@ int susp_calc_nm_sl_al(Ecma119Image *t, Ecma119Node *n, size_t space,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (flag & 1) {
|
if (flag & 1) {
|
||||||
/* Account for 28 bytes of CE field */
|
/* Account for 28 bytes of CE field */
|
||||||
if (*su_size + 28 > space)
|
if (*su_size + 28 > space) {
|
||||||
return -1;
|
*ce += ce_prepad;
|
||||||
*su_size += 28;
|
return -1;
|
||||||
t->curr_ce_entries++;
|
}
|
||||||
|
*su_size += 28;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* NM entry */
|
/* NM entry */
|
||||||
@ -1203,7 +1232,7 @@ int susp_calc_nm_sl_al(Ecma119Image *t, Ecma119Node *n, size_t space,
|
|||||||
of the name will always fit into the directory entry.)
|
of the name will always fit into the directory entry.)
|
||||||
*/;
|
*/;
|
||||||
|
|
||||||
susp_calc_add_to_ce(t, ce, base_ce, 5 + namelen, flag & 2);
|
susp_calc_add_to_ce(ce, base_ce, 5 + namelen, flag & 2);
|
||||||
*su_size = space;
|
*su_size = space;
|
||||||
}
|
}
|
||||||
if (n->type == ECMA119_SYMLINK) {
|
if (n->type == ECMA119_SYMLINK) {
|
||||||
@ -1215,8 +1244,10 @@ int susp_calc_nm_sl_al(Ecma119Image *t, Ecma119Node *n, size_t space,
|
|||||||
int cew = (*ce != 0); /* are we writing to CA ? */
|
int cew = (*ce != 0); /* are we writing to CA ? */
|
||||||
|
|
||||||
dest = get_rr_fname(t, ((IsoSymlink*)n->node)->dest);
|
dest = get_rr_fname(t, ((IsoSymlink*)n->node)->dest);
|
||||||
if (dest == NULL)
|
if (dest == NULL) {
|
||||||
|
*ce += ce_prepad;
|
||||||
return -2;
|
return -2;
|
||||||
|
}
|
||||||
prev = dest;
|
prev = dest;
|
||||||
cur = strchr(prev, '/');
|
cur = strchr(prev, '/');
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -1274,7 +1305,7 @@ int susp_calc_nm_sl_al(Ecma119Image *t, Ecma119Node *n, size_t space,
|
|||||||
* and another SL entry
|
* and another SL entry
|
||||||
*/
|
*/
|
||||||
/* Will fill up old SL and write it */
|
/* Will fill up old SL and write it */
|
||||||
susp_calc_add_to_ce(t, ce, base_ce, 255, flag & 2);
|
susp_calc_add_to_ce(ce, base_ce, 255, flag & 2);
|
||||||
sl_len = 5 + (clen - fit); /* Start new SL */
|
sl_len = 5 + (clen - fit); /* Start new SL */
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
@ -1283,16 +1314,15 @@ int susp_calc_nm_sl_al(Ecma119Image *t, Ecma119Node *n, size_t space,
|
|||||||
* anything in this SL
|
* anything in this SL
|
||||||
*/
|
*/
|
||||||
/* Will write non-full old SL */
|
/* Will write non-full old SL */
|
||||||
susp_calc_add_to_ce(t, ce, base_ce, sl_len,
|
susp_calc_add_to_ce(ce, base_ce, sl_len, flag & 2);
|
||||||
flag & 2);
|
|
||||||
/* Will write another full SL */
|
/* Will write another full SL */
|
||||||
susp_calc_add_to_ce(t, ce, base_ce, 255, flag & 2);
|
susp_calc_add_to_ce(ce, base_ce, 255, flag & 2);
|
||||||
sl_len = 5 + (clen - 250) + 2; /* Start new SL */
|
sl_len = 5 + (clen - 250) + 2; /* Start new SL */
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* case 2, create a new SL entry */
|
/* case 2, create a new SL entry */
|
||||||
/* Will write non-full old SL */
|
/* Will write non-full old SL */
|
||||||
susp_calc_add_to_ce(t, ce, base_ce, sl_len, flag & 2);
|
susp_calc_add_to_ce(ce, base_ce, sl_len, flag & 2);
|
||||||
sl_len = 5 + clen; /* Start new SL */
|
sl_len = 5 + clen; /* Start new SL */
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -1315,7 +1345,7 @@ int susp_calc_nm_sl_al(Ecma119Image *t, Ecma119Node *n, size_t space,
|
|||||||
/* the whole SL fits into the SUA */
|
/* the whole SL fits into the SUA */
|
||||||
*su_size += sl_len;
|
*su_size += sl_len;
|
||||||
} else {
|
} else {
|
||||||
susp_calc_add_to_ce(t, ce, base_ce, sl_len, flag & 2);
|
susp_calc_add_to_ce(ce, base_ce, sl_len, flag & 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1327,6 +1357,9 @@ int susp_calc_nm_sl_al(Ecma119Image *t, Ecma119Node *n, size_t space,
|
|||||||
if (*ce > 0 && !(flag & 1))
|
if (*ce > 0 && !(flag & 1))
|
||||||
goto unannounced_ca;
|
goto unannounced_ca;
|
||||||
|
|
||||||
|
*ce += ce_prepad;
|
||||||
|
ce_prepad = 0;
|
||||||
|
|
||||||
/* obtain num_aapt from node */
|
/* obtain num_aapt from node */
|
||||||
xipt = NULL;
|
xipt = NULL;
|
||||||
num_aapt = 0;
|
num_aapt = 0;
|
||||||
@ -1375,17 +1408,16 @@ int susp_calc_nm_sl_al(Ecma119Image *t, Ecma119Node *n, size_t space,
|
|||||||
/* Crossed a block boundary */
|
/* Crossed a block boundary */
|
||||||
*su_size = su_mem;
|
*su_size = su_mem;
|
||||||
*ce = ce_mem;
|
*ce = ce_mem;
|
||||||
t->curr_ce_entries = curr_ce_entries_mem;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*ce += ce_prepad;
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
unannounced_ca:;
|
unannounced_ca:;
|
||||||
*su_size = su_mem;
|
*su_size = su_mem;
|
||||||
*ce = ce_mem;
|
*ce = ce_mem;
|
||||||
t->curr_ce_entries = curr_ce_entries_mem;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1432,21 +1464,6 @@ int add_aa_string(Ecma119Image *t, Ecma119Node *n, struct susp_info *info,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static
|
|
||||||
void iso_msg_too_many_ce(Ecma119Image *t, Ecma119Node *n, int err)
|
|
||||||
{
|
|
||||||
if (n->node->name != NULL) {
|
|
||||||
iso_msg_submit(t->image->id, err, 0,
|
|
||||||
"Too many CE entries for file with name: %s",
|
|
||||||
n->node->name);
|
|
||||||
} else {
|
|
||||||
iso_msg_submit(t->image->id, err, 0,
|
|
||||||
"Too many CE entries for a single file",
|
|
||||||
n->node->name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compute the length needed for write all RR and SUSP entries for a given
|
* Compute the length needed for write all RR and SUSP entries for a given
|
||||||
* node.
|
* node.
|
||||||
@ -1463,15 +1480,13 @@ void iso_msg_too_many_ce(Ecma119Image *t, Ecma119Node *n, int err)
|
|||||||
* @return
|
* @return
|
||||||
* The size needed for the RR entries in the System Use Area
|
* The size needed for the RR entries in the System Use Area
|
||||||
*/
|
*/
|
||||||
ssize_t rrip_calc_len(Ecma119Image *t, Ecma119Node *n, int type, size_t used_up,
|
size_t rrip_calc_len(Ecma119Image *t, Ecma119Node *n, int type, size_t used_up,
|
||||||
size_t *ce, size_t base_ce)
|
size_t *ce, size_t base_ce)
|
||||||
{
|
{
|
||||||
size_t su_size, space;
|
size_t su_size, space;
|
||||||
int ret, retry = 0;
|
int ret;
|
||||||
size_t aaip_sua_free= 0, aaip_len= 0;
|
size_t aaip_sua_free= 0, aaip_len= 0;
|
||||||
|
|
||||||
try_again:
|
|
||||||
|
|
||||||
/* Directory record length must be even (ECMA-119, 9.1.13). Maximum is 254.
|
/* Directory record length must be even (ECMA-119, 9.1.13). Maximum is 254.
|
||||||
*/
|
*/
|
||||||
space = 254 - used_up - (used_up % 2);
|
space = 254 - used_up - (used_up % 2);
|
||||||
@ -1484,7 +1499,6 @@ try_again:
|
|||||||
|
|
||||||
*ce = 0;
|
*ce = 0;
|
||||||
su_size = 0;
|
su_size = 0;
|
||||||
t->curr_ce_entries = 0;
|
|
||||||
|
|
||||||
/* If AAIP enabled and announced by ER : account for 5 bytes of ES */;
|
/* If AAIP enabled and announced by ER : account for 5 bytes of ES */;
|
||||||
if (t->opts->aaip && !t->opts->aaip_susp_1_10)
|
if (t->opts->aaip && !t->opts->aaip_susp_1_10)
|
||||||
@ -1534,18 +1548,9 @@ try_again:
|
|||||||
if (ret == 0) /* Retry with CE but no block crossing */
|
if (ret == 0) /* Retry with CE but no block crossing */
|
||||||
ret = susp_calc_nm_sl_al(t, n, space, &su_size, ce, base_ce, 1);
|
ret = susp_calc_nm_sl_al(t, n, space, &su_size, ce, base_ce, 1);
|
||||||
if (ret == 0) /* Retry with aligned CE and block hopping */
|
if (ret == 0) /* Retry with aligned CE and block hopping */
|
||||||
ret = susp_calc_nm_sl_al(t, n, space, &su_size, ce, base_ce,
|
ret = susp_calc_nm_sl_al(t, n, space, &su_size, ce, base_ce, 1 | 2);
|
||||||
1 | 2);
|
|
||||||
if (ret == -2)
|
if (ret == -2)
|
||||||
return ISO_OUT_OF_MEM;
|
return ISO_OUT_OF_MEM;
|
||||||
/* -1 should not occur. By tradition it would not cause return */
|
|
||||||
if (ret < -2) {
|
|
||||||
if (n->node->name != NULL)
|
|
||||||
iso_msg_submit(t->image->id, ret, 0,
|
|
||||||
"SUSP planning failed for file with name: %s",
|
|
||||||
n->node->name);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@ -1561,7 +1566,6 @@ try_again:
|
|||||||
* ER needs a Continuation Area, thus we also need a CE entry
|
* ER needs a Continuation Area, thus we also need a CE entry
|
||||||
*/
|
*/
|
||||||
su_size += 7 + 28; /* SP + CE */
|
su_size += 7 + 28; /* SP + CE */
|
||||||
t->curr_ce_entries++;
|
|
||||||
/* ER of RRIP */
|
/* ER of RRIP */
|
||||||
if (t->opts->rrip_version_1_10) {
|
if (t->opts->rrip_version_1_10) {
|
||||||
*ce = 237;
|
*ce = 237;
|
||||||
@ -1584,40 +1588,6 @@ try_again:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (t->curr_ce_entries > t->opts->max_ce_entries) {
|
|
||||||
/* If permitted by API setting: Remove non-isofs-non-ACL fattr */
|
|
||||||
retry++;
|
|
||||||
if (retry == 1) {
|
|
||||||
if ((t->opts->max_ce_drop_attr & 15) >= 1) {
|
|
||||||
ret = iso_node_remove_fattr(n->node, 0);
|
|
||||||
if (ret > 0) {
|
|
||||||
iso_msg_too_many_ce(t, n, ISO_CE_REMOVING_ATTR);
|
|
||||||
iso_msg_submit(t->image->id, ISO_CE_REMOVING_ATTR, 0,
|
|
||||||
"Removed non-isofs attributes");
|
|
||||||
goto try_again;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (retry == 2) {
|
|
||||||
if ((t->opts->max_ce_drop_attr & 15) >= 2) {
|
|
||||||
ret = iso_node_remove_fattr(n->node, 1);
|
|
||||||
if (ret > 0) {
|
|
||||||
iso_msg_submit(t->image->id, ISO_CE_REMOVING_ATTR, 0,
|
|
||||||
"Removed ACL");
|
|
||||||
goto try_again;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
iso_msg_too_many_ce(t, n, ISO_TOO_MANY_CE);
|
|
||||||
return (ssize_t) (int) ISO_TOO_MANY_CE;
|
|
||||||
} else if (t->curr_ce_entries >= 32) {
|
|
||||||
if (n->node->name != NULL)
|
|
||||||
iso_msg_submit(t->image->id, ISO_TOO_MANY_CE_FOR_LINUX, 0,
|
|
||||||
"SUSP planning risky for file with name: %s",
|
|
||||||
n->node->name);
|
|
||||||
iso_msg_submit(t->image->id, ISO_TOO_MANY_CE_FOR_LINUX, 0,
|
|
||||||
"Too many CE entries for single file when mounted by Linux");
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The System Use field inside the directory record must be padded if
|
* The System Use field inside the directory record must be padded if
|
||||||
* it is an odd number (ECMA-119, 9.1.13)
|
* it is an odd number (ECMA-119, 9.1.13)
|
||||||
@ -1834,9 +1804,6 @@ int rrip_get_susp_fields(Ecma119Image *t, Ecma119Node *n, int type,
|
|||||||
ret = ISO_OUT_OF_MEM;
|
ret = ISO_OUT_OF_MEM;
|
||||||
goto add_susp_cleanup;
|
goto add_susp_cleanup;
|
||||||
}
|
}
|
||||||
/* -1 should not occur. By tradition it would not cause return */
|
|
||||||
if (ret < -2)
|
|
||||||
goto add_susp_cleanup;
|
|
||||||
|
|
||||||
/* NM entry */
|
/* NM entry */
|
||||||
if (5 + namelen <= sua_free) {
|
if (5 + namelen <= sua_free) {
|
||||||
@ -2030,6 +1997,26 @@ int rrip_get_susp_fields(Ecma119Image *t, Ecma119Node *n, int type,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ce_is_predicted) {
|
if (ce_is_predicted) {
|
||||||
|
if ((info->ce_len % BLOCK_SIZE) &&
|
||||||
|
(info->ce_len + ce_len_pd - 1 ) / BLOCK_SIZE !=
|
||||||
|
info->ce_len / BLOCK_SIZE) {
|
||||||
|
/* Linux fs/isofs wants byte_offset + ce_len <= BLOCK_SIZE
|
||||||
|
* Insert padding to shift CE offset to next block start
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef Libisofs_ce_calc_debuG
|
||||||
|
|
||||||
|
fprintf(stderr,
|
||||||
|
"\nlibburn_DEBUG: Inserting %d bytes of CE padding : %s\n\n",
|
||||||
|
(int) (BLOCK_SIZE - (info->ce_len % BLOCK_SIZE)),
|
||||||
|
n->node->name);
|
||||||
|
|
||||||
|
#endif /* Libisofs_ce_calc_debuG */
|
||||||
|
|
||||||
|
ret = pseudo_susp_add_PAD(t, info);
|
||||||
|
if (ret < 0)
|
||||||
|
goto add_susp_cleanup;
|
||||||
|
}
|
||||||
/* Add the CE entry */
|
/* Add the CE entry */
|
||||||
ret = susp_add_CE(t, ce_len_pd, info);
|
ret = susp_add_CE(t, ce_len_pd, info);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
@ -2139,8 +2126,6 @@ int rrip_get_susp_fields(Ecma119Image *t, Ecma119Node *n, int type,
|
|||||||
|
|
||||||
/* Compute length of AAIP string of root node */
|
/* Compute length of AAIP string of root node */
|
||||||
aaip_sua_free= 0;
|
aaip_sua_free= 0;
|
||||||
/* (just to give t->curr_ce_entries a defined state) */
|
|
||||||
t->curr_ce_entries = 0;
|
|
||||||
ret = add_aa_string(t, n, NULL, &aaip_sua_free, &aaip_len, ce_mem,
|
ret = add_aa_string(t, n, NULL, &aaip_sua_free, &aaip_len, ce_mem,
|
||||||
1 | 2);
|
1 | 2);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
@ -2219,7 +2204,7 @@ int susp_update_CE_sizes(Ecma119Image *t, struct susp_info *info, int flag)
|
|||||||
curr_pos = 0;
|
curr_pos = 0;
|
||||||
for (i = info->current_ce_start; i < info->n_ce_susp_fields; i++) {
|
for (i = info->current_ce_start; i < info->n_ce_susp_fields; i++) {
|
||||||
if (info->ce_susp_fields[i][0] == 0) {
|
if (info->ce_susp_fields[i][0] == 0) {
|
||||||
/* ignore pseudo SUSP PAD */
|
curr_pos = 0; /* pseudo SUSP PAD */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (info->ce_susp_fields[i][0] == 'C' &&
|
if (info->ce_susp_fields[i][0] == 'C' &&
|
||||||
@ -2229,20 +2214,11 @@ int susp_update_CE_sizes(Ecma119Image *t, struct susp_info *info, int flag)
|
|||||||
size = BLOCK_SIZE;
|
size = BLOCK_SIZE;
|
||||||
iso_bb(curr_ce + 20, size, 4);
|
iso_bb(curr_ce + 20, size, 4);
|
||||||
curr_ce = info->ce_susp_fields[i];
|
curr_ce = info->ce_susp_fields[i];
|
||||||
/* Start a new CE Area */
|
|
||||||
curr_pos = 0;
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
curr_pos = (curr_pos + info->ce_susp_fields[i][2]) % 2048;
|
curr_pos = (curr_pos + info->ce_susp_fields[i][2]) % 2048;
|
||||||
}
|
}
|
||||||
if (curr_pos > 0) {
|
if (curr_pos > 0) {
|
||||||
size = curr_pos;
|
size = curr_pos % BLOCK_SIZE;
|
||||||
if (size > BLOCK_SIZE) {
|
|
||||||
/* Should never happen */
|
|
||||||
iso_msg_submit(t->image->id, ISO_WRONG_RR_WARN, 0,
|
|
||||||
"Encountered and truncated oversized Continuation Area");
|
|
||||||
size = BLOCK_SIZE;
|
|
||||||
}
|
|
||||||
iso_bb(curr_ce + 20, size, 4);
|
iso_bb(curr_ce + 20, size, 4);
|
||||||
}
|
}
|
||||||
return ISO_SUCCESS;
|
return ISO_SUCCESS;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Vreixo Formoso
|
* Copyright (c) 2007 Vreixo Formoso
|
||||||
* Copyright (c) 2007 Mario Danic
|
* Copyright (c) 2007 Mario Danic
|
||||||
* Copyright (c) 2009 - 2023 Thomas Schmitt
|
* Copyright (c) 2009 - 2020 Thomas Schmitt
|
||||||
*
|
*
|
||||||
* This file is part of the libisofs project; you can redistribute it and/or
|
* This file is part of the libisofs project; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License version 2
|
* modify it under the terms of the GNU General Public License version 2
|
||||||
@ -41,9 +41,6 @@
|
|||||||
|
|
||||||
#include "ecma119.h"
|
#include "ecma119.h"
|
||||||
|
|
||||||
/* For ssize_t */
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
|
|
||||||
#define SUSP_SIG(entry, a, b) ((entry->sig[0] == a) && (entry->sig[1] == b))
|
#define SUSP_SIG(entry, a, b) ((entry->sig[0] == a) && (entry->sig[1] == b))
|
||||||
|
|
||||||
@ -206,8 +203,8 @@ struct susp_sys_user_entry
|
|||||||
* @return
|
* @return
|
||||||
* The size needed for the RR entries in the System Use Area
|
* The size needed for the RR entries in the System Use Area
|
||||||
*/
|
*/
|
||||||
ssize_t rrip_calc_len(Ecma119Image *t, Ecma119Node *n, int type, size_t space,
|
size_t rrip_calc_len(Ecma119Image *t, Ecma119Node *n, int type, size_t space,
|
||||||
size_t *ce, size_t base_ce);
|
size_t *ce, size_t base_ce);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fill a struct susp_info with the RR/SUSP entries needed for a given
|
* Fill a struct susp_info with the RR/SUSP entries needed for a given
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Vreixo Formoso
|
* Copyright (c) 2007 Vreixo Formoso
|
||||||
* Copyright (c) 2009 - 2023 Thomas Schmitt
|
* Copyright (c) 2009 Thomas Schmitt
|
||||||
*
|
*
|
||||||
* This file is part of the libisofs project; you can redistribute it and/or
|
* This file is part of the libisofs project; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License version 2
|
* modify it under the terms of the GNU General Public License version 2
|
||||||
@ -38,9 +38,6 @@ struct susp_iterator
|
|||||||
/* Number of blocks in the ISO 9660 filesystem */
|
/* Number of blocks in the ISO 9660 filesystem */
|
||||||
uint32_t fs_blocks;
|
uint32_t fs_blocks;
|
||||||
|
|
||||||
/* For detecting (nearly) endless loops */
|
|
||||||
uint32_t ce_counter;
|
|
||||||
|
|
||||||
/* block and offset for next continuation area */
|
/* block and offset for next continuation area */
|
||||||
uint32_t ce_block;
|
uint32_t ce_block;
|
||||||
uint32_t ce_off;
|
uint32_t ce_off;
|
||||||
@ -68,10 +65,7 @@ susp_iter_new(IsoDataSource *src, struct ecma119_dir_record *record,
|
|||||||
iter->msgid = msgid;
|
iter->msgid = msgid;
|
||||||
iter->fs_blocks = fs_blocks;
|
iter->fs_blocks = fs_blocks;
|
||||||
|
|
||||||
iter->ce_counter = 0;
|
|
||||||
iter->ce_len = 0;
|
iter->ce_len = 0;
|
||||||
iter->ce_block = 0;
|
|
||||||
iter->ce_off = 0;
|
|
||||||
iter->buffer = NULL;
|
iter->buffer = NULL;
|
||||||
|
|
||||||
return iter;
|
return iter;
|
||||||
@ -80,9 +74,6 @@ susp_iter_new(IsoDataSource *src, struct ecma119_dir_record *record,
|
|||||||
/* More than 1 MiB in a single file's CE area is suspicious */
|
/* More than 1 MiB in a single file's CE area is suspicious */
|
||||||
#define ISO_SUSP_MAX_CE_BYTES (1024 * 1024)
|
#define ISO_SUSP_MAX_CE_BYTES (1024 * 1024)
|
||||||
|
|
||||||
/* More than 100000 CE entries in a file is suspicious */
|
|
||||||
#define ISO_SUSP_MAX_CE_HOPS 100000
|
|
||||||
|
|
||||||
|
|
||||||
/* @param flag bit0 = First call on root:
|
/* @param flag bit0 = First call on root:
|
||||||
Not yet clear whether this is SUSP at all
|
Not yet clear whether this is SUSP at all
|
||||||
@ -92,7 +83,6 @@ int susp_iter_next(SuspIterator *iter, struct susp_sys_user_entry **sue,
|
|||||||
{
|
{
|
||||||
struct susp_sys_user_entry *entry;
|
struct susp_sys_user_entry *entry;
|
||||||
|
|
||||||
process_entry:;
|
|
||||||
entry = (struct susp_sys_user_entry*)(iter->base + iter->pos);
|
entry = (struct susp_sys_user_entry*)(iter->base + iter->pos);
|
||||||
|
|
||||||
if (flag & 1) {
|
if (flag & 1) {
|
||||||
@ -104,9 +94,6 @@ process_entry:;
|
|||||||
if (entry->len_sue[0] < 7)
|
if (entry->len_sue[0] < 7)
|
||||||
return 0;
|
return 0;
|
||||||
/* Looks like SUSP enough to pass the further processing here. */
|
/* Looks like SUSP enough to pass the further processing here. */
|
||||||
|
|
||||||
/* In case of CE hop do not run this check again */
|
|
||||||
flag &= ~1;
|
|
||||||
}
|
}
|
||||||
if ( (iter->pos + 4 > iter->size) || (SUSP_SIG(entry, 'S', 'T'))) {
|
if ( (iter->pos + 4 > iter->size) || (SUSP_SIG(entry, 'S', 'T'))) {
|
||||||
|
|
||||||
@ -164,9 +151,9 @@ process_entry:;
|
|||||||
if (iter->ce_len) {
|
if (iter->ce_len) {
|
||||||
int ret;
|
int ret;
|
||||||
ret = iso_msg_submit(iter->msgid, ISO_UNSUPPORTED_SUSP, 0,
|
ret = iso_msg_submit(iter->msgid, ISO_UNSUPPORTED_SUSP, 0,
|
||||||
"More than one CE System user entry was found in a single "
|
"More than one CE System user entry has found in a single "
|
||||||
"System Use field or continuation area. This breaks SUSP "
|
"System Use field or continuation area. This breaks SUSP "
|
||||||
"standard and is not supported. Ignoring last CE. Maybe "
|
"standard and it's not supported. Ignoring last CE. Maybe "
|
||||||
"the image is damaged.");
|
"the image is damaged.");
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
return ret;
|
return ret;
|
||||||
@ -178,15 +165,10 @@ process_entry:;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* we don't want to return CE entry to the user */
|
/* we don't want to return CE entry to the user */
|
||||||
if (++(iter->ce_counter) > ISO_SUSP_MAX_CE_HOPS) {
|
return susp_iter_next(iter, sue, 0);
|
||||||
iso_msg_submit(iter->msgid, ISO_WRONG_RR, 0,
|
|
||||||
"Damaged RR/SUSP information: Too many CE hops.");
|
|
||||||
return ISO_WRONG_RR;
|
|
||||||
}
|
|
||||||
goto process_entry;
|
|
||||||
} else if (SUSP_SIG(entry, 'P', 'D')) {
|
} else if (SUSP_SIG(entry, 'P', 'D')) {
|
||||||
/* skip padding */
|
/* skip padding */
|
||||||
goto process_entry;
|
return susp_iter_next(iter, sue, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
*sue = entry;
|
*sue = entry;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Vreixo Formoso
|
* Copyright (c) 2007 Vreixo Formoso
|
||||||
* Copyright (c) 2009 - 2022 Thomas Schmitt
|
* Copyright (c) 2009 - 2015 Thomas Schmitt
|
||||||
*
|
*
|
||||||
* This file is part of the libisofs project; you can redistribute it and/or
|
* This file is part of the libisofs project; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License version 2
|
* modify it under the terms of the GNU General Public License version 2
|
||||||
@ -330,7 +330,6 @@ int cut_out_open(IsoStream *stream)
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
struct stat info;
|
struct stat info;
|
||||||
off_t src_size, pos;
|
|
||||||
IsoFileSource *src;
|
IsoFileSource *src;
|
||||||
struct cut_out_stream *data;
|
struct cut_out_stream *data;
|
||||||
|
|
||||||
@ -349,26 +348,20 @@ int cut_out_open(IsoStream *stream)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (S_ISREG(info.st_mode)) {
|
{
|
||||||
src_size= info.st_size;
|
off_t ret;
|
||||||
} else {
|
if (data->offset > info.st_size) {
|
||||||
/* Determine src_size and lseekability of device */
|
/* file is smaller than expected */
|
||||||
src_size = iso_file_source_determine_capacity(src,
|
ret = iso_file_source_lseek(src, info.st_size, 0);
|
||||||
data->offset + data->size, 2);
|
} else {
|
||||||
if (src_size <= 0)
|
ret = iso_file_source_lseek(src, data->offset, 0);
|
||||||
return ISO_WRONG_ARG_VALUE;
|
}
|
||||||
}
|
if (ret < 0) {
|
||||||
if (data->offset > src_size) {
|
return (int) ret;
|
||||||
/* file is smaller than expected */
|
}
|
||||||
pos = iso_file_source_lseek(src, src_size, 0);
|
|
||||||
} else {
|
|
||||||
pos = iso_file_source_lseek(src, data->offset, 0);
|
|
||||||
}
|
|
||||||
if (pos < 0) {
|
|
||||||
return (int) pos;
|
|
||||||
}
|
}
|
||||||
data->pos = 0;
|
data->pos = 0;
|
||||||
if (data->offset + data->size > src_size) {
|
if (data->offset + data->size > info.st_size) {
|
||||||
return 3; /* file smaller than expected */
|
return 3; /* file smaller than expected */
|
||||||
} else {
|
} else {
|
||||||
return ISO_SUCCESS;
|
return ISO_SUCCESS;
|
||||||
@ -515,7 +508,6 @@ int iso_cut_out_stream_new(IsoFileSource *src, off_t offset, off_t size,
|
|||||||
IsoStream **stream)
|
IsoStream **stream)
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
off_t src_size;
|
|
||||||
struct stat info;
|
struct stat info;
|
||||||
IsoStream *str;
|
IsoStream *str;
|
||||||
struct cut_out_stream *data;
|
struct cut_out_stream *data;
|
||||||
@ -531,16 +523,10 @@ int iso_cut_out_stream_new(IsoFileSource *src, off_t offset, off_t size,
|
|||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
if (!S_ISREG(info.st_mode)) {
|
||||||
if (S_ISREG(info.st_mode)) {
|
return ISO_WRONG_ARG_VALUE;
|
||||||
src_size = info.st_size;
|
|
||||||
} else {
|
|
||||||
/* Open src, do iso_source_lseek(SEEK_END), close src */
|
|
||||||
src_size = iso_file_source_determine_capacity(src, offset + size, 3);
|
|
||||||
if (src_size <= 0)
|
|
||||||
return ISO_WRONG_ARG_VALUE;
|
|
||||||
}
|
}
|
||||||
if (offset > src_size) {
|
if (offset > info.st_size) {
|
||||||
return ISO_FILE_OFFSET_TOO_BIG;
|
return ISO_FILE_OFFSET_TOO_BIG;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -565,7 +551,7 @@ int iso_cut_out_stream_new(IsoFileSource *src, off_t offset, off_t size,
|
|||||||
iso_file_source_ref(src);
|
iso_file_source_ref(src);
|
||||||
|
|
||||||
data->offset = offset;
|
data->offset = offset;
|
||||||
data->size = MIN(src_size - offset, size);
|
data->size = MIN(info.st_size - offset, size);
|
||||||
|
|
||||||
/* get the id numbers */
|
/* get the id numbers */
|
||||||
data->dev_id = (dev_t) 0;
|
data->dev_id = (dev_t) 0;
|
||||||
@ -866,24 +852,12 @@ void iso_stream_get_file_name(IsoStream *stream, char *name)
|
|||||||
strncpy(name, path, PATH_MAX - 1);
|
strncpy(name, path, PATH_MAX - 1);
|
||||||
name[PATH_MAX - 1] = 0;
|
name[PATH_MAX - 1] = 0;
|
||||||
free(path);
|
free(path);
|
||||||
} else if (!strncmp(type, "cout", 4)) {
|
|
||||||
strcpy(name, "CUT_OUT FILE");
|
|
||||||
} else if (!strncmp(type, "mem ", 4)) {
|
|
||||||
strcpy(name, "MEM SOURCE");
|
|
||||||
} else if (!strncmp(type, "boot", 4)) {
|
} else if (!strncmp(type, "boot", 4)) {
|
||||||
strcpy(name, "BOOT CATALOG");
|
strcpy(name, "BOOT CATALOG");
|
||||||
|
} else if (!strncmp(type, "mem ", 4)) {
|
||||||
|
strcpy(name, "MEM SOURCE");
|
||||||
} else if (!strncmp(type, "extf", 4)) {
|
} else if (!strncmp(type, "extf", 4)) {
|
||||||
strcpy(name, "EXTERNAL FILTER");
|
strcpy(name, "EXTERNAL FILTER");
|
||||||
} else if (!strncmp(type, "ziso", 4)) {
|
|
||||||
strcpy(name, "ZISOFS COMPRESSION FILTER");
|
|
||||||
} else if (!strncmp(type, "osiz", 4)) {
|
|
||||||
strcpy(name, "ZISOFS DECOMPRESSION FILTER");
|
|
||||||
} else if (!strncmp(type, "gzip", 4)) {
|
|
||||||
strcpy(name, "GZIP COMPRESSION FILTER");
|
|
||||||
} else if (!strncmp(type, "pizg", 4)) {
|
|
||||||
strcpy(name, "GZIP DECOMPRESSION FILTER");
|
|
||||||
} else if (!strncmp(type, "user", 4)) {
|
|
||||||
strcpy(name, "USER SUPPLIED STREAM");
|
|
||||||
} else {
|
} else {
|
||||||
strcpy(name, "UNKNOWN SOURCE");
|
strcpy(name, "UNKNOWN SOURCE");
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2008 Vreixo Formoso
|
* Copyright (c) 2008 Vreixo Formoso
|
||||||
* Copyright (c) 2010 - 2022 Thomas Schmitt
|
* Copyright (c) 2010 - 2019 Thomas Schmitt
|
||||||
*
|
*
|
||||||
* This file is part of the libisofs project; you can redistribute it and/or
|
* This file is part of the libisofs project; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License version 2
|
* modify it under the terms of the GNU General Public License version 2
|
||||||
@ -1737,7 +1737,6 @@ static int iso_write_gpt(Ecma119Image *t, uint32_t img_blocks, uint8_t *buf)
|
|||||||
|
|
||||||
uint32_t p_arr_crc = 0;
|
uint32_t p_arr_crc = 0;
|
||||||
uint64_t start_lba, end_lba, goal, part_end, next_end, backup_end_lba;
|
uint64_t start_lba, end_lba, goal, part_end, next_end, backup_end_lba;
|
||||||
uint64_t eff_gpt_flags;
|
|
||||||
int ret, i, gap_counter = 0, up_to;
|
int ret, i, gap_counter = 0, up_to;
|
||||||
struct iso_gpt_partition_request *req;
|
struct iso_gpt_partition_request *req;
|
||||||
uint8_t gpt_name[72];
|
uint8_t gpt_name[72];
|
||||||
@ -1792,16 +1791,11 @@ static int iso_write_gpt(Ecma119Image *t, uint32_t img_blocks, uint8_t *buf)
|
|||||||
} else if (part_end < goal) {
|
} else if (part_end < goal) {
|
||||||
memset(gpt_name, 0, 72);
|
memset(gpt_name, 0, 72);
|
||||||
type_guid = basic_data_uuid;
|
type_guid = basic_data_uuid;
|
||||||
eff_gpt_flags= gpt_flags;
|
|
||||||
if (goal == t->vol_space_size * (uint64_t) 4 &&
|
if (goal == t->vol_space_size * (uint64_t) 4 &&
|
||||||
part_end == t->opts->partition_offset * (uint64_t) 4) {
|
part_end == t->opts->partition_offset * (uint64_t) 4) {
|
||||||
sprintf((char *) gpt_name, "ISO9660");
|
sprintf((char *) gpt_name, "ISO9660");
|
||||||
if (t->opts->iso_gpt_flag & 1)
|
if (t->opts->iso_gpt_flag & 1)
|
||||||
type_guid = t->opts->iso_gpt_type_guid;
|
type_guid = t->opts->iso_gpt_type_guid;
|
||||||
if (t->system_area_options & (1 << 16))
|
|
||||||
eff_gpt_flags|= 4; /* Legacy BIOS bootable */
|
|
||||||
if (t->system_area_options & (1 << 17))
|
|
||||||
eff_gpt_flags&= ~(((uint64_t) 1) << 60);/* Not read-only */
|
|
||||||
} else {
|
} else {
|
||||||
sprintf((char *) gpt_name, "Gap%d", gap_counter);
|
sprintf((char *) gpt_name, "Gap%d", gap_counter);
|
||||||
}
|
}
|
||||||
@ -1810,7 +1804,7 @@ static int iso_write_gpt(Ecma119Image *t, uint32_t img_blocks, uint8_t *buf)
|
|||||||
ret = iso_quick_gpt_entry(t->gpt_req, &(t->gpt_req_count),
|
ret = iso_quick_gpt_entry(t->gpt_req, &(t->gpt_req_count),
|
||||||
part_end, goal - part_end,
|
part_end, goal - part_end,
|
||||||
type_guid, zero_uuid,
|
type_guid, zero_uuid,
|
||||||
eff_gpt_flags, gpt_name);
|
gpt_flags, gpt_name);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
/* Mark as automatically placed filler request */
|
/* Mark as automatically placed filler request */
|
||||||
@ -1881,56 +1875,6 @@ static void iso_dummy_mbr_partition(uint8_t *buf, int mode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* flag bit0= only accept partition 1 as match for partition_offset
|
|
||||||
*/
|
|
||||||
static
|
|
||||||
int iso_ensure_mbr_part_table(Ecma119Image *t, uint32_t img_blocks,
|
|
||||||
uint8_t *buf, int flag)
|
|
||||||
{
|
|
||||||
int part_type, ret, i, found_part = 0;
|
|
||||||
uint32_t start_lba, num_blocks;
|
|
||||||
|
|
||||||
/* Look for MBR partition which starts at t->opts->partition_offset * 4
|
|
||||||
and has non-zero length
|
|
||||||
*/
|
|
||||||
if (buf[510] == 0x55 && buf[511] == 0xaa &&
|
|
||||||
t->opts->partition_offset < 0x3fffffff && img_blocks < 0x3fffffff ) {
|
|
||||||
for (i = 0; i < 4; i++) {
|
|
||||||
start_lba = iso_read_lsb(buf + 446 + i * 16 + 8, 4);
|
|
||||||
num_blocks = iso_read_lsb(buf + 446 + i * 16 + 12, 4);
|
|
||||||
if (t->opts->partition_offset * 4 == start_lba && num_blocks > 0) {
|
|
||||||
found_part = i + 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (flag & 1)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (found_part > 0) {
|
|
||||||
/* Update size fields in found_part */
|
|
||||||
part_type = buf[446 + (found_part - 1) * 16 + 4];
|
|
||||||
if (t->opts->iso_mbr_part_type >= 0 &&
|
|
||||||
t->opts->iso_mbr_part_type <= 255)
|
|
||||||
part_type= t->opts->iso_mbr_part_type;
|
|
||||||
ret = write_mbr_partition_entry(found_part, part_type,
|
|
||||||
start_lba, img_blocks * 4,
|
|
||||||
t->partition_secs_per_head,
|
|
||||||
t->partition_heads_per_cyl, buf, 2);
|
|
||||||
} else {
|
|
||||||
part_type = 0xcd;
|
|
||||||
if (t->opts->iso_mbr_part_type >= 0 &&
|
|
||||||
t->opts->iso_mbr_part_type <= 255)
|
|
||||||
part_type= t->opts->iso_mbr_part_type;
|
|
||||||
ret = make_grub_msdos_label(img_blocks, t->partition_secs_per_head,
|
|
||||||
t->partition_heads_per_cyl,
|
|
||||||
(uint8_t) part_type, buf, 2);
|
|
||||||
}
|
|
||||||
if (ret != ISO_SUCCESS) /* error should never happen */
|
|
||||||
return ISO_ASSERT_FAILURE;
|
|
||||||
return ISO_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* @param flag
|
/* @param flag
|
||||||
bit0= t->opts->ms_block is not counted in t->total_size
|
bit0= t->opts->ms_block is not counted in t->total_size
|
||||||
*/
|
*/
|
||||||
@ -2006,10 +1950,8 @@ int iso_write_system_area(Ecma119Image *t, uint8_t *buf, int flag)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
apm_flag = 0;
|
apm_flag = 0;
|
||||||
if (sa_type == 0 && ((t->system_area_options & 3) == 2 ||
|
if (sa_type == 0 && (t->system_area_options & 3) == 2) {
|
||||||
t->opts->part_like_isohybrid)) {
|
do_isohybrid = 1;
|
||||||
if (sa_type == 0 && (t->system_area_options & 3) == 2)
|
|
||||||
do_isohybrid = 1;
|
|
||||||
|
|
||||||
/* >>> Coordinate with partprepend writer */
|
/* >>> Coordinate with partprepend writer */
|
||||||
/* <<< provisory trap */
|
/* <<< provisory trap */
|
||||||
@ -2080,29 +2022,23 @@ int iso_write_system_area(Ecma119Image *t, uint8_t *buf, int flag)
|
|||||||
/* >>> ??? change first partition type to 0xee */;
|
/* >>> ??? change first partition type to 0xee */;
|
||||||
|
|
||||||
}
|
}
|
||||||
} else if (do_isohybrid || t->opts->part_like_isohybrid) {
|
} else if (do_isohybrid) {
|
||||||
/* Patch externally provided system area as isohybrid MBR
|
/* Patch externally provided system area as isohybrid MBR */
|
||||||
or at least write an MBR partition table as of isohybrid
|
if (t->catalog == NULL || t->system_area_data == NULL) {
|
||||||
*/
|
|
||||||
if ((t->catalog == NULL || t->system_area_data == NULL) &&
|
|
||||||
do_isohybrid) {
|
|
||||||
/* isohybrid makes only sense together with ISOLINUX boot image
|
/* isohybrid makes only sense together with ISOLINUX boot image
|
||||||
and externally provided System Area.
|
and externally provided System Area.
|
||||||
*/
|
*/
|
||||||
return ISO_ISOLINUX_CANT_PATCH;
|
return ISO_ISOLINUX_CANT_PATCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gpt_count > 0 || apm_count > 0) {
|
if (gpt_count > 0 || apm_count > 0)
|
||||||
/* Decision can be revoked in make_isolinux_mbr if !do_isohybrid */
|
|
||||||
part_type = 0x00;
|
part_type = 0x00;
|
||||||
} else {
|
else {
|
||||||
part_type = 0x17;
|
part_type = 0x17;
|
||||||
}
|
|
||||||
/* By tradition, real isohybrid insists in 0x00 if GPT or APM */
|
|
||||||
if (part_type != 0x00 || !do_isohybrid)
|
|
||||||
if (t->opts->iso_mbr_part_type >= 0 &&
|
if (t->opts->iso_mbr_part_type >= 0 &&
|
||||||
t->opts->iso_mbr_part_type <= 255)
|
t->opts->iso_mbr_part_type <= 255)
|
||||||
part_type= t->opts->iso_mbr_part_type;
|
part_type= t->opts->iso_mbr_part_type;
|
||||||
|
}
|
||||||
|
|
||||||
if (t->opts->appended_as_gpt && t->have_appended_partitions) {
|
if (t->opts->appended_as_gpt && t->have_appended_partitions) {
|
||||||
part_type = 0xee;
|
part_type = 0xee;
|
||||||
@ -2111,16 +2047,13 @@ int iso_write_system_area(Ecma119Image *t, uint8_t *buf, int flag)
|
|||||||
no_boot_mbr = 2;
|
no_boot_mbr = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ??? Why was partition_offset 0 here ?
|
/* >>> ??? Why is partition_offset 0 here ?
|
||||||
It gets adjusted later by iso_offset_partition_start()
|
It gets adjusted later by iso_offset_partition_start()
|
||||||
Does it harm to give the real offset here ?
|
Would it harm to give the real offset here ?
|
||||||
Now this is really needed for checking whether partitions
|
*/;
|
||||||
are inside the ISO 9660 partition if !do_isohybrid
|
|
||||||
*/
|
ret = make_isolinux_mbr(&img_blocks, t, 0, 1, part_type, buf,
|
||||||
ret = make_isolinux_mbr(&img_blocks, t, t->opts->partition_offset * 4,
|
1 | no_boot_mbr);
|
||||||
1, part_type, buf,
|
|
||||||
1 | no_boot_mbr | ((!do_isohybrid) << 2) |
|
|
||||||
((!do_isohybrid) << 3));
|
|
||||||
if (ret != 1)
|
if (ret != 1)
|
||||||
return ret;
|
return ret;
|
||||||
} else if (sa_type == 1) {
|
} else if (sa_type == 1) {
|
||||||
@ -2146,9 +2079,14 @@ int iso_write_system_area(Ecma119Image *t, uint8_t *buf, int flag)
|
|||||||
return ret;
|
return ret;
|
||||||
} else if ((t->opts->partition_offset > 0 || will_append) &&
|
} else if ((t->opts->partition_offset > 0 || will_append) &&
|
||||||
sa_type == 0 && t->mbr_req_count == 0) {
|
sa_type == 0 && t->mbr_req_count == 0) {
|
||||||
ret= iso_ensure_mbr_part_table(t, img_blocks, buf,
|
/* Write a simple partition table. */
|
||||||
((t->opts->appended_as_gpt && t->have_appended_partitions) ||
|
part_type = 0xcd;
|
||||||
t->opts->partition_offset == 0));
|
if (t->opts->iso_mbr_part_type >= 0 &&
|
||||||
|
t->opts->iso_mbr_part_type <= 255)
|
||||||
|
part_type= t->opts->iso_mbr_part_type;
|
||||||
|
ret = make_grub_msdos_label(img_blocks, t->partition_secs_per_head,
|
||||||
|
t->partition_heads_per_cyl,
|
||||||
|
(uint8_t) part_type, buf, 2);
|
||||||
if (ret != ISO_SUCCESS) /* error should never happen */
|
if (ret != ISO_SUCCESS) /* error should never happen */
|
||||||
return ISO_ASSERT_FAILURE;
|
return ISO_ASSERT_FAILURE;
|
||||||
risk_of_ee = 1;
|
risk_of_ee = 1;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Vreixo Formoso
|
* Copyright (c) 2007 Vreixo Formoso
|
||||||
* Copyright (c) 2011 - 2022 Thomas Schmitt
|
* Copyright (c) 2011 - 2015 Thomas Schmitt
|
||||||
*
|
*
|
||||||
* This file is part of the libisofs project; you can redistribute it and/or
|
* This file is part of the libisofs project; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License version 2
|
* modify it under the terms of the GNU General Public License version 2
|
||||||
@ -24,7 +24,6 @@
|
|||||||
#include "messages.h"
|
#include "messages.h"
|
||||||
#include "tree.h"
|
#include "tree.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "ecma119.h"
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -678,7 +677,6 @@ int iso_tree_add_new_cut_out_node(IsoImage *image, IsoDir *parent,
|
|||||||
IsoNode **node)
|
IsoNode **node)
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
off_t src_size;
|
|
||||||
struct stat info;
|
struct stat info;
|
||||||
IsoFilesystem *fs;
|
IsoFilesystem *fs;
|
||||||
IsoFileSource *src;
|
IsoFileSource *src;
|
||||||
@ -717,22 +715,17 @@ int iso_tree_add_new_cut_out_node(IsoImage *image, IsoDir *parent,
|
|||||||
iso_file_source_unref(src);
|
iso_file_source_unref(src);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
if (!S_ISREG(info.st_mode)) {
|
||||||
if (S_ISREG(info.st_mode)) {
|
return ISO_WRONG_ARG_VALUE;
|
||||||
src_size = info.st_size;
|
|
||||||
} else {
|
|
||||||
src_size = iso_file_source_determine_capacity(src, offset + size, 3);
|
|
||||||
if (src_size <= 0)
|
|
||||||
return ISO_WRONG_ARG_VALUE;
|
|
||||||
}
|
}
|
||||||
if (offset >= src_size) {
|
if (offset >= info.st_size) {
|
||||||
return ISO_WRONG_ARG_VALUE;
|
return ISO_WRONG_ARG_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* force regular file */
|
/* force regular file */
|
||||||
result = image->builder->create_file(image->builder, image, src, &new);
|
result = image->builder->create_file(image->builder, image, src, &new);
|
||||||
|
|
||||||
/* Give up the newly acquired surplus reference to src */
|
/* free the file */
|
||||||
iso_file_source_unref(src);
|
iso_file_source_unref(src);
|
||||||
|
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
@ -1052,17 +1045,6 @@ int iso_add_dir_src_rec(IsoImage *image, IsoDir *parent, IsoFileSource *dir)
|
|||||||
"Error when adding file %s", path);
|
"Error when adding file %s", path);
|
||||||
goto dir_rec_continue;
|
goto dir_rec_continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (image->do_deeper_tree_inspection) {
|
|
||||||
if (image->tree_loaded == 0 && image->rr_loaded == 0) {
|
|
||||||
iso_image_assess_ecma119_name(image, &info, path, name);
|
|
||||||
} else if (image->tree_loaded == 1) {
|
|
||||||
iso_image_assess_joliet_name(image, &info, path, name);
|
|
||||||
}
|
|
||||||
if (info.st_size > MAX_ISO_FILE_SECTION_SIZE &&
|
|
||||||
image->tree_compliance != NULL)
|
|
||||||
image->tree_compliance->iso_level = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (check_excludes(image, path)) {
|
if (check_excludes(image, path)) {
|
||||||
iso_msg_debug(image->id, "Skipping excluded file %s", path);
|
iso_msg_debug(image->id, "Skipping excluded file %s", path);
|
||||||
@ -1453,8 +1435,6 @@ int iso_tree_clone_file(IsoFile *old_file,
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto ex;
|
goto ex;
|
||||||
new_stream = NULL; /* now owned by new_file */
|
new_stream = NULL; /* now owned by new_file */
|
||||||
new_file->from_old_session = old_file->from_old_session;
|
|
||||||
new_file->explicit_weight = old_file->explicit_weight;
|
|
||||||
new_file->sort_weight = old_file->sort_weight;
|
new_file->sort_weight = old_file->sort_weight;
|
||||||
*new_node = (IsoNode *) new_file;
|
*new_node = (IsoNode *) new_file;
|
||||||
ret = ISO_SUCCESS;
|
ret = ISO_SUCCESS;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Vreixo Formoso
|
* Copyright (c) 2007 Vreixo Formoso
|
||||||
* Copyright (c) 2007 Mario Danic
|
* Copyright (c) 2007 Mario Danic
|
||||||
* Copyright (c) 2009 - 2022 Thomas Schmitt
|
* Copyright (c) 2009 - 2019 Thomas Schmitt
|
||||||
*
|
*
|
||||||
* This file is part of the libisofs project; you can redistribute it and/or
|
* This file is part of the libisofs project; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License version 2
|
* modify it under the terms of the GNU General Public License version 2
|
||||||
@ -803,18 +803,18 @@ int str2utf16be(const char *icharset, const char *input, uint16_t **output)
|
|||||||
return ISO_SUCCESS;
|
return ISO_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int valid_d_char(char c)
|
static int valid_d_char(char c)
|
||||||
{
|
{
|
||||||
return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') || (c == '_');
|
return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') || (c == '_');
|
||||||
}
|
}
|
||||||
|
|
||||||
int valid_a_char(char c)
|
static int valid_a_char(char c)
|
||||||
{
|
{
|
||||||
return (c >= ' ' && c <= '"') || (c >= '%' && c <= '?') ||
|
return (c >= ' ' && c <= '"') || (c >= '%' && c <= '?') ||
|
||||||
(c >= 'A' && c <= 'Z') || (c == '_');
|
(c >= 'A' && c <= 'Z') || (c == '_');
|
||||||
}
|
}
|
||||||
|
|
||||||
int valid_j_char(uint16_t c)
|
static int valid_j_char(uint16_t c)
|
||||||
{
|
{
|
||||||
return cmp_ucsbe(&c, ' ') != -1 && cmp_ucsbe(&c, '*') && cmp_ucsbe(&c, '/')
|
return cmp_ucsbe(&c, ' ') != -1 && cmp_ucsbe(&c, '*') && cmp_ucsbe(&c, '/')
|
||||||
&& cmp_ucsbe(&c, ':') && cmp_ucsbe(&c, ';') && cmp_ucsbe(&c, '?')
|
&& cmp_ucsbe(&c, ':') && cmp_ucsbe(&c, ';') && cmp_ucsbe(&c, '?')
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Vreixo Formoso
|
* Copyright (c) 2007 Vreixo Formoso
|
||||||
* Copyright (c) 2009 - 2022 Thomas Schmitt
|
* Copyright (c) 2009 - 2012 Thomas Schmitt
|
||||||
*
|
*
|
||||||
* This file is part of the libisofs project; you can redistribute it and/or
|
* This file is part of the libisofs project; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License version 2
|
* modify it under the terms of the GNU General Public License version 2
|
||||||
@ -263,12 +263,6 @@ void iso_handle_split_utf16(uint16_t *utf_word);
|
|||||||
int str2d_char(const char *icharset, const char *input, char **output);
|
int str2d_char(const char *icharset, const char *input, char **output);
|
||||||
int str2a_char(const char *icharset, const char *input, char **output);
|
int str2a_char(const char *icharset, const char *input, char **output);
|
||||||
|
|
||||||
/* Check for membership in the d-, a-, or j-character set */
|
|
||||||
int valid_d_char(char c);
|
|
||||||
int valid_a_char(char c);
|
|
||||||
int valid_j_char(uint16_t c);
|
|
||||||
|
|
||||||
|
|
||||||
void iso_lsb(uint8_t *buf, uint32_t num, int bytes);
|
void iso_lsb(uint8_t *buf, uint32_t num, int bytes);
|
||||||
void iso_lsb64(uint8_t *buf, uint64_t num);
|
void iso_lsb64(uint8_t *buf, uint64_t num);
|
||||||
void iso_msb(uint8_t *buf, uint32_t num, int bytes);
|
void iso_msb(uint8_t *buf, uint32_t num, int bytes);
|
||||||
|
Loading…
Reference in New Issue
Block a user