Package: partclone
Version: 0.3.11-1+b3
Version: 0.3.13+dfsg-4
Severity: minor
Tags: patch

Dear Maintainer,

When invoked without path, the partclone.XXX executables all report
as "unset_name", as in the transcript below; first in buster,
then a sid chroot:


nabijaczleweli@tarta:~$ sudo partclone.fat -N
unset_name v0.3.11 http://partclone.org
Usage: unset_name [OPTIONS]
    Efficiently clone to an image, device or standard output.
        <snip>
nabijaczleweli@tarta:~/uwu$ sudo partclone.fat -v
Partclone : v0.3.11 (09daead2d757576cd846cb758dab011801e3fb7b)

root@tarta:/# partclone.chkimg boot.img
Unknown option 'boot.img'.
unset_name v0.3.13 http://partclone.org
Usage: unset_name [OPTIONS]
    Check partclone image.
    <snip>
root@tarta:/# partclone.fat -N
unset_name v0.3.13 http://partclone.org
Usage: unset_name [OPTIONS]
    Efficiently clone to an image, device or standard output.
    <snip>
root@tarta:/# partclone.fat -v
Partclone : v0.3.13 (930e8a1cd88a44d50902e73cf14eb78d6a46a967)


I've narrowed this down to the save_program_name() function ignoring
argv[0] when it contains no slashes, and am attaching a patch,
based on 0.3.13+dfsg-4, that uses the full argument in that case
instead, as well as one that fixes a typo that bugged me.

If you prefer, there's also a git repository you can pull from at
<https://github.com/nabijaczleweli/partclone.deb>.

Best,
наб


