summaryrefslogtreecommitdiff
path: root/gnu/usr.sbin
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.sbin')
-rw-r--r--gnu/usr.sbin/mkisofs/diag/isovfy.c4
-rw-r--r--gnu/usr.sbin/mkisofs/eltorito.c10
-rw-r--r--gnu/usr.sbin/mkisofs/match.h4
-rw-r--r--gnu/usr.sbin/mkisofs/mkisofs.84
-rw-r--r--gnu/usr.sbin/mkisofs/mkisofs.c6
-rw-r--r--gnu/usr.sbin/mkisofs/mkisofs.h8
-rw-r--r--gnu/usr.sbin/mkisofs/mkisofs.spec4
-rw-r--r--gnu/usr.sbin/mkisofs/multi.c57
-rw-r--r--gnu/usr.sbin/mkisofs/name.c23
-rw-r--r--gnu/usr.sbin/mkisofs/rock.c4
-rw-r--r--gnu/usr.sbin/mkisofs/tree.c79
-rw-r--r--gnu/usr.sbin/mkisofs/write.c57
12 files changed, 167 insertions, 93 deletions
diff --git a/gnu/usr.sbin/mkisofs/diag/isovfy.c b/gnu/usr.sbin/mkisofs/diag/isovfy.c
index f10447889f3..6c86350637a 100644
--- a/gnu/usr.sbin/mkisofs/diag/isovfy.c
+++ b/gnu/usr.sbin/mkisofs/diag/isovfy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isovfy.c,v 1.1 1997/09/15 06:01:53 downsj Exp $ */
+/* $OpenBSD: isovfy.c,v 1.2 1998/04/05 00:39:44 deraadt Exp $ */
/*
* File isovfy.c - verify consistency of iso9660 filesystem.
*
@@ -348,7 +348,7 @@ check_tree(int file_addr, int file_size, int parent_addr){
} else {
if(i1 < 2) iline += sprintf(&lbuffer[iline]," Improper sorting.", rr_goof++);
for(j=0; j<idr->name_len[0]; j++) iline += sprintf(&lbuffer[iline],"%c", idr->name[j]);
- for(j=0; j<14 -idr->name_len[0]; j++) iline += sprintf(&lbuffer[iline]," ");
+ for(j=0; j<14 - (int) idr->name_len[0]; j++) iline += sprintf(&lbuffer[iline]," ");
rflag = 1;
};
diff --git a/gnu/usr.sbin/mkisofs/eltorito.c b/gnu/usr.sbin/mkisofs/eltorito.c
index 1f91eb8d1c7..7687ee36d42 100644
--- a/gnu/usr.sbin/mkisofs/eltorito.c
+++ b/gnu/usr.sbin/mkisofs/eltorito.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: eltorito.c,v 1.1 1997/09/15 06:01:52 downsj Exp $ */
+/* $OpenBSD: eltorito.c,v 1.2 1998/04/05 00:39:31 deraadt Exp $ */
/*
* Program eltorito.c - Handle El Torito specific extensions to iso9660.
*
@@ -29,10 +29,14 @@ static char rcsid[] ="$From: eltorito.c,v 1.5 1997/03/08 17:27:01 eric Rel $";
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
+#include <stdlib.h>
#include "mkisofs.h"
#include "iso9660.h"
+#undef MIN
+#define MIN(a, b) (((a) < (b))? (a): (b))
+
static struct eltorito_validation_entry valid_desc;
static struct eltorito_defaultboot_entry default_desc;
@@ -158,8 +162,8 @@ void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc)
* but who really reads this stuff!
*/
if (publisher)
- memcpy_max(valid_desc.id, publisher, strlen(publisher));
-
+ memcpy_max(valid_desc.id, publisher, MIN(23, strlen(publisher)));
+
valid_desc.key1[0] = 0x55;
valid_desc.key2[0] = 0xAA;
diff --git a/gnu/usr.sbin/mkisofs/match.h b/gnu/usr.sbin/mkisofs/match.h
index 68314d26340..c176b1b3e8c 100644
--- a/gnu/usr.sbin/mkisofs/match.h
+++ b/gnu/usr.sbin/mkisofs/match.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: match.h,v 1.2 1997/09/22 05:25:49 millert Exp $ */
+/* $OpenBSD: match.h,v 1.3 1998/04/05 00:39:32 deraadt Exp $ */
/*
* 27th March 1996. Added by Jan-Piet Mens for matching regular expressions
* in paths.
@@ -9,7 +9,7 @@
* $From: match.h,v 1.1 1997/02/23 15:56:12 eric Rel $
*/
-#include <fnmatch.h>
+#include "fnmatch.h"
void add_match();
int matches();
diff --git a/gnu/usr.sbin/mkisofs/mkisofs.8 b/gnu/usr.sbin/mkisofs/mkisofs.8
index a7d1a9fa20d..30847921902 100644
--- a/gnu/usr.sbin/mkisofs/mkisofs.8
+++ b/gnu/usr.sbin/mkisofs/mkisofs.8
@@ -1,7 +1,7 @@
-.\" $OpenBSD: mkisofs.8,v 1.1 1997/09/15 06:01:52 downsj Exp $
+.\" $OpenBSD: mkisofs.8,v 1.2 1998/04/05 00:39:33 deraadt Exp $
.\" $From: mkisofs.8,v 1.5 1997/04/10 02:45:50 eric Rel $
.\" -*- nroff -*-
-.TH MKISOFS 8 "9 Apr 1997" "Version 1.11"
+.TH MKISOFS 8 "9 Apr 1997" "Version 1.11.2"
.SH NAME
mkisofs \- create a iso9660 filesystem with optional Rock Ridge attributes.
.SH SYNOPSIS
diff --git a/gnu/usr.sbin/mkisofs/mkisofs.c b/gnu/usr.sbin/mkisofs/mkisofs.c
index 5c72ca8ceab..c419501cccb 100644
--- a/gnu/usr.sbin/mkisofs/mkisofs.c
+++ b/gnu/usr.sbin/mkisofs/mkisofs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mkisofs.c,v 1.1 1997/09/15 06:01:53 downsj Exp $ */
+/* $OpenBSD: mkisofs.c,v 1.2 1998/04/05 00:39:35 deraadt Exp $ */
/*
* Program mkisofs.c - generate iso9660 filesystem based upon directory
* tree on hard disk.
@@ -61,7 +61,7 @@ static char rcsid[] ="$From: mkisofs.c,v 1.9 1997/04/10 02:45:09 eric Rel $";
struct directory * root = NULL;
-static char version_string[] = "mkisofs v1.11";
+static char version_string[] = "mkisofs v1.11.2";
FILE * discimage;
unsigned int next_extent = 0;
@@ -594,7 +594,7 @@ int FDECL2(main, int, argc, char **, argv){
path_blocks = (path_table_size + (SECTOR_SIZE - 1)) >> 11;
if (path_blocks & 1) path_blocks++;
- path_table[0] = session_start + 0x14;
+ path_table[0] = session_start + 0x10 + 2 + (use_eltorito ? 1 : 0);
path_table[1] = 0;
path_table[2] = path_table[0] + path_blocks;
path_table[3] = 0;
diff --git a/gnu/usr.sbin/mkisofs/mkisofs.h b/gnu/usr.sbin/mkisofs/mkisofs.h
index 983ccf57f5d..b0da4055e10 100644
--- a/gnu/usr.sbin/mkisofs/mkisofs.h
+++ b/gnu/usr.sbin/mkisofs/mkisofs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mkisofs.h,v 1.1 1997/09/15 06:01:53 downsj Exp $ */
+/* $OpenBSD: mkisofs.h,v 1.2 1998/04/05 00:39:36 deraadt Exp $ */
/*
* Header file mkisofs.h - assorted structure definitions and typecasts.
@@ -263,6 +263,12 @@ extern int DECL(check_prev_session, (struct directory_entry **, int len,
struct stat *,
struct directory_entry **));
+#ifdef USE_SCG
+/* scsi.c */
+extern int readsecs(int startsecno, void *buffer, int sectorcount);
+extern int scsidev_open(char *path);
+#endif
+
extern char * extension_record;
extern int extension_record_extent;
extern int n_data_extents;
diff --git a/gnu/usr.sbin/mkisofs/mkisofs.spec b/gnu/usr.sbin/mkisofs/mkisofs.spec
index 3c9c8e18d5b..66e1e151263 100644
--- a/gnu/usr.sbin/mkisofs/mkisofs.spec
+++ b/gnu/usr.sbin/mkisofs/mkisofs.spec
@@ -1,4 +1,4 @@
-# $OpenBSD: mkisofs.spec,v 1.1 1997/09/15 06:01:53 downsj Exp $
+# $OpenBSD: mkisofs.spec,v 1.2 1998/04/05 00:39:37 deraadt Exp $
# $From: mkisofs.spec,v 1.3 1997/04/10 02:46:57 eric Rel $
Summary: Creates a ISO9660 filesystem image
Name: mkisofs
@@ -6,7 +6,7 @@ Version: 1.11
Release: 1
Copyright: GPL
Group: Utilities/System
-Source: tsx-11.mit.edu:/pub/linux/packages/mkisofs/mkisofs-1.11.tar.gz
+Source: tsx-11.mit.edu:/pub/linux/packages/mkisofs/mkisofs-1.11.2.tar.gz
%description
This is the mkisofs package. It is used to create ISO 9660
diff --git a/gnu/usr.sbin/mkisofs/multi.c b/gnu/usr.sbin/mkisofs/multi.c
index e7af4bba399..80ebcd817a1 100644
--- a/gnu/usr.sbin/mkisofs/multi.c
+++ b/gnu/usr.sbin/mkisofs/multi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: multi.c,v 1.1 1997/09/15 06:01:53 downsj Exp $ */
+/* $OpenBSD: multi.c,v 1.2 1998/04/05 00:39:38 deraadt Exp $ */
/*
* File multi.c - scan existing iso9660 image and merge into
* iso9660 filesystem. Used for multisession support.
@@ -26,6 +26,7 @@ static char rcsid[] ="$From: multi.c,v 1.4 1997/03/08 17:08:53 eric Rel $";
#include <string.h>
#include <time.h>
#include <errno.h>
+#include <sys/types.h>
#include <sys/stat.h>
#include "config.h"
@@ -279,11 +280,11 @@ FDECL2(read_merging_directory, struct iso_directory_record *, mrootp,
* First, allocate a buffer large enough to read in the entire
* directory.
*/
- dirbuff = (char *) e_malloc(isonum_733(mrootp->size));
-
- readsecs(isonum_733(mrootp->extent), dirbuff,
- isonum_733(mrootp->size)/SECTOR_SIZE);
+ dirbuff = (char *) e_malloc(isonum_733((unsigned char *)mrootp->size));
+ readsecs(isonum_733((unsigned char *)mrootp->extent), dirbuff,
+ isonum_733((unsigned char *)mrootp->size)/SECTOR_SIZE);
+
/*
* Next look over the directory, and count up how many entries we
* have.
@@ -330,8 +331,8 @@ FDECL2(read_merging_directory, struct iso_directory_record *, mrootp,
*pnt = (struct directory_entry *) e_malloc(sizeof(**rtn));
(*pnt)->next = NULL;
(*pnt)->isorec = *idr;
- (*pnt)->starting_block = isonum_733(idr->extent);
- (*pnt)->size = isonum_733(idr->size);
+ (*pnt)->starting_block = isonum_733((unsigned char *)idr->extent);
+ (*pnt)->size = isonum_733((unsigned char *)idr->size);
(*pnt)->priority = 0;
(*pnt)->name = NULL;
(*pnt)->table = NULL;
@@ -396,6 +397,10 @@ FDECL2(read_merging_directory, struct iso_directory_record *, mrootp,
{
free((*pnt)->name);
}
+ if( (*pnt)->whole_name != NULL )
+ {
+ free((*pnt)->whole_name);
+ }
if( (*pnt)->isorec.name[0] == 0 )
{
(*pnt)->name = strdup(".");
@@ -412,9 +417,13 @@ FDECL2(read_merging_directory, struct iso_directory_record *, mrootp,
{
free((*pnt)->name);
}
+ if( (*pnt)->whole_name != NULL )
+ {
+ free((*pnt)->whole_name);
+ }
(*pnt)->name = strdup("<translation table>");
- tt_extent = isonum_733(idr->extent);
- tt_size = isonum_733(idr->size);
+ tt_extent = isonum_733((unsigned char *)idr->extent);
+ tt_size = isonum_733((unsigned char *)idr->size);
}
pnt++;
@@ -449,7 +458,9 @@ FDECL2(read_merging_directory, struct iso_directory_record *, mrootp,
rlen) == 0
&& cpnt[2+rlen] == ' ')
{
- (*pnt)->table = strdup((char *) cpnt);
+ (*pnt)->table = e_malloc(strlen((char*)cpnt) - 34);
+ sprintf((*pnt)->table, "%c\t%s\n",
+ *cpnt, cpnt+37);
if( (*pnt)->name == NULL )
{
(*pnt)->name = strdup((char *) cpnt+37);
@@ -513,6 +524,12 @@ FDECL2(free_mdinfo, struct directory_entry ** , ptr, int, len )
free((*p)->name);
}
+ if( (*p)->whole_name != NULL )
+ {
+ free((*p)->whole_name);
+ }
+
+
if( (*p)->rr_attributes != NULL )
{
free((*p)->rr_attributes);
@@ -661,11 +678,23 @@ struct iso_directory_record * FDECL1(merge_isofs, char *, path)
* FIXME(eric).
*/
+#ifndef USE_SCG
in_image = fopen(path, "rb");
if( in_image == NULL )
{
return NULL;
}
+#else
+ if (strchr(path, '/')) {
+ in_image = fopen(path, "rb");
+ if( in_image == NULL ) {
+ return NULL;
+ }
+ } else {
+ if (scsidev_open(path) < 0)
+ return NULL;
+ }
+#endif
get_session_start(&file_addr);
@@ -681,7 +710,7 @@ struct iso_directory_record * FDECL1(merge_isofs, char *, path)
vdp = (struct iso_volume_descriptor *)buffer;
if( (strncmp(vdp->id, ISO_STANDARD_ID, sizeof vdp->id) == 0)
- && (isonum_711(vdp->type) == ISO_VD_PRIMARY) )
+ && (isonum_711((unsigned char *) vdp->type) == ISO_VD_PRIMARY) )
{
break;
}
@@ -698,8 +727,8 @@ struct iso_directory_record * FDECL1(merge_isofs, char *, path)
/*
* Check the blocksize of the image to make sure it is compatible.
*/
- if( (isonum_723 (pri->logical_block_size) != SECTOR_SIZE)
- || (isonum_723 (pri->volume_set_size) != 1) )
+ if( (isonum_723 ((unsigned char *) pri->logical_block_size) != SECTOR_SIZE)
+ || (isonum_723 ((unsigned char *) pri->volume_set_size) != 1) )
{
return NULL;
}
@@ -738,7 +767,7 @@ void FDECL3(merge_remaining_entries, struct directory *, this_dir,
if( pnt[i]->name != NULL
&& strcmp(pnt[i]->name, "<translation table>") == 0 )
{
- ttbl_extent = isonum_733(pnt[i]->isorec.extent);
+ ttbl_extent = isonum_733((unsigned char *) pnt[i]->isorec.extent);
ttbl_index = i;
continue;
}
diff --git a/gnu/usr.sbin/mkisofs/name.c b/gnu/usr.sbin/mkisofs/name.c
index ff02cd1f1aa..4b27b9a8800 100644
--- a/gnu/usr.sbin/mkisofs/name.c
+++ b/gnu/usr.sbin/mkisofs/name.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: name.c,v 1.1 1997/09/15 06:01:53 downsj Exp $ */
+/* $OpenBSD: name.c,v 1.2 1998/04/05 00:39:39 deraadt Exp $ */
/*
* File name.c - map full Unix file names to unique 8.3 names that
* would be valid on DOS.
@@ -208,7 +208,14 @@ int FDECL3(iso9660_file_length,
}
if(current_length < 30)
{
- *result++ = (islower(*pnt) ? toupper(*pnt) : *pnt);
+ if( *pnt < 0 )
+ {
+ *result++ = '_';
+ }
+ else
+ {
+ *result++ = (islower(*pnt) ? toupper(*pnt) : *pnt);
+ }
}
}
else
@@ -262,14 +269,21 @@ int FDECL3(iso9660_file_length,
else
{
if( (seen_dot && (chars_after_dot < 3) && ++chars_after_dot)
- || ((chars_before_dot < 8) && ++chars_before_dot) )
+ || (!seen_dot && (chars_before_dot < 8) && ++chars_before_dot) )
{
if(result)
{
switch (*pnt)
{
default:
- *result++ = islower(*pnt) ? toupper(*pnt) : *pnt;
+ if( *pnt < 0 )
+ {
+ *result++ = '_';
+ }
+ else
+ {
+ *result++ = islower(*pnt) ? toupper(*pnt) : *pnt;
+ }
break;
/*
@@ -283,6 +297,7 @@ int FDECL3(iso9660_file_length,
/* separators */
case '+':
case '=':
+ case '%': /* not legal DOS filename */
case ':':
case ';': /* already handled */
case '.': /* already handled */
diff --git a/gnu/usr.sbin/mkisofs/rock.c b/gnu/usr.sbin/mkisofs/rock.c
index 592bb79229f..948020a6941 100644
--- a/gnu/usr.sbin/mkisofs/rock.c
+++ b/gnu/usr.sbin/mkisofs/rock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rock.c,v 1.1 1997/09/15 06:01:53 downsj Exp $ */
+/* $OpenBSD: rock.c,v 1.2 1998/04/05 00:39:40 deraadt Exp $ */
/*
* File rock.c - generate RRIP records for iso9660 filesystems.
@@ -226,7 +226,7 @@ int deep_opt;
Rock[ipnt++] = PN_SIZE;
Rock[ipnt++] = SU_VERSION;
flagval |= (1<<1);
-#if MAJOR_IN_SYSMACROS == 0 && MAJOR_IN_MKDEV == 0
+#if !defined(MAJOR_IN_SYSMACROS) && !defined(MAJOR_IN_MKDEV)
set_733((char*)Rock + ipnt, major(lstatbuf->st_rdev ));
ipnt += 8;
set_733((char*)Rock + ipnt, minor(lstatbuf->st_rdev));
diff --git a/gnu/usr.sbin/mkisofs/tree.c b/gnu/usr.sbin/mkisofs/tree.c
index fc0bbd12f1d..81742abc805 100644
--- a/gnu/usr.sbin/mkisofs/tree.c
+++ b/gnu/usr.sbin/mkisofs/tree.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tree.c,v 1.1 1997/09/15 06:01:53 downsj Exp $ */
+/* $OpenBSD: tree.c,v 1.2 1998/04/05 00:39:41 deraadt Exp $ */
/*
* File tree.c - scan directory tree and build memory structures for iso9660
* filesystem
@@ -143,6 +143,9 @@ void FDECL1(sort_n_finish, struct directory *, this_dir)
time_t current_time;
struct directory_entry * table;
int count;
+ int d1;
+ int d2;
+ int d3;
int new_reclen;
char * c;
int tablesize = 0;
@@ -208,34 +211,43 @@ void FDECL1(sort_n_finish, struct directory *, this_dir)
c = strchr(rootname, ';');
if (c) *c = 0;
}
- count = 0;
- while(count < 0x1000)
+ for(d1 = 0; d1 < 36; d1++)
{
- sprintf(newname,"%s.%3.3X%s", rootname, count,
- (s_entry->isorec.flags[0] == 2 ||
- omit_version_number ? "" : ";1"));
-
+ for(d2 = 0; d2 < 36; d2++)
+ {
+ for(d3 = 0; d3 < 36; d3++)
+ {
+ sprintf(newname,"%s.%c%c%c%s", rootname,
+ (d1 <= 9 ? '0' + d1 : 'A' + d1 - 10),
+ (d2 <= 9 ? '0' + d2 : 'A' + d2 - 10),
+ (d3 <= 9 ? '0' + d3 : 'A' + d3 - 10),
+ (s_entry->isorec.flags[0] == 2 ||
+ omit_version_number ? "" : ";1"));
+
#ifdef VMS
- /* Sigh. VAXCRTL seems to be broken here */
- {
- int ijk = 0;
- while(newname[ijk])
- {
- if(newname[ijk] == ' ') newname[ijk] = '0';
- ijk++;
- }
- }
+ /* Sigh. VAXCRTL seems to be broken here */
+ {
+ int ijk = 0;
+ while(newname[ijk])
+ {
+ if(newname[ijk] == ' ') newname[ijk] = '0';
+ ijk++;
+ }
+ }
#endif
-
- if(!find_file_hash(newname)) break;
- count++;
- }
- if(count >= 0x1000)
- {
- fprintf(stderr,"Unable to generate unique name for file %s\n", s_entry->name);
- exit(1);
+
+ if(!find_file_hash(newname)) goto got_valid_name;
+ }
+ }
}
-
+
+ /*
+ * If we fell off the bottom here, we were in real trouble.
+ */
+ fprintf(stderr,"Unable to generate unique name for file %s\n", s_entry->name);
+ exit(1);
+
+got_valid_name:
/*
* OK, now we have a good replacement name. Now decide which one
* of these two beasts should get the name changed
@@ -316,7 +328,7 @@ void FDECL1(sort_n_finish, struct directory *, this_dir)
table->name = strdup("<translation table>");
table->table = (char *) e_malloc(ROUND_UP(tablesize));
memset(table->table, 0, ROUND_UP(tablesize));
- iso9660_file_length ("TRANS.TBL", table, 1);
+ iso9660_file_length ("TRANS.TBL", table, 0);
if(use_RockRidge)
{
@@ -373,7 +385,6 @@ void FDECL1(sort_n_finish, struct directory *, this_dir)
if(table)
{
- char buffer[1024];
count = 0;
for (s_entry = this_dir->contents; s_entry; s_entry = s_entry->next){
if(s_entry == table) continue;
@@ -381,10 +392,9 @@ void FDECL1(sort_n_finish, struct directory *, this_dir)
if(strcmp(s_entry->name, ".") == 0 ||
strcmp(s_entry->name, "..") == 0) continue;
- sprintf(buffer,"%c %-34s%s",s_entry->table[0],
- s_entry->isorec.name, s_entry->table+1);
- memcpy(table->table + count, buffer, strlen(buffer));
- count += strlen(buffer);
+ count += sprintf(table->table + count, "%c %-34s%s",
+ s_entry->table[0],
+ s_entry->isorec.name, s_entry->table+1);
free(s_entry->table);
s_entry->table = NULL;
}
@@ -1147,6 +1157,13 @@ FDECL3(scan_directory_tree,char *, path, struct directory_entry *, de,
free_mdinfo(orig_contents, n_orig);
}
+ if( this_dir->contents == NULL )
+ {
+ /*
+ * This directory must have been inaccessible.
+ */
+ return 0;
+ }
sort_n_finish(this_dir);
return 1;
diff --git a/gnu/usr.sbin/mkisofs/write.c b/gnu/usr.sbin/mkisofs/write.c
index a81dab5e0ec..9e7857541a2 100644
--- a/gnu/usr.sbin/mkisofs/write.c
+++ b/gnu/usr.sbin/mkisofs/write.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: write.c,v 1.1 1997/09/15 06:01:53 downsj Exp $ */
+/* $OpenBSD: write.c,v 1.2 1998/04/05 00:39:42 deraadt Exp $ */
/*
* Program write.c - dump memory structures to file for iso9660 filesystem.
@@ -58,8 +58,9 @@ static struct directory ** pathlist;
static next_path_index = 1;
/* Used to fill in some of the information in the volume descriptor. */
-static struct tm *local;
-
+static struct tm local;
+static struct tm gmt;
+
/* Routines to actually write the disc. We write sequentially so that
we could write a tape, or write the disc directly */
@@ -327,8 +328,8 @@ int FDECL2(compare_dirs, const void *, rr, const void *, ll)
if(*rpnt == '.' && *lpnt != '.') return -1;
if(*rpnt != '.' && *lpnt == '.') return 1;
- if(*rpnt < *lpnt) return -1;
- if(*rpnt > *lpnt) return 1;
+ if((unsigned char)*rpnt < (unsigned char)*lpnt) return -1;
+ if((unsigned char)*rpnt > (unsigned char)*lpnt) return 1;
rpnt++; lpnt++;
}
if(*rpnt) return 1;
@@ -390,7 +391,9 @@ void generate_root_record()
time_t ctime;
time (&ctime);
- local = localtime(&ctime);
+
+ local = *localtime(&ctime);
+ gmt = *gmtime(&ctime);
root_record.length[0] = 1 + sizeof(struct iso_directory_record)
- sizeof(root_record.name);
@@ -426,7 +429,7 @@ static void FDECL1(assign_file_addresses, struct directory *, dpnt)
* we don't end up scheduling the thing for writing
* either.
*/
- if( isonum_733(s_entry->isorec.extent) != 0 )
+ if( isonum_733((unsigned char *) s_entry->isorec.extent) )
{
continue;
}
@@ -742,7 +745,14 @@ void FDECL2(generate_one_directory, struct directory *, dpnt, FILE *, outfile)
s_entry = s_entry->next;
if (s_entry_d->rr_attributes) free(s_entry_d->rr_attributes);
- free (s_entry_d->name);
+ if( s_entry_d->name != NULL )
+ {
+ free (s_entry_d->name);
+ }
+ if( s_entry_d->whole_name != NULL )
+ {
+ free (s_entry_d->whole_name);
+ }
free (s_entry_d);
}
sort_dir = NULL;
@@ -947,9 +957,14 @@ int FDECL1(iso_write, FILE *, outfile)
* This will break in the year 2000, I supose, but there is no good way
* to get the top two digits of the year.
*/
- sprintf(iso_time, "%4.4d%2.2d%2.2d%2.2d%2.2d%2.2d00", 1900 + local->tm_year,
- local->tm_mon+1, local->tm_mday,
- local->tm_hour, local->tm_min, local->tm_sec);
+ sprintf(iso_time, "%4.4d%2.2d%2.2d%2.2d%2.2d%2.2d00", 1900 + local.tm_year,
+ local.tm_mon+1, local.tm_mday,
+ local.tm_hour, local.tm_min, local.tm_sec);
+
+ local.tm_min -= gmt.tm_min;
+ local.tm_hour -= gmt.tm_hour;
+ local.tm_yday -= gmt.tm_yday;
+ iso_time[16] = (local.tm_min + 60*(local.tm_hour + 24*local.tm_yday));
/*
* First, we output 16 sectors of all zero
@@ -1043,28 +1058,17 @@ int FDECL1(iso_write, FILE *, outfile)
* if not a bootable cd do it the old way
*/
xfwrite(&vol_desc, 1, 2048, outfile);
- if (!use_eltorito)
- {
- /*
- * For some reason, Young Minds writes this twice. Aw, what the heck
- */
- xfwrite(&vol_desc, 1, 2048, outfile);
- }
- else
+ last_extent_written++;
+ if (use_eltorito)
{
/*
* Next we write out the boot volume descriptor for the disc
*/
get_torito_desc(&boot_desc);
xfwrite(&boot_desc, 1, 2048, outfile);
+ last_extent_written ++;
}
- /*
- * either way, we've written two more
- */
-
- last_extent_written += 2;
-
/*
* Now write the end volume descriptor. Much simpler than the other one
*/
@@ -1073,8 +1077,7 @@ int FDECL1(iso_write, FILE *, outfile)
memcpy(vol_desc.id, ISO_STANDARD_ID, sizeof(ISO_STANDARD_ID));
vol_desc.version[0] = 1;
xfwrite(&vol_desc, 1, 2048, outfile);
- xfwrite(&vol_desc, 1, 2048, outfile);
- last_extent_written += 2;
+ last_extent_written += 1;
/*
* Next we write the path tables