New version, all patches were rebased

Resolves: rhbz#749969
This commit is contained in:
Jaroslav Škarvada 2011-10-29 20:21:20 +02:00
parent 698a0a0888
commit 416ff334cf
6 changed files with 55 additions and 40 deletions

View File

@ -0,0 +1,18 @@
diff -up dosfstools-3.0.12/src/mkdosfs.c.old dosfstools-3.0.9/src/mkdosfs.c
--- dosfstools-3.0.12/src/mkdosfs.c.old 2010-01-31 08:29:13.000000000 +0100
+++ dosfstools-3.0.12/src/mkdosfs.c 2011-06-02 12:02:40.525623995 +0200
@@ -1684,10 +1684,10 @@ main (int argc, char **argv)
* the 'superfloppy' format. As I don't know how to find out if
* this is a MO disk I introduce a -I (ignore) switch. -Joey
*/
- if (!ignore_full_disk && ((statbuf.st_rdev & 0xff3f) == 0x0300 || /* hda, hdb */
- (statbuf.st_rdev & 0xff0f) == 0x0800 || /* sd */
- (statbuf.st_rdev & 0xff3f) == 0x0d00 || /* xd */
- (statbuf.st_rdev & 0xff3f) == 0x1600) /* hdc, hdd */
+ if (!ignore_full_disk && ((statbuf.st_rdev & 0xffffff3f) == 0x0300 || /* hda, hdb */
+ (statbuf.st_rdev & 0xffffff0f) == 0x0800 || /* sd */
+ (statbuf.st_rdev & 0xffffff3f) == 0x0d00 || /* xd */
+ (statbuf.st_rdev & 0xffffff3f) == 0x1600) /* hdc, hdd */
)
die("Device partition expected, not making filesystem on entire device '%s' (use -I to override)");

View File

@ -17,8 +17,8 @@ diff -up dosfstools-3.0.9/src/dosfslabel.c.old dosfstools-3.0.9/src/dosfslabel.c
+ if (fs.fat_bits == 32)
+ read_fat(&fs);
if (!rw) {
fprintf(stdout, "%s\n", fs.label);
exit(0);
fprintf(stdout, "%s\n", fs.label);
exit(0);
diff -up dosfstools-3.0.9/src/fat.c.old dosfstools-3.0.9/src/fat.c
--- dosfstools-3.0.9/src/fat.c.old 2010-01-23 10:13:34.000000000 +0100
+++ dosfstools-3.0.9/src/fat.c 2011-04-05 10:57:22.659733090 +0200

View File

@ -0,0 +1,25 @@
--- dosfstools-3.0.12/src/check.c.old 2010-01-23 10:13:17.000000000 +0100
+++ dosfstools-3.0.12/src/check.c 2011-01-31 17:43:31.462674941 +0100
@@ -174,7 +174,10 @@
offset = fs->root_start + next_free * sizeof(DIR_ENT);
memset(de, 0, sizeof(DIR_ENT));
while (1) {
- sprintf((char *)de->name, pattern, curr_num);
+ char expanded[12];
+ sprintf(expanded, pattern, curr_num);
+ memcpy(de->name, expanded, 8);
+ memcpy(de->ext, expanded + 8, 3);
for (scan = 0; scan < fs->root_entries; scan++)
if (scan != next_free &&
!strncmp((const char *)root[scan].name,
--- dosfstools-3.0.12/src/fat.c
+++ dosfstools-3.0.12/src/fat.c
@@ -474,7 +474,7 @@ void reclaim_file(DOS_FS * fs)
DIR_ENT de;
loff_t offset;
files++;
- offset = alloc_rootdir_entry(fs, &de, "FSCK%04d");
+ offset = alloc_rootdir_entry(fs, &de, "FSCK%04dREC");
de.start = CT_LE_W(i & 0xffff);
if (fs->fat_bits == 32)
de.starthi = CT_LE_W(i >> 16);

View File

@ -1,18 +0,0 @@
diff -up dosfstools-3.0.9/src/mkdosfs.c.old dosfstools-3.0.9/src/mkdosfs.c
--- dosfstools-3.0.9/src/mkdosfs.c.old 2010-01-31 08:29:13.000000000 +0100
+++ dosfstools-3.0.9/src/mkdosfs.c 2011-06-02 12:02:40.525623995 +0200
@@ -1763,10 +1763,10 @@ main (int argc, char **argv)
* this is a MO disk I introduce a -I (ignore) switch. -Joey
*/
if (!ignore_full_disk && (
- (statbuf.st_rdev & 0xff3f) == 0x0300 || /* hda, hdb */
- (statbuf.st_rdev & 0xff0f) == 0x0800 || /* sd */
- (statbuf.st_rdev & 0xff3f) == 0x0d00 || /* xd */
- (statbuf.st_rdev & 0xff3f) == 0x1600 ) /* hdc, hdd */
+ (statbuf.st_rdev & 0xffffff3f) == 0x0300 || /* hda, hdb */
+ (statbuf.st_rdev & 0xffffff0f) == 0x0800 || /* sd */
+ (statbuf.st_rdev & 0xffffff3f) == 0x0d00 || /* xd */
+ (statbuf.st_rdev & 0xffffff3f) == 0x1600 ) /* hdc, hdd */
)
die ("Device partition expected, not making filesystem on entire device '%s' (use -I to override)");

View File

@ -1,14 +0,0 @@
--- dosfstools-3.0.9/src/check.c.old 2010-01-23 10:13:17.000000000 +0100
+++ dosfstools-3.0.9/src/check.c 2011-01-31 17:43:31.462674941 +0100
@@ -174,7 +174,10 @@
offset = fs->root_start+next_free*sizeof(DIR_ENT);
memset(de,0,sizeof(DIR_ENT));
while (1) {
- sprintf(de->name,pattern,curr_num);
+ char expanded[12];
+ sprintf(expanded, pattern, curr_num);
+ memcpy(de->name, expanded, 8);
+ memcpy(de->ext, expanded+8, 3);
for (scan = 0; scan < fs->root_entries; scan++)
if (scan != next_free &&
!strncmp(root[scan].name,de->name,MSDOS_NAME))

View File

@ -1,18 +1,18 @@
Name: dosfstools
Summary: Utilities for making and checking MS-DOS FAT filesystems on Linux
Version: 3.0.11
Release: 5%{?dist}
Version: 3.0.12
Release: 1%{?dist}
License: GPLv3+
Group: Applications/System
Source0: http://www.daniel-baumann.ch/software/dosfstools/%{name}-%{version}.tar.bz2
URL: http://www.daniel-baumann.ch/software/dosfstools/
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# Fix buffer overflow in alloc_rootdir_entry (#674095)
Patch0: dosfstools-3.0.9-fix-alloc-rootdir-entry.patch
# Fix dosfslable on FAT32 (#693662)
Patch1: dosfstools-3.0.11-dosfslabel-fat32.patch
Patch0: dosfstools-3.0.12-fix-alloc-rootdir-entry.patch
# Fix dosfslabel on FAT32 (#693662)
Patch1: dosfstools-3.0.12-dosfslabel-fat32.patch
# Fix device partitions detection (#710480)
Patch2: dosfstools-3.0.9-dev-detect-fix.patch
Patch2: dosfstools-3.0.12-dev-detect-fix.patch
%description
The dosfstools package includes the mkdosfs and dosfsck utilities,
@ -42,6 +42,10 @@ rm -rf %{buildroot}
%{_mandir}/man8/*
%changelog
* Sat Oct 29 2011 Jaroslav Škarvada <jskarvad@redhat.com> - 3.0.12-1
- New version, all patches were rebased
Resolves: rhbz#749969
* Fri Jun 03 2011 Jaroslav Škarvada <jskarvad@redhat.com> - 3.0.11-5
- Fixed device partitions detection
Resolves: rhbz#710480