Release notes: https://sourceforge.net/projects/isync/files/isync/1.5.0/

Upstream added new printf(3) %n code and hardcoded optimizations...

Upstream now also forks during sync operation soley to call getaddrinfo(3)
asynchronously;  luckily the commit reverts cleanly on top of 1.5.0, which
I do to avoid pledging "proc" for all use cases.

https://sourceforge.net/p/isync/isync/ci/ec50c55c36887b86b0143a265acae4b22d117fe9
Sourceforge seems to lack raw patch links, so I mirrored it.

Keeps working for me, please test with your setup.

Feedback?

Index: Makefile
===================================================================
RCS file: /cvs/ports/mail/isync/Makefile,v
diff -u -p -r1.58 Makefile
--- Makefile    9 Jan 2024 15:59:25 -0000       1.58
+++ Makefile    18 Aug 2024 10:34:16 -0000
@@ -1,7 +1,6 @@
 COMMENT=       synchronize IMAP4 and maildir mailboxes
 
-DISTNAME=      isync-1.4.4
-REVISION=      3
+DISTNAME=      isync-1.5.0
 
 CATEGORIES=    mail
 SITES=         ${SITE_SOURCEFORGE:=isync/}
@@ -9,6 +8,12 @@ SITES=         ${SITE_SOURCEFORGE:=isync/}
 HOMEPAGE=      https://isync.sourceforge.net/
 
 MAINTAINER=    Klemens Nanni <k...@openbsd.org>
+
+# Backout "make DNS lookup asynchronous" doing fork(2) for async getaddrinfo(3)
+# to avoid pledging "proc".
+SITES.fix=             https://git.sr.ht/~klemens/isync/commit/
+PATCHFILES.fix=        ec50c55c36887b86b0143a265acae4b22d117fe9.patch
+PATCH_DIST_STRIP=      -R -p1
 
 # GPLv2+
 PERMIT_PACKAGE=        Yes
