aboutsummaryrefslogtreecommitdiffstats
path: root/debian/patches
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/Fix-struct-flock-and-timeval-packing-on-armhf.patch61
-rw-r--r--debian/patches/Mention-the-Debian-BTS-in-the-manpages.patch2
-rw-r--r--debian/patches/Skip-randomized-tests.patch2
-rw-r--r--debian/patches/series1
4 files changed, 64 insertions, 2 deletions
diff --git a/debian/patches/Fix-struct-flock-and-timeval-packing-on-armhf.patch b/debian/patches/Fix-struct-flock-and-timeval-packing-on-armhf.patch
new file mode 100644
index 0000000..886e871
--- /dev/null
+++ b/debian/patches/Fix-struct-flock-and-timeval-packing-on-armhf.patch
@@ -0,0 +1,61 @@
+From: Simon Chopin <simon.chopin@canonical.com>
+Date: Tue, 26 Mar 2024 13:19:53 +0100
+Subject: Fix struct flock and timeval packing on armhf
+
+armhf uses a 64-bit off_t, and t64-enabled armhf 64-bit time_t.
+
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/interimap/+bug/2059120
+Bug-Debian: https://bugs.debian.org/1067763
+---
+ lib/Net/IMAP/InterIMAP.pm | 6 +++++-
+ pullimap | 6 +++++-
+ 2 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Net/IMAP/InterIMAP.pm b/lib/Net/IMAP/InterIMAP.pm
+index 10162c7..699f58d 100644
+--- a/lib/Net/IMAP/InterIMAP.pm
++++ b/lib/Net/IMAP/InterIMAP.pm
+@@ -23,6 +23,7 @@ use strict;
+
+ use Compress::Raw::Zlib qw/Z_OK Z_STREAM_END Z_FULL_FLUSH Z_SYNC_FLUSH MAX_WBITS/;
+ use Config::Tiny ();
++use Config;
+ use Errno qw/EEXIST EINTR/;
+ use Net::SSLeay 1.86_06 ();
+ use List::Util qw/all first/;
+@@ -1492,7 +1493,10 @@ sub _tcp_connect($$$) {
+ # timeout connect/read/write/... after 30s
+ # XXX we need to pack the struct timeval manually: not portable!
+ # https://stackoverflow.com/questions/8284243/how-do-i-set-so-rcvtimeo-on-a-socket-in-perl
+- my $timeout = pack('l!l!', 30, 0);
++ # On Ubuntu, armhf is the only arch where time_t != long
++ my $is_arm = $Config{archname} =~ /^arm-/;
++ my $tpl = $is_arm ? 'qq' : 'l!l!';
++ my $timeout = pack($tpl, 30, 0);
+ setsockopt($s, Socket::SOL_SOCKET, Socket::SO_RCVTIMEO, $timeout)
+ or $self->fail("setsockopt SO_RCVTIMEO: $!");
+ setsockopt($s, Socket::SOL_SOCKET, Socket::SO_SNDTIMEO, $timeout)
+diff --git a/pullimap b/pullimap
+index d4aebf9..68dfd96 100755
+--- a/pullimap
++++ b/pullimap
+@@ -31,6 +31,8 @@ use Getopt::Long qw/:config posix_default no_ignore_case gnu_getopt auto_version
+ use List::Util 'first';
+ use Socket qw/PF_INET PF_INET6 SOCK_STREAM IPPROTO_TCP/;
+
++use Config;
++
+ use lib "./lib";
+ use Net::IMAP::InterIMAP 0.5.8 qw/xdg_basedir read_config compact_set/;
+
+@@ -88,7 +90,9 @@ do {
+
+ sysopen($STATE, $statefile, $mode, 0600) or die "Can't open $statefile: $!";
+ # XXX we need to pack the struct flock manually: not portable!
+- my $struct_flock = pack('s!s!l!l!i!', F_WRLCK, SEEK_SET, 0, 0, 0);
++ my $is_arm = $Config{archname} =~ /^arm-/;
++ my $tpl = $is_arm ? 's!s!qqi!' : 's!s!l!l!i!';
++ my $struct_flock = pack($tpl, F_WRLCK, SEEK_SET, 0, 0, 0);
+ fcntl($STATE, F_SETLK, $struct_flock) or die "Can't lock $statefile: $!";
+ my $flags = fcntl($STATE, F_GETFD, 0) or die "fcntl F_GETFD: $!";
+ fcntl($STATE, F_SETFD, $flags | FD_CLOEXEC) or die "fcntl F_SETFD: $!";
diff --git a/debian/patches/Mention-the-Debian-BTS-in-the-manpages.patch b/debian/patches/Mention-the-Debian-BTS-in-the-manpages.patch
index fefcf37..628672c 100644
--- a/debian/patches/Mention-the-Debian-BTS-in-the-manpages.patch
+++ b/debian/patches/Mention-the-Debian-BTS-in-the-manpages.patch
@@ -9,7 +9,7 @@ Forwarded: not-needed
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/doc/interimap.1.md b/doc/interimap.1.md
-index 2d588ae..03adbf5 100644
+index 18b3581..7770e1e 100644
--- a/doc/interimap.1.md
+++ b/doc/interimap.1.md
@@ -574,10 +574,18 @@ Standards
diff --git a/debian/patches/Skip-randomized-tests.patch b/debian/patches/Skip-randomized-tests.patch
index d8c5e88..e097e98 100644
--- a/debian/patches/Skip-randomized-tests.patch
+++ b/debian/patches/Skip-randomized-tests.patch
@@ -46,7 +46,7 @@ index 559daed..61cb37f 100644
- sync-live-tls local/remote simulation (TLS remote)
- sync-live-multi local/remote1+remote2+remote3 simulation (3 local namespaces)
diff --git a/tests/pullimap/t b/tests/pullimap/t
-index 58a19ca..88010c3 100644
+index 1c57f8d..4afbd4b 100644
--- a/tests/pullimap/t
+++ b/tests/pullimap/t
@@ -1,6 +1,6 @@
diff --git a/debian/patches/series b/debian/patches/series
index e237c35..ecb036a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
Mention-the-Debian-BTS-in-the-manpages.patch
Skip-randomized-tests.patch
+Fix-struct-flock-and-timeval-packing-on-armhf.patch