fix cramfs

This commit is contained in:
kzak 2005-10-20 21:58:21 +00:00
parent b86cfa5ff3
commit 08be59bff8
2 changed files with 55 additions and 1 deletions

View File

@ -0,0 +1,47 @@
--- util-linux-2.13-pre5/disk-utils/mkfs.cramfs.c.maxentries 2005-10-20 23:46:19.000000000 +0200
+++ util-linux-2.13-pre5/disk-utils/mkfs.cramfs.c 2005-10-20 23:54:07.000000000 +0200
@@ -471,11 +471,13 @@
* entries, using a stack to remember the directories
* we've seen.
*/
-#define MAXENTRIES (100)
static unsigned int write_directory_structure(struct entry *entry, char *base, unsigned int offset)
{
int stack_entries = 0;
- struct entry *entry_stack[MAXENTRIES];
+ int stack_size = 64;
+ struct entry **entry_stack;
+
+ entry_stack = xmalloc(stack_size * sizeof(struct entry *));
for (;;) {
int dir_start = stack_entries;
@@ -508,13 +510,13 @@
if (verbose)
printf(" %s\n", entry->name);
if (entry->child) {
- if (stack_entries >= MAXENTRIES) {
- fprintf(stderr,
- _("Exceeded MAXENTRIES. Raise"
- " this value in mkcramfs.c "
- "and recompile. Exiting.\n")
- );
- exit(8);
+ if (stack_entries >= stack_size) {
+ stack_size *= 2;
+ entry_stack = realloc(entry_stack, stack_size * sizeof(struct entry *));
+ if (!entry_stack) {
+ perror(NULL);
+ exit(8); /* out of memory */
+ }
}
entry_stack[stack_entries] = entry;
stack_entries++;
@@ -551,6 +553,7 @@
printf("'%s':\n", entry->name);
entry = entry->child;
}
+ free(entry_stack);
return offset;
}

View File

@ -25,7 +25,7 @@ BuildRoot: %{_tmppath}/%{name}-root
Summary: A collection of basic system utilities.
Name: util-linux
Version: 2.13
Release: 0.6.pre5
Release: 0.7.pre5
License: distributable
Group: System Environment/Base
@ -155,6 +155,8 @@ Patch214: util-linux-2.13-losetup-all.patch
Patch215: util-linux-2.13-audit-login.patch
# 170171 - ipcs -lm always report "max total shared memory (kbytes) = 0"
Patch216: util-linux-2.13-ipcs-shmax.patch
# 171337 - mkfs.cramfs dies creating installer image
Patch217: util-linux-2.13-cramfs-maxentries.patch
# When adding patches, please make sure that it is easy to find out what bug # the
# patch fixes.
@ -221,8 +223,10 @@ cp %{SOURCE8} %{SOURCE9} .
%patch212 -p1
%patch213 -p1
%patch214 -p1
# audit
%patch215 -p1
%patch216 -p1
%patch217 -p1
%build
unset LINGUAS || :
@ -606,6 +610,9 @@ fi
/sbin/losetup
%changelog
* Thu Oct 20 2005 Karel Zak <kzak@redhat.com> 2.13-0.7.pre5
- fix #171337 - mkfs.cramfs dies creating installer image
* Thu Oct 20 2005 Karel Zak <kzak@redhat.com> 2.13-0.6.pre5
- update to upstream 2.13pre5
- remove separated cramfs1.1 (already in upstream package)