Package: fatresize
Version: 1.0.2-8
Severity: normal
Tags: patch

Dear Maintainer,

   * What led up to the situation?

Trying to resize an SD card in the onboard reader, with the partition
/dev/mmcblk0p1.

   * What exactly did you do (or not do) that was effective (or
     ineffective)?
   * What was the outcome of this action?

fatresize 1.0.2 (11/06/15)
.Error: Could not stat device /dev/mmcblk0p - No such file or directory.

   * What outcome did you expect instead?

Not fail. I quickly realized that it garbles the filename. First I
expected something with a stupid short buffer for the filename but then
I discovered that it uses the most basic assumption while deriving the
harddisk device name. And a p prefix before partition name is not part
of that scheme.

Patch attached.

Regards,
Eduard.


-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.4.0-rc8-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages fatresize depends on:
ii  libc6                 2.19-22
ii  libparted-fs-resize0  3.2-12
ii  libparted2            3.2-12

fatresize recommends no packages.

Versions of packages fatresize suggests:
ii  dosfstools  3.0.28-2

-- no debconf information
Description: cope with filenames containg a p prefix before partition number
Author: Eduard Bloch <[email protected]>
Bug-Debian: https://bugs.debian.org/795870

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- fatresize-1.0.2.orig/fatresize.c
+++ fatresize-1.0.2/fatresize.c
@@ -162,6 +162,9 @@ get_devname(char *dev)
 	    strcpy(p, p+5);
     }
 
+    if( (p-dev) > 2 && devname[p-dev] == 'p' && isdigit( (unsigned) devname[p-dev-1]))
+	    devname[p-dev] = '\0';
+
     return devname;
 }
 

Reply via email to