-- System Information:
Debian Release: 10.3
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.19.0-8-amd64 (SMP w/24 CPU cores)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_FIRMWARE_WORKAROUND, 
TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB:en (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages partclone depends on:
ii  libblkid1      2.33.1-0.1
ii  libc6          2.28-10
ii  libcom-err2    1.44.5-1+deb10u3
ii  libext2fs2     1.44.5-1+deb10u3
ii  libncursesw6   6.1+20181013-2+deb10u2
ii  libntfs-3g883  1:2017.3.23AR.3-3
ii  libtinfo6      6.1+20181013-2+deb10u2
ii  libuuid1       2.33.1-0.1
ii  nilfs-tools    2.2.7-1

partclone recommends no packages.

partclone suggests no packages.

-- no debconf information
From 941a7e0e904c9a209571f5a45d402e9994a0c85e Mon Sep 17 00:00:00 2001
From: nabijaczleweli <nabijaczlew...@gmail.com>
Date: Sun, 26 Apr 2020 19:38:52 +0200
Subject: [PATCH 1/2] Fix exec_name not updating to argv[0] if it contains no
 slashes

Before:
root@tarta:/# /sbin/partclone.fat -N
partclone.fat v0.3.13 http://partclone.org
Usage: partclone.fat [OPTIONS]
    Efficiently clone to an image, device or standard output.
    <snip>
root@tarta:/# partclone.fat -N
unset_name v0.3.13 http://partclone.org
Usage: unset_name [OPTIONS]
    Efficiently clone to an image, device or standard output.
    <snip>

After:
root@tarta:/# /sbin/partclone.fat -N
partclone.fat v0.3.13 http://partclone.org
Usage: partclone.fat [OPTIONS]
    Efficiently clone to an image, device or standard output.
    <snip>
root@tarta:/# partclone.fat -N
partclone.fat v0.3.13 http://partclone.org
Usage: partclone.fat [OPTIONS]
    Efficiently clone to an image, device or standard output.
    <snip>
---
 src/partclone.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/partclone.c b/src/partclone.c
index 6b83ab7..fd427de 100644
--- a/src/partclone.c
+++ b/src/partclone.c
@@ -308,6 +308,8 @@ static void save_program_name(const char* argv0) {
 	if (last_slash != 0) {
 
 		exec_name = last_slash + 1;
+	} else {
+		exec_name = argv0;
 	}
 }
 
-- 
2.20.1

From b02b6c8a47df8709d9fdf7a3f0ca09af8196ccde Mon Sep 17 00:00:00 2001
From: nabijaczleweli <nabijaczlew...@gmail.com>
Date: Sun, 26 Apr 2020 20:15:14 +0200
Subject: [PATCH 2/2] Fix Norma[nl]ly typo in manpages

---
 docs/partclone.8           | 4 ++--
 docs/partclone.chkimg.8    | 2 +-
 docs/partclone.chkimg.xml  | 2 +-
 docs/partclone.dd.8        | 4 ++--
 docs/partclone.dd.xml      | 4 ++--
 docs/partclone.imager.8    | 4 ++--
 docs/partclone.imager.xml  | 4 ++--
 docs/partclone.restore.8   | 4 ++--
 docs/partclone.restore.xml | 4 ++--
 docs/partclone.xml         | 4 ++--
 10 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/docs/partclone.8 b/docs/partclone.8
index 8f98055..10e39be 100644
--- a/docs/partclone.8
+++ b/docs/partclone.8
@@ -75,14 +75,14 @@ The program follows the usual GNU command line syntax, with long options startin
 .PP
 \fB\-s \fR\fB\fIFILE\fR\fR, \fB\-\-source \fR\fB\fIFILE\fR\fR
 .RS 4
-Source FILE\&. The FILE could be a image file(made by partclone) or device depend on your action\&. Normanly, backup source is device, restore source is image file\&.
+Source FILE\&. The FILE could be a image file(made by partclone) or device depend on your action\&. Normally, backup source is device, restore source is image file\&.
 .sp
 Receving data from pipe line is supported ONLY for restoring, just ignore \-s option or use \*(Aq\-\*(Aq means receive data from stdin\&.
 .RE
 .PP
 \fB\-o \fR\fB\fIFILE\fR\fR, \fB\-\-output \fR\fB\fIFILE\fR\fR
 .RS 4
-Output FILE\&. The FILE could be a image file(partclone will generate) or device depend on your action\&. Normanly, backup output to image file and restore output to device\&.
+Output FILE\&. The FILE could be a image file(partclone will generate) or device depend on your action\&. Normally, backup output to image file and restore output to device\&.
 .sp
 Sending data to pipe line is also supported ONLY for back\-up, just ignore \-o option or use \*(Aq\-\*(Aq means send data to stdout\&.
 .RE
diff --git a/docs/partclone.chkimg.8 b/docs/partclone.chkimg.8
index 356cbb3..08dbe1a 100644
--- a/docs/partclone.chkimg.8
+++ b/docs/partclone.chkimg.8
@@ -47,7 +47,7 @@ The program follows the usual GNU command line syntax, with long options startin
 .PP
 \fB\-s \fR\fB\fIFILE\fR\fR, \fB\-\-source \fR\fB\fIFILE\fR\fR
 .RS 4
-Source FILE\&. The FILE could be a image file(made by partclone) or device depend on your action\&. Normanly, backup source is device, restore source is image file\&.
+Source FILE\&. The FILE could be a image file(made by partclone) or device depend on your action\&. Normally, backup source is device, restore source is image file\&.
 .sp
 Receving data from pipe line is supported ONLY for restoring, just ignore \-s option or use \*(Aq\-\*(Aq means receive data from stdin\&.
 .RE
diff --git a/docs/partclone.chkimg.xml b/docs/partclone.chkimg.xml
index 43bcb85..333b730 100644
--- a/docs/partclone.chkimg.xml
+++ b/docs/partclone.chkimg.xml
@@ -168,7 +168,7 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/
         <term><option>-s <replaceable>FILE</replaceable></option></term>
         <term><option>--source <replaceable>FILE</replaceable></option></term>
         <listitem>
-          <para>Source FILE. The FILE could be a image file(made by partclone) or device depend on your action. Normanly, backup source is device, restore source is image file.</para>
+          <para>Source FILE. The FILE could be a image file(made by partclone) or device depend on your action. Normally, backup source is device, restore source is image file.</para>
           <para>Receving data from pipe line is supported ONLY for restoring, just ignore -s option or use '-' means receive data from stdin.</para>
         </listitem>
       </varlistentry>
diff --git a/docs/partclone.dd.8 b/docs/partclone.dd.8
index 7a9f2f6..acd5df1 100644
--- a/docs/partclone.dd.8
+++ b/docs/partclone.dd.8
@@ -47,14 +47,14 @@ The program follows the usual GNU command line syntax, with long options startin
 .PP
 \fB\-s \fR\fB\fIFILE\fR\fR, \fB\-\-source \fR\fB\fIFILE\fR\fR
 .RS 4
-Source FILE\&. The FILE could be a image file(made by partclone) or device depend on your action\&. Normanly, backup source is device, restore source is image file\&.
+Source FILE\&. The FILE could be a image file(made by partclone) or device depend on your action\&. Normally, backup source is device, restore source is image file\&.
 .sp
 Receving data from pipe line is supported ONLY for restoring, just ignore \-s option or use \*(Aq\-\*(Aq means receive data from stdin\&.
 .RE
 .PP
 \fB\-o \fR\fB\fIFILE\fR\fR, \fB\-\-output \fR\fB\fIFILE\fR\fR
 .RS 4
-Output FILE\&. The FILE could be a image file(partclone will generate) or device depend on your action\&. Normanly, backup output to image file and restore output to device\&.
+Output FILE\&. The FILE could be a image file(partclone will generate) or device depend on your action\&. Normally, backup output to image file and restore output to device\&.
 .sp
 Sending data to pipe line is also supported ONLY for back\-up, just ignore \-o option or use \*(Aq\-\*(Aq means send data to stdout\&.
 .RE
diff --git a/docs/partclone.dd.xml b/docs/partclone.dd.xml
index f11008f..43307ae 100644
--- a/docs/partclone.dd.xml
+++ b/docs/partclone.dd.xml
@@ -200,7 +200,7 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/
         <term><option>-s <replaceable>FILE</replaceable></option></term>
         <term><option>--source <replaceable>FILE</replaceable></option></term>
         <listitem>
-          <para>Source FILE. The FILE could be a image file(made by partclone) or device depend on your action. Normanly, backup source is device, restore source is image file.</para>
+          <para>Source FILE. The FILE could be a image file(made by partclone) or device depend on your action. Normally, backup source is device, restore source is image file.</para>
           <para>Receving data from pipe line is supported ONLY for restoring, just ignore -s option or use '-' means receive data from stdin.</para>
         </listitem>
       </varlistentry>
@@ -208,7 +208,7 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/
         <term><option>-o <replaceable>FILE</replaceable></option></term>
         <term><option>--output <replaceable>FILE</replaceable></option></term>
         <listitem>
-          <para>Output FILE. The FILE could be a image file(partclone will generate) or device depend on your action. Normanly, backup output to image file and restore output to device.</para>
+          <para>Output FILE. The FILE could be a image file(partclone will generate) or device depend on your action. Normally, backup output to image file and restore output to device.</para>
 	  <para>Sending data to pipe line is also supported ONLY for back-up, just ignore -o option or use '-' means send data to stdout.</para>
         </listitem>
       </varlistentry>
diff --git a/docs/partclone.imager.8 b/docs/partclone.imager.8
index 81c5b07..cb83ad8 100644
--- a/docs/partclone.imager.8
+++ b/docs/partclone.imager.8
@@ -47,14 +47,14 @@ The program follows the usual GNU command line syntax, with long options startin
 .PP
 \fB\-s \fR\fB\fIFILE\fR\fR, \fB\-\-source \fR\fB\fIFILE\fR\fR
 .RS 4
-Source FILE\&. The FILE could be a image file(made by partclone) or device depend on your action\&. Normanly, backup source is device, restore source is image file\&.
+Source FILE\&. The FILE could be a image file(made by partclone) or device depend on your action\&. Normally, backup source is device, restore source is image file\&.
 .sp
 Receving data from pipe line is supported ONLY for restoring, just ignore \-s option or use \*(Aq\-\*(Aq means receive data from stdin\&.
 .RE
 .PP
 \fB\-o \fR\fB\fIFILE\fR\fR, \fB\-\-output \fR\fB\fIFILE\fR\fR
 .RS 4
-Output FILE\&. The FILE could be a image file(partclone will generate) or device depend on your action\&. Normanly, backup output to image file and restore output to device\&.
+Output FILE\&. The FILE could be a image file(partclone will generate) or device depend on your action\&. Normally, backup output to image file and restore output to device\&.
 .sp
 Sending data to pipe line is also supported ONLY for back\-up, just ignore \-o option or use \*(Aq\-\*(Aq means send data to stdout\&.
 .RE
diff --git a/docs/partclone.imager.xml b/docs/partclone.imager.xml
index 5ee7024..a70ad11 100644
--- a/docs/partclone.imager.xml
+++ b/docs/partclone.imager.xml
@@ -233,7 +233,7 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/
         <term><option>-s <replaceable>FILE</replaceable></option></term>
         <term><option>--source <replaceable>FILE</replaceable></option></term>
         <listitem>
-          <para>Source FILE. The FILE could be a image file(made by partclone) or device depend on your action. Normanly, backup source is device, restore source is image file.</para>
+          <para>Source FILE. The FILE could be a image file(made by partclone) or device depend on your action. Normally, backup source is device, restore source is image file.</para>
           <para>Receving data from pipe line is supported ONLY for restoring, just ignore -s option or use '-' means receive data from stdin.</para>
         </listitem>
       </varlistentry>
@@ -241,7 +241,7 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/
         <term><option>-o <replaceable>FILE</replaceable></option></term>
         <term><option>--output <replaceable>FILE</replaceable></option></term>
         <listitem>
-          <para>Output FILE. The FILE could be a image file(partclone will generate) or device depend on your action. Normanly, backup output to image file and restore output to device.</para>
+          <para>Output FILE. The FILE could be a image file(partclone will generate) or device depend on your action. Normally, backup output to image file and restore output to device.</para>
 	  <para>Sending data to pipe line is also supported ONLY for back-up, just ignore -o option or use '-' means send data to stdout.</para>
         </listitem>
       </varlistentry>
diff --git a/docs/partclone.restore.8 b/docs/partclone.restore.8
index 29e4a37..465d76a 100644
--- a/docs/partclone.restore.8
+++ b/docs/partclone.restore.8
@@ -47,14 +47,14 @@ The program follows the usual GNU command line syntax, with long options startin
 .PP
 \fB\-s \fR\fB\fIFILE\fR\fR, \fB\-\-source \fR\fB\fIFILE\fR\fR
 .RS 4
-Source FILE\&. The FILE could be a image file(made by partclone) or device depend on your action\&. Normanly, backup source is device, restore source is image file\&.
+Source FILE\&. The FILE could be a image file(made by partclone) or device depend on your action\&. Normally, backup source is device, restore source is image file\&.
 .sp
 Receving data from pipe line is supported ONLY for restoring, just ignore \-s option or use \*(Aq\-\*(Aq means receive data from stdin\&.
 .RE
 .PP
 \fB\-o \fR\fB\fIFILE\fR\fR, \fB\-\-output \fR\fB\fIFILE\fR\fR
 .RS 4
-Output FILE\&. The FILE could be a image file(partclone will generate) or device depend on your action\&. Normanly, backup output to image file and restore output to device\&.
+Output FILE\&. The FILE could be a image file(partclone will generate) or device depend on your action\&. Normally, backup output to image file and restore output to device\&.
 .sp
 Sending data to pipe line is also supported ONLY for back\-up, just ignore \-o option or use \*(Aq\-\*(Aq means send data to stdout\&.
 .RE
diff --git a/docs/partclone.restore.xml b/docs/partclone.restore.xml
index 0ae1ac3..be9528c 100644
--- a/docs/partclone.restore.xml
+++ b/docs/partclone.restore.xml
@@ -200,7 +200,7 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/
         <term><option>-s <replaceable>FILE</replaceable></option></term>
         <term><option>--source <replaceable>FILE</replaceable></option></term>
         <listitem>
-          <para>Source FILE. The FILE could be a image file(made by partclone) or device depend on your action. Normanly, backup source is device, restore source is image file.</para>
+          <para>Source FILE. The FILE could be a image file(made by partclone) or device depend on your action. Normally, backup source is device, restore source is image file.</para>
           <para>Receving data from pipe line is supported ONLY for restoring, just ignore -s option or use '-' means receive data from stdin.</para>
         </listitem>
       </varlistentry>
@@ -208,7 +208,7 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/
         <term><option>-o <replaceable>FILE</replaceable></option></term>
         <term><option>--output <replaceable>FILE</replaceable></option></term>
         <listitem>
-          <para>Output FILE. The FILE could be a image file(partclone will generate) or device depend on your action. Normanly, backup output to image file and restore output to device.</para>
+          <para>Output FILE. The FILE could be a image file(partclone will generate) or device depend on your action. Normally, backup output to image file and restore output to device.</para>
 	  <para>Sending data to pipe line is also supported ONLY for back-up, just ignore -o option or use '-' means send data to stdout.</para>
         </listitem>
       </varlistentry>
diff --git a/docs/partclone.xml b/docs/partclone.xml
index 30d2f12..2885f87 100644
--- a/docs/partclone.xml
+++ b/docs/partclone.xml
@@ -249,7 +249,7 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/
         <term><option>-s <replaceable>FILE</replaceable></option></term>
         <term><option>--source <replaceable>FILE</replaceable></option></term>
         <listitem>
-          <para>Source FILE. The FILE could be a image file(made by partclone) or device depend on your action. Normanly, backup source is device, restore source is image file.</para>
+          <para>Source FILE. The FILE could be a image file(made by partclone) or device depend on your action. Normally, backup source is device, restore source is image file.</para>
           <para>Receving data from pipe line is supported ONLY for restoring, just ignore -s option or use '-' means receive data from stdin.</para>
         </listitem>
       </varlistentry>
@@ -257,7 +257,7 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/
         <term><option>-o <replaceable>FILE</replaceable></option></term>
         <term><option>--output <replaceable>FILE</replaceable></option></term>
         <listitem>
-          <para>Output FILE. The FILE could be a image file(partclone will generate) or device depend on your action. Normanly, backup output to image file and restore output to device.</para>
+          <para>Output FILE. The FILE could be a image file(partclone will generate) or device depend on your action. Normally, backup output to image file and restore output to device.</para>
 	  <para>Sending data to pipe line is also supported ONLY for back-up, just ignore -o option or use '-' means send data to stdout.</para>
         </listitem>
       </varlistentry>
-- 
2.20.1

Attachment: signature.asc
Description: PGP signature

Reply via email to