Le jeudi 30 juillet 2020 à 21:11:38+0200, Bachsau a écrit :
> Package: backup-manager
> Version: 0.7.14-1+deb10u1
> Severity: important
> Tags: patch
> 
> Dear Maintainer,
> 
> backup-manager-upload fails to gather a list of files from the FTP server in 
> order to purge them. The error message from Perl is "Not an ARRAY reference". 
> It also fails to find the archives for uploading because it uses `basename` 
> on the full path without changing its working directory before.
> 
> Both of these errors are caused by serious mistakes in the code, which 
> doesn't seem to have been tested thoroughly after backup-manager was updated 
> to use a new library for uploads.

Dear Maxi,

Due to the bug being a bit old, of important severity, and the upcoming
freeze, I made a patch from Bachsau's work and made a NMU upload to
DELAYED/5.

I also updated the git repository on salsa accordingly, and I attach the
NMU patchset here.

Should you have any issue with this NMU, please do feel free to tell me
to cancel it and I'll do.

If you need some help to maintain backup-manager, don't hesitate to
tell, I'm eager to do a more important release to get lintian happy and
fit the latest release of the Policy.

With best regards,

-- 
Pierre-Elliott Bécue
GPG: 9AE0 4D98 6400 E3B6 7528  F493 0D44 2664 1949 74E2
It's far easier to fight for one's principles than to live up to them.
From 0c7a470e88d879ee0fd664284925f21c2452db76 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pierre-Elliott=20B=C3=A9cue?= <p...@debian.org>
Date: Wed, 27 Jan 2021 01:08:03 +0100
Subject: [PATCH] Add new patch:
 0007-Fixes-two-coding-bugs-in-backup-manager-upload

Thanks to Bachsau for reporting (Closes: #966566)
---
 debian/changelog                              |  8 ++++
 ...coding-bugs-in-backup-manager-upload.patch | 44 +++++++++++++++++++
 debian/patches/series                         |  1 +
 3 files changed, 53 insertions(+)
 create mode 100644 debian/patches/0007-Fixes-two-coding-bugs-in-backup-manager-upload.patch

diff --git a/debian/changelog b/debian/changelog
index 770207d..73a7b72 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+backup-manager (0.7.14-1.2) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Add new patch: 0007-Fixes-two-coding-bugs-in-backup-manager-upload
+    Thanks to Bachsau for reporting (Closes: #966566)
+
+ -- Pierre-Elliott Bécue <p...@debian.org>  Wed, 27 Jan 2021 01:07:50 +0100
+
 backup-manager (0.7.14-1.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff --git a/debian/patches/0007-Fixes-two-coding-bugs-in-backup-manager-upload.patch b/debian/patches/0007-Fixes-two-coding-bugs-in-backup-manager-upload.patch
new file mode 100644
index 0000000..006a70d
--- /dev/null
+++ b/debian/patches/0007-Fixes-two-coding-bugs-in-backup-manager-upload.patch
@@ -0,0 +1,44 @@
+From: Bachsau <d...@bachsau.com>
+Date: Wed, 27 Jan 2021 01:05:07 +0100
+Subject: Fixes two coding bugs in backup-manager-upload
+
+backup-manager-upload fails to gather a list of files from the FTP
+server in order to purge them. The error message from Perl is "Not an
+ARRAY reference". It also fails to find the archives for uploading
+because it uses `basename` on the full path without changing its working
+directory before.
+
+This patch fixes these two bugs
+---
+ backup-manager-upload | 11 ++---------
+ 1 file changed, 2 insertions(+), 9 deletions(-)
+
+diff --git a/backup-manager-upload b/backup-manager-upload
+index d159eae..1366f60 100755
+--- a/backup-manager-upload
++++ b/backup-manager-upload
+@@ -526,13 +526,7 @@ sub ftp_clean_directory($)
+     # First, create the list of existing archives
+     my ($fh, $filename) = get_tempfile('ftp-archives-XXXXXX');
+     my $BM_UPLOAD_FTP_SECURE = $ENV{"BM_UPLOAD_FTP_SECURE"};
+-    my $ra_files;
+-    if ($BM_UPLOAD_FTP_SECURE eq "true") {
+-        $ra_files = $ftp->list();
+-    }
+-    else {
+-        $ra_files = $ftp->ls();
+-    }
++    my $ra_files = $ftp->ls();
+     foreach my $file (@$ra_files) {
+         print $fh "$file\n";
+     }
+@@ -812,8 +806,7 @@ sub ftp_put_file ($$)
+ sub ftptls_put_file ($$)
+ {
+     my ($ftp, $file) = @_;
+-    my $basename = basename ($file);
+-    return $ftp->put ($basename, $file);
++    return $ftp->put ($file);
+ }
+ 
+ # }}}
diff --git a/debian/patches/series b/debian/patches/series
index cec10e4..4ee0ee7 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@ debian-user-guide-location.patch
 fix-tar-errors.patch
 fix-sanitize-messages.patch
 fix-purging-of-remote-archives-via-ftp-or-ssh.patch
+0007-Fixes-two-coding-bugs-in-backup-manager-upload.patch
-- 
2.29.2

Attachment: signature.asc
Description: PGP signature

Reply via email to