Index: distinfo
===================================================================
RCS file: /cvs/ports/mail/isync/distinfo,v
diff -u -p -r1.21 distinfo
--- distinfo    3 Dec 2021 14:44:33 -0000       1.21
+++ distinfo    18 Aug 2024 10:23:38 -0000
@@ -1,2 +1,4 @@
-SHA256 (isync-1.4.4.tar.gz) = fDJziU8i6YMwozAFHp2UL9n/vAK5GVLC8YlqXDfnAP8=
-SIZE (isync-1.4.4.tar.gz) = 340544
+SHA256 (ec50c55c36887b86b0143a265acae4b22d117fe9.patch) = 
IKdVbQZaW81x3MlvdxGlHB4+SAuk5w/u36xtwSkpC8U=
+SHA256 (isync-1.5.0.tar.gz) = oMgeEJOHvyedoWFFMQM5nneUav7PXFH5QTxedzVX940=
+SIZE (ec50c55c36887b86b0143a265acae4b22d117fe9.patch) = 12430
+SIZE (isync-1.5.0.tar.gz) = 412925
Index: patches/patch-src_common_h
===================================================================
RCS file: patches/patch-src_common_h
diff -N patches/patch-src_common_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_common_h  18 Aug 2024 10:08:18 -0000
@@ -0,0 +1,14 @@
+Remove hardcoded optimization level
+
+Index: src/common.h
+--- src/common.h.orig
++++ src/common.h
+@@ -96,7 +96,7 @@ typedef unsigned long ulong;
+ # define ATTR_UNUSED __attribute__((unused))
+ # define ATTR_NORETURN __attribute__((noreturn))
+ # define ATTR_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+-# define ATTR_OPTIMIZE __attribute__((optimize("2")))
++# define ATTR_OPTIMIZE
+ #else
+ # define ATTR_UNUSED
+ # define ATTR_NORETURN
Index: patches/patch-src_config_c
===================================================================
RCS file: patches/patch-src_config_c
diff -N patches/patch-src_config_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_config_c  3 Aug 2024 10:21:58 -0000
@@ -0,0 +1,36 @@
+Neuter printf(3) %n
+
+Index: src/config.c
+--- src/config.c.orig
++++ src/config.c
+@@ -446,11 +446,15 @@ load_config( const char *where )
+       if (!where) {
+               int path_len, path_len2;
+               const char *config_home = getenv( "XDG_CONFIG_HOME" );
+-              if (config_home)
+-                      nfsnprintf( path, sizeof(path), "%s/%nisyncrc", 
config_home, &path_len );
+-              else
+-                      nfsnprintf( path, sizeof(path), "%s/.config/%nisyncrc", 
Home, &path_len );
+-              nfsnprintf( path2, sizeof(path2), "%s/%n.mbsyncrc", Home, 
&path_len2 );
++              if (config_home) {
++                      nfsnprintf( path, sizeof(path), "%s/isyncrc", 
config_home );
++                      path_len = strlen( config_home ) + strlen( "/" );
++              } else {
++                      nfsnprintf( path, sizeof(path), "%s/.config/isyncrc", 
Home );
++                      path_len = strlen( Home ) + strlen( "/.config/" );
++              }
++              nfsnprintf( path2, sizeof(path2), "%s/.mbsyncrc", Home );
++              path_len2 = strlen( Home ) + strlen( "/" );
+               struct stat st;
+               int ex = !lstat( path, &st );
+               int ex2 = !lstat( path2, &st );
+@@ -466,7 +470,8 @@ load_config( const char *where )
+       } else {
+               const char *sl = strrchr( where, '/' );
+               if (!sl) {
+-                      nfsnprintf( path, sizeof(path), "./%n%s", 
&cfile.path_len, where );
++                      nfsnprintf( path, sizeof(path), "./%s", where );
++                      cfile.path_len = strlen( "./" );
+                       cfile.file = path;
+               } else {
+                       cfile.path_len = sl - where + 1;
Index: patches/patch-src_drv_imap_c
===================================================================
RCS file: /cvs/ports/mail/isync/patches/patch-src_drv_imap_c,v
diff -u -p -r1.12 patch-src_drv_imap_c
--- patches/patch-src_drv_imap_c        11 Mar 2022 19:34:38 -0000      1.12
+++ patches/patch-src_drv_imap_c        3 Aug 2024 08:30:03 -0000
@@ -3,7 +3,7 @@ Use pledge.
 Index: src/drv_imap.c
 --- src/drv_imap.c.orig
 +++ src/drv_imap.c
-@@ -45,6 +45,8 @@
+@@ -22,6 +22,8 @@
  # include <Security/Security.h>
  #endif
  
@@ -12,9 +12,9 @@ Index: src/drv_imap.c
  #ifdef HAVE_LIBSSL
  enum { SSL_None, SSL_STARTTLS, SSL_IMAPS };
  #endif
-@@ -3768,6 +3770,8 @@ imap_parse_store( conffile_t *cfg, store_conf_t **stor
- #endif
+@@ -3984,6 +3986,8 @@ imap_parse_store( conffile_t *cfg, store_conf_t **stor
                                143;
+               }
        }
 +      if (server->sconf.tunnel || server->user_cmd || server->pass_cmd)
 +              needs_proc_exec = 1;
Index: patches/patch-src_main_c
===================================================================
RCS file: /cvs/ports/mail/isync/patches/patch-src_main_c,v
diff -u -p -r1.11 patch-src_main_c
--- patches/patch-src_main_c    11 Mar 2022 19:34:38 -0000      1.11
+++ patches/patch-src_main_c    18 Aug 2024 10:38:05 -0000
@@ -3,16 +3,16 @@ Use pledge.
 Index: src/main.c
 --- src/main.c.orig
 +++ src/main.c
-@@ -125,6 +125,8 @@ PACKAGE " " VERSION " - mailbox synchronizer\n"
-       exit( code );
- }
+@@ -14,6 +14,8 @@
+ # include <sys/prctl.h>
+ #endif
  
 +int needs_proc_exec = 0;
 +
- static void ATTR_PRINTFLIKE(1, 2)
- debug( const char *msg, ... )
+ static void ATTR_NORETURN
+ version( void )
  {
-@@ -757,6 +759,36 @@ main( int argc, char **argv )
+@@ -560,6 +562,36 @@ main( int argc, char **argv )
  
        if (load_config( config ))
                return 1;
@@ -47,5 +47,5 @@ Index: src/main.c
 +              }
 +      }
  
-       if (!channels) {
-               fputs( "No channels defined. Try 'man " EXE "'\n", stderr );
+       signal( SIGPIPE, SIG_IGN );
+ 

Reply via email to