[dosfstools] Fixed dosfslabel (by fix-label patch)

Jaroslav Škarvada jskarvad at fedoraproject.org
Thu May 2 13:25:23 UTC 2013


commit 2e93a9222a1ea3f9bc0c47d5faa35a1487a4762d
Author: Jaroslav Škarvada <jskarvad at redhat.com>
Date:   Thu May 2 15:25:18 2013 +0200

    Fixed dosfslabel (by fix-label patch)
    
      Resolves: rhbz#948055

 dosfstools-3.0.16-fix-label.patch |   23 +++++++++++++++++++++++
 dosfstools.spec                   |    9 ++++++++-
 2 files changed, 31 insertions(+), 1 deletions(-)
---
diff --git a/dosfstools-3.0.16-fix-label.patch b/dosfstools-3.0.16-fix-label.patch
new file mode 100644
index 0000000..8ddeb39
--- /dev/null
+++ b/dosfstools-3.0.16-fix-label.patch
@@ -0,0 +1,23 @@
+diff -up dosfstools-3.0.16/src/dosfslabel.c.orig dosfstools-3.0.16/src/dosfslabel.c
+--- dosfstools-3.0.16/src/dosfslabel.c.orig	2013-03-01 08:58:26.000000000 +0100
++++ dosfstools-3.0.16/src/dosfslabel.c	2013-05-02 15:15:24.209671197 +0200
+@@ -90,7 +90,7 @@ int main(int argc, char *argv[])
+     int i;
+ 
+     char *device = NULL;
+-    char *label = NULL;
++    char label[12] = {0};
+ 
+     loff_t offset;
+     DIR_ENT de;
+@@ -109,8 +109,8 @@ int main(int argc, char *argv[])
+ 
+     device = argv[1];
+     if (argc == 3) {
+-	label = argv[2];
+-	if (strlen(label) > 11) {
++	strncpy(label, argv[2], 11);
++	if (strlen(argv[2]) > 11) {
+ 	    fprintf(stderr,
+ 		    "dosfslabel: labels can be no longer than 11 characters\n");
+ 	    exit(1);
diff --git a/dosfstools.spec b/dosfstools.spec
index 122c500..2da9f77 100644
--- a/dosfstools.spec
+++ b/dosfstools.spec
@@ -1,11 +1,13 @@
 Name: dosfstools
 Summary: Utilities for making and checking MS-DOS FAT filesystems on Linux
 Version: 3.0.16
-Release: 2%{?dist}
+Release: 3%{?dist}
 License: GPLv3+
 Group: Applications/System
 Source0: http://www.daniel-baumann.ch/software/dosfstools/%{name}-%{version}.tar.xz
 URL: http://www.daniel-baumann.ch/software/dosfstools/
+# Sent upstream
+Patch0: dosfstools-3.0.16-fix-label.patch
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 %description
@@ -15,6 +17,7 @@ drives or on floppies.
 
 %prep
 %setup -q
+%patch0 -p1 -b .fix-label
 
 %build
 make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing"
@@ -33,6 +36,10 @@ rm -rf %{buildroot}
 %{_mandir}/man8/*
 
 %changelog
+* Thu May  2 2013 Jaroslav Škarvada <jskarvad at redhat.com> - 3.0.16-3
+- Fixed dosfslabel (by fix-label patch)
+  Resolves: rhbz#948055
+
 * Mon Mar 11 2013 Jaroslav Škarvada <jskarvad at redhat.com> - 3.0.16-2
 - Source0 URL synced with upstream
 


More information about the scm-commits mailing list