Skip to content

Commit

Permalink
add patch 1.8 ~ 1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
orangesnn committed Dec 18, 2020
1 parent 5590141 commit a4de793
Show file tree
Hide file tree
Showing 15 changed files with 123 additions and 53 deletions.
2 changes: 1 addition & 1 deletion doc/icedax/tracknames.pl
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/local/bin/perl
#!/usr/bin/perl
# A quick perl hack to get rename files pulled in with icedax.
# by [email protected]
#
Expand Down
8 changes: 4 additions & 4 deletions genisoimage/diag/dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ main(int argc, char *argv[])
do {
if (file_addr < (off_t)0) file_addr = (off_t)0;
showblock(1);
read(STDIN_FILENO, &c, 1); /* FIXME: check return value */
do{int ret;ret=read(STDIN_FILENO, &c, 1);}while(0); /* FIXME: check return value */
if (c == 'a')
file_addr -= PAGE;
if (c == 'b')
Expand All @@ -378,11 +378,11 @@ main(int argc, char *argv[])
printf("Enter new starting block (in hex):");
if (sizeof (file_addr) > sizeof (long)) {
Llong ll;
scanf("%llx", &ll); /* FIXME: check return value */
do{int ret;ret=scanf("%llx", &ll);}while(0); /* FIXME: check return value */
file_addr = (off_t)ll;
} else {
long l;
scanf("%lx", &l); /* FIXME: check return value */
do{int ret;ret=scanf("%lx", &l);}while(0); /* FIXME: check return value */
file_addr = (off_t)l;
}
file_addr = file_addr << 11;
Expand All @@ -392,7 +392,7 @@ main(int argc, char *argv[])
if (c == 'f') {
crsr2(20, 1);
printf("Enter new search string:");
fgets((char *)search, sizeof (search), stdin); /* FIXME: check return value */
do{char *ret;ret=fgets((char *)search, sizeof (search), stdin);}while(0); /* FIXME: check return value */
while (search[strlen((char *)search)-1] == '\n')
search[strlen((char *)search)-1] = 0;
crsr2(20, 1);
Expand Down
8 changes: 4 additions & 4 deletions genisoimage/diag/isodump.c
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ main(int argc, char *argv[])
if (file_addr < 0)
file_addr = (off_t)0;
showblock(1);
read(STDIN_FILENO, &c, 1); /* FIXME: check return value */
do{int ret;ret=read(STDIN_FILENO, &c, 1);}while(0); /* FIXME: check return value */
if (c == 'a')
file_addr -= blocksize;
if (c == 'b')
Expand All @@ -665,11 +665,11 @@ main(int argc, char *argv[])
printf("Enter new starting block (in hex):");
if (sizeof (file_addr) > sizeof (long)) {
Llong ll;
scanf("%llx", &ll); /* FIXME: check return value */
do{int ret;ret=scanf("%llx", &ll);}while(0); /* FIXME: check return value */
file_addr = (off_t)ll;
} else {
long l;
scanf("%lx", &l); /* FIXME: check return value */
do{int ret;ret=scanf("%lx", &l);}while(0); /* FIXME: check return value */
file_addr = (off_t)l;
}
file_addr = file_addr * blocksize;
Expand All @@ -679,7 +679,7 @@ main(int argc, char *argv[])
if (c == 'f') {
crsr2(20, 1);
printf("Enter new search string:");
fgets((char *)search, sizeof (search), stdin); /* FIXME: check return value */
do{char *ret;ret=fgets((char *)search, sizeof (search), stdin);}while(0); /* FIXME: check return value */
while (search[strlen((char *)search)-1] == '\n')
search[strlen((char *)search)-1] = 0;
crsr2(20, 1);
Expand Down
2 changes: 1 addition & 1 deletion genisoimage/diag/isoinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ extract_file(struct iso_directory_record *idr)
#endif
len -= tlen;
extent++;
write(STDOUT_FILENO, buff, tlen); /* FIXME: check return value */
do{int ret;ret=write(STDOUT_FILENO, buff, tlen);}while(0); /* FIXME: check return value */
}
}

Expand Down
4 changes: 2 additions & 2 deletions genisoimage/diag/isovfy.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,11 +591,11 @@ check_path_tables(int typel_extent, int typem_extent, int path_table_size)
readsecs(typel_extent * blocksize / 2048, typel, ISO_BLOCKS(path_table_size));
#else
lseek(fileno(infile), (off_t)((off_t)typel_extent) * blocksize, SEEK_SET);
read(fileno(infile), typel, path_table_size); /* FIXME: check return value */
do{int ret;ret=read(fileno(infile), typel, path_table_size);}while(0); /* FIXME: check return value */
#endif
typem = (char *) malloc(path_table_size);
lseek(fileno(infile), (off_t)((off_t)typem_extent) * blocksize, SEEK_SET);
read(fileno(infile), typem, path_table_size); /* FIXME: check return value */
do{int ret;ret=read(fileno(infile), typem, path_table_size);}while(0); /* FIXME: check return value */

j = path_table_size;
pnt = typel;
Expand Down
60 changes: 53 additions & 7 deletions genisoimage/eltorito.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static void get_torito_desc(struct eltorito_boot_descriptor *boot_desc);
static void fill_boot_desc(struct eltorito_defaultboot_entry *boot_desc_entry,
struct eltorito_boot_entry_info *boot_entry);
void get_boot_entry(void);
void new_boot_entry(void);
void new_boot_entry();
static int tvd_write(FILE *outfile);


Expand Down Expand Up @@ -283,6 +283,7 @@ get_torito_desc(struct eltorito_boot_descriptor *boot_desc)
int i;
int offset;
struct eltorito_defaultboot_entry boot_desc_record;
struct eltorito_sectionheader_entry section_header;

memset(boot_desc, 0, sizeof (*boot_desc));
boot_desc->type[0] = 0;
Expand Down Expand Up @@ -317,7 +318,7 @@ get_torito_desc(struct eltorito_boot_descriptor *boot_desc)
*/
memset(&valid_desc, 0, sizeof (valid_desc));
valid_desc.headerid[0] = 1;
valid_desc.arch[0] = EL_TORITO_ARCH_x86;
valid_desc.arch[0] = first_boot_entry->arch;

/*
* we'll shove start of publisher id into id field,
Expand Down Expand Up @@ -347,10 +348,53 @@ get_torito_desc(struct eltorito_boot_descriptor *boot_desc)
/* now write it to the virtual boot catalog */
memcpy(de2->table, &valid_desc, 32);

for (current_boot_entry = first_boot_entry, offset = sizeof (valid_desc);
current_boot_entry != NULL;
current_boot_entry = current_boot_entry->next,
offset += sizeof (boot_desc_record)) {
/* Fill the first entry, since it's special and already has the
* matching header via the validation header... */
offset = sizeof (valid_desc);
current_boot_entry = first_boot_entry;

if (offset >= SECTOR_SIZE) {
#ifdef USE_LIBSCHILY
comerrno(EX_BAD, "Too many El Torito boot entries\n");
#else
fprintf(stderr, "Too many El Torito boot entries\n");
exit(1);
#endif
}
fill_boot_desc(&boot_desc_record, current_boot_entry);
memcpy(de2->table + offset, &boot_desc_record,
sizeof (boot_desc_record));

offset += sizeof(boot_desc_record);

for (current_boot_entry = current_boot_entry->next;
current_boot_entry != NULL;
current_boot_entry = current_boot_entry->next) {
struct eltorito_sectionheader_entry section_header;

if (offset >= SECTOR_SIZE) {
#ifdef USE_LIBSCHILY
comerrno(EX_BAD,
"Too many El Torito boot entries\n");
#else
fprintf(stderr,
"Too many El Torito boot entries\n");
exit(1);
#endif
}

memset(&section_header, '\0', sizeof(section_header));
if (current_boot_entry->next)
section_header.headerid[0] = EL_TORITO_SECTION_HEADER;
else
section_header.headerid[0] = EL_TORITO_LAST_SECTION_HEADER;

section_header.arch[0] = current_boot_entry->arch;
set_721(section_header.num_entries, 1);

memcpy(de2->table + offset, &section_header,
sizeof(section_header));
offset += sizeof(section_header);

if (offset >= SECTOR_SIZE) {
#ifdef USE_LIBSCHILY
Expand All @@ -365,6 +409,8 @@ get_torito_desc(struct eltorito_boot_descriptor *boot_desc)
fill_boot_desc(&boot_desc_record, current_boot_entry);
memcpy(de2->table + offset, &boot_desc_record,
sizeof (boot_desc_record));
offset += sizeof (boot_desc_record);

}
}/* get_torito_desc(... */

Expand Down Expand Up @@ -660,7 +706,7 @@ fill_boot_desc(struct eltorito_defaultboot_entry *boot_desc_entry,
set_731(bi_table.bi_length, de->size);
set_731(bi_table.bi_csum, bi_checksum);

write(bootimage, &bi_table, sizeof (bi_table)); /* FIXME: check return value */
do{int ret;ret=write(bootimage, &bi_table, sizeof (bi_table));}while(0); /* FIXME: check return value */
close(bootimage);
}
}/* fill_boot_desc(... */
Expand Down
9 changes: 9 additions & 0 deletions genisoimage/genisoimage.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@

#include <mconfig.h>
#include "genisoimage.h"
#include "checksum.h"
#include "iso9660.h"
#include <errno.h>
#include <timedefs.h>
#include <fctldefs.h>
Expand Down Expand Up @@ -526,6 +528,8 @@ static const struct ld_option ld_options[] =
'\0', NULL, "Set debug flag", ONE_DASH},
{{"eltorito-boot", required_argument, NULL, 'b'},
'b', "FILE", "Set El Torito boot image name", ONE_DASH},
{{"efi-boot", required_argument, NULL, 'e'},
'e', "FILE", "Set EFI boot image name", ONE_DASH},
{{"eltorito-alt-boot", no_argument, NULL, OPTION_ALT_BOOT},
'\0', NULL, "Start specifying alternative El Torito boot parameters", ONE_DASH},
{{"sparc-boot", required_argument, NULL, 'B'},
Expand Down Expand Up @@ -1535,6 +1539,7 @@ int main(int argc, char *argv[])
all_files = 0;
break;
case 'b':
case 'e':
do_sort++; /* We sort bootcat/botimage */
use_eltorito++;
boot_image = optarg; /* pathname of the boot image */
Expand All @@ -1550,6 +1555,10 @@ int main(int argc, char *argv[])
#endif
}
get_boot_entry();
if (c == 'e')
current_boot_entry->arch = EL_TORITO_ARCH_EFI;
else
current_boot_entry->arch = EL_TORITO_ARCH_x86;
current_boot_entry->boot_image = boot_image;
break;
case OPTION_ALT_BOOT:
Expand Down
1 change: 1 addition & 0 deletions genisoimage/genisoimage.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ struct deferred_write {
struct eltorito_boot_entry_info {
struct eltorito_boot_entry_info *next;
char *boot_image;
char arch;
int not_bootable;
int no_emul_boot;
int hard_disk_boot;
Expand Down
14 changes: 13 additions & 1 deletion genisoimage/iso9660.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,14 @@ struct iso_volume_descriptor {
#define EL_TORITO_ARCH_x86 0
#define EL_TORITO_ARCH_PPC 1
#define EL_TORITO_ARCH_MAC 2
#define EL_TORITO_ARCH_EFI 0xef

#define EL_TORITO_BOOTABLE 0x88
#define EL_TORITO_NOT_BOOTABLE 0

#define EL_TORITO_SECTION_HEADER 0x90
#define EL_TORITO_LAST_SECTION_HEADER 0x91

#define EL_TORITO_MEDIA_NOEMUL 0
#define EL_TORITO_MEDIA_12FLOP 1
#define EL_TORITO_MEDIA_144FLOP 2
Expand Down Expand Up @@ -173,14 +177,22 @@ struct eltorito_validation_entry {
struct eltorito_defaultboot_entry {
char boot_id [ISODCL(1, 1)]; /* 711 */
char boot_media [ISODCL(2, 2)];
char loadseg [ISODCL(3, 4)]; /* 711 */
char loadseg [ISODCL(3, 4)]; /* 712 */
char sys_type [ISODCL(5, 5)];
char pad1 [ISODCL(6, 6)];
char nsect [ISODCL(7, 8)];
char bootoff [ISODCL(9, 12)];
char pad2 [ISODCL(13, 32)];
};

/* El Torito Section Header Entry in boot catalog */
struct eltorito_sectionheader_entry {
char headerid [ISODCL(1, 1)]; /* 711 */
char arch [ISODCL(2, 2)];
char num_entries [ISODCL(3, 4)]; /* 711 */
char id [ISODCL(5, 32)];
};

/*
* XXX JS: The next two structures have odd lengths!
* Some compilers (e.g. on Sun3/mc68020) padd the structures to even length.
Expand Down
14 changes: 8 additions & 6 deletions genisoimage/jte.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
#include "vms.h"
#endif

#include "md5.h"

/* Different types used in building our state list below */
#define JTET_FILE_MATCH 1
#define JTET_NOMATCH 2
Expand Down Expand Up @@ -625,7 +627,7 @@ static void flush_bz2_chunk(void *buffer, off_t size)

err = BZ2_bzCompressInit(&c_stream, 9, 0, 0);
comp_buf = malloc(2 * size); /* Worst case */
c_stream.next_out = comp_buf;
c_stream.next_out = (char *)comp_buf;
c_stream.avail_out = 2 * size;
c_stream.next_in = buffer;
c_stream.avail_in = size;
Expand Down Expand Up @@ -673,7 +675,7 @@ static void write_compressed_chunk(unsigned char *buffer, size_t size)
if (!uncomp_buf)
{
#ifdef USE_LIBSCHILY
comerr("failed to allocate %d bytes for template compression buffer\n", uncomp_size);
comerr("failed to allocate %d bytes for template compression buffer\n", (int)uncomp_size);
#else
fprintf(stderr, "failed to allocate %d bytes for template compression buffer\n", uncomp_size);
exit(1);
Expand Down Expand Up @@ -1014,8 +1016,8 @@ void write_jt_match_record(char *filename, char *mirror_name, int sector_size, o
#endif
}
if (first_block)
rsync64_sum = rsync64(buf, MIN_JIGDO_FILE_SIZE);
checksum_update(iso_context, buf, use);
rsync64_sum = rsync64((unsigned char *)buf, MIN_JIGDO_FILE_SIZE);
checksum_update(iso_context, (unsigned char *)buf, use);
// mk_MD5Update(&iso_context, buf, use);
remain -= use;
first_block = 0;
Expand All @@ -1028,15 +1030,15 @@ void write_jt_match_record(char *filename, char *mirror_name, int sector_size, o
{
int pad_size = sector_size - (size % sector_size);
memset(buf, 0, pad_size);
checksum_update(iso_context, buf, pad_size);
checksum_update(iso_context, (unsigned char *)buf, pad_size);
// mk_MD5Update(&iso_context, buf, pad_size);
}

add_file_entry(mirror_name, size, &md5[0], rsync64_sum);
if (size % sector_size)
{
int pad_size = sector_size - (size % sector_size);
write_compressed_chunk(buf, pad_size);
write_compressed_chunk((unsigned char *)buf, pad_size);
add_unmatched_entry(pad_size);
}
}
12 changes: 3 additions & 9 deletions icedax/cdda2ogg.1
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
'\"
.TH "cdda2ogg" "1"
.SH "NAME"
cdda2ogg, cdda2mp3 \(em extract audio CD audio tracks and encode them
cdda2ogg \(em extract audio CD audio tracks and encode them
.SH "SYNOPSIS"
.PP
.B cdda2ogg
.PP
.B cdda2mp3
.SH "DESCRIPTION"
.PP
.B cdda2ogg is a simple script that uses the
Expand All @@ -15,9 +14,6 @@ command to extract all audio tracks with the
.B icedax <fileprefix>
command and encode them using the
.B ogg123
respective
.I <censored>
MP3
encoder. The scripts are not intended to be full-featured music archiving
programs, but only for quick storing of few audio data.
It does not use databases like CDDB or have any extra features. You may look
Expand All @@ -36,8 +32,6 @@ for more information.
.SH "CONFIGURATION"
.PP
.B cdda2ogg
and
.B cdda2mp3
have predefined values for reading and labeling of the target files.
You can overwrite them with following environment variables:

Expand Down Expand Up @@ -65,11 +59,11 @@ Additional options passed to
The base part of the filename of resulting audio files. This can also be specified as the first argument to the script.

.PP
See cdda2ogg (cdda2mp3) script file to get the default values
See cdda2ogg script file to get the default values
.PP
System administrator can also set default values by creating of a shell
include file, defining the variables for the POSIX shell, and storing them as
/etc/default/cdda2ogg (resp. cdda2mp3).
/etc/default/cdda2ogg.
.SH "EXAMPLES"
.PP
.B CDDA_DEVICE=/dev/cdrom1 cdda2ogg
Expand Down
2 changes: 1 addition & 1 deletion icedax/toc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ static int handle_userchoice(char *p, unsigned size)
/* get user response. */
do {
fprintf(stderr, "please choose one (0-%u): ", nr);
scanf("%u", &user_choice); /* FIXME: check return value */
do{int ret;ret=scanf("%u", &user_choice);}while(0); /* FIXME: check return value */
} while (user_choice > nr);

if (user_choice == nr)
Expand Down
2 changes: 1 addition & 1 deletion wodim/isosize.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ isosize(int f)
vp = (struct iso9660_pr_voldesc *) &vd;

do {
read(f, &vd, sizeof (vd)); /* FIXME: check return value */
do{int ret;ret=read(f, &vd, sizeof (vd));}while(0); /* FIXME: check return value */
if (GET_UBYTE(vd.vd_type) == VD_PRIMARY)
break;

Expand Down
Loading

0 comments on commit a4de793

Please sign in to comment.