summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2023-10-12 08:51:47 +0000
committerdakkar <dakkar@thenautilus.net>2023-10-12 08:51:47 +0000
commit12bfd9389010febae25a4737e2e716148b833f0f (patch)
tree4df5dc7728fc8be46d5c50788102f40c1a8a269b
parentfrom exelion (diff)
parentfrom luxion (diff)
downloadportage-patches-12bfd9389010febae25a4737e2e716148b833f0f.tar.gz
portage-patches-12bfd9389010febae25a4737e2e716148b833f0f.tar.bz2
portage-patches-12bfd9389010febae25a4737e2e716148b833f0f.zip
Merge branch 'luxion'
-rw-r--r--mail-mta/netqmail/outgoingip.patch150
-rw-r--r--www-apps/cgit-1.2.3/submodule-case.patch30
-rw-r--r--www-apps/cgit-1.2.3/submodules-cache.patch31
3 files changed, 211 insertions, 0 deletions
diff --git a/mail-mta/netqmail/outgoingip.patch b/mail-mta/netqmail/outgoingip.patch
new file mode 100644
index 0000000..c5c6632
--- /dev/null
+++ b/mail-mta/netqmail/outgoingip.patch
@@ -0,0 +1,150 @@
+diff --git i/qmail-control.9 w/qmail-control.9
+index 822f397..f3f77d6 100644
+--- i/qmail-control.9
++++ w/qmail-control.9
+@@ -60,6 +60,7 @@ control default used by
+ .I localiphost \fIme \fRqmail-smtpd
+ .I locals \fIme \fRqmail-send
+ .I morercpthosts \fR(none) \fRqmail-smtpd
++.I outgoingip \fR0.0.0.0 \fRqmail-remote
+ .I percenthack \fR(none) \fRqmail-send
+ .I plusdomain \fIme \fRqmail-inject
+ .I qmqpservers \fR(none) \fRqmail-qmqpc
+diff --git i/qmail-remote.8 w/qmail-remote.8
+index 685f47c..0a29a0b 100644
+--- i/qmail-remote.8
++++ w/qmail-remote.8
+@@ -137,6 +137,13 @@ is the fully-qualified domain name of the server).
+ .IR (tlshosts/<FQDN>.pem
+ takes precedence over this file however).
+
++.TP 5
++.I outgoingip
++IP address to be used on outgoing connections.
++Default: system-defined.
++The value
++.IR 0.0.0.0
++is equivalent to the system default.
+ .TP 5
+ .I smtproutes
+ Artificial SMTP routes.
+diff --git i/qmail-remote.c w/qmail-remote.c
+index 9787135..254b078 100644
+--- i/qmail-remote.c
++++ w/qmail-remote.c
+@@ -40,6 +40,7 @@ GEN_ALLOC_readyplus(saa,stralloc,sa,len,a,i,n,x,10,saa_readyplus)
+ static stralloc sauninit = {0};
+
+ stralloc helohost = {0};
++stralloc outgoingip = {0};
+ stralloc routes = {0};
+ struct constmap maproutes;
+ stralloc host = {0};
+@@ -49,6 +50,7 @@ stralloc sender = {0};
+ saa reciplist = {0};
+
+ struct ip_address partner;
++struct ip_address outip;
+
+ #ifdef TLS
+ # include <sys/stat.h>
+@@ -70,6 +72,7 @@ for (i = 0;i < sa->len;++i) {
+ ch = sa->s[i]; if (ch < 33) ch = '?'; if (ch > 126) ch = '?';
+ if (substdio_put(subfdoutsmall,&ch,1) == -1) _exit(0); } }
+
++void temp_noip() { out("Zinvalid ipaddr in control/outgoingip (#4.3.0)\n"); zerodie(); }
+ void temp_nomem() { out("ZOut of memory. (#4.3.0)\n"); zerodie(); }
+ void temp_oserr() { out("Z\
+ System resources temporarily unavailable. (#4.3.0)\n"); zerodie(); }
+@@ -742,6 +745,7 @@ int flagcname;
+
+ void getcontrols()
+ {
++ int r;
+ if (control_init() == -1) temp_control();
+ if (control_readint(&timeout,"control/timeoutremote") == -1) temp_control();
+ if (control_readint(&timeoutconnect,"control/timeoutconnect") == -1)
+@@ -756,6 +760,12 @@ void getcontrols()
+ case 1:
+ if (!constmap_init(&maproutes,routes.s,routes.len,1)) temp_nomem(); break;
+ }
++ r = control_readline(&outgoingip,"control/outgoingip");
++ if (-1 == r) { if (errno == error_nomem) temp_nomem(); temp_control(); }
++ if (0 == r && !stralloc_copys(&outgoingip, "0.0.0.0")) temp_nomem();
++ if (str_equal(outgoingip.s, "0.0.0.0"))
++ { outip.d[0]=outip.d[1]=outip.d[2]=outip.d[3]=(unsigned long) 0; }
++ else if (!ip_scan(outgoingip.s, &outip)) temp_noip();
+ }
+
+ void main(argc,argv)
+@@ -854,7 +864,7 @@ char **argv;
+ smtpfd = socket(AF_INET,SOCK_STREAM,0);
+ if (smtpfd == -1) temp_oserr();
+
+- if (timeoutconn(smtpfd,&ip.ix[i].ip,(unsigned int) port,timeoutconnect) == 0) {
++ if (timeoutconn(smtpfd,&ip.ix[i].ip,&outip,(unsigned int) port,timeoutconnect) == 0) {
+ tcpto_err(&ip.ix[i].ip,0);
+ partner = ip.ix[i].ip;
+ #ifdef TLS
+diff --git i/qmail-showctl.c w/qmail-showctl.c
+index a24aa63..4e44beb 100644
+--- i/qmail-showctl.c
++++ w/qmail-showctl.c
+@@ -230,6 +230,7 @@ void main()
+ do_str("localiphost",1,"localiphost","Local IP address becomes ");
+ do_lst("locals","Messages for me are delivered locally.","Messages for "," are delivered locally.");
+ do_str("me",0,"undefined! Uh-oh","My name is ");
++ do_str("outgoingip",0,"0.0.0.0","Outgoing IP address is ");
+ do_lst("percenthack","The percent hack is not allowed.","The percent hack is allowed for user%host@",".");
+ do_str("plusdomain",1,"plusdomain","Plus domain name is ");
+ do_lst("qmqpservers","No QMQP servers.","QMQP server: ",".");
+diff --git i/remoteinfo.c w/remoteinfo.c
+index c7abd70..5532813 100644
+--- i/remoteinfo.c
++++ w/remoteinfo.c
+@@ -44,12 +44,12 @@ int timeout;
+ s = socket(AF_INET,SOCK_STREAM,0);
+ if (s == -1) return 0;
+
+- byte_zero(&sin,sizeof(sin));
++/* byte_zero(&sin,sizeof(sin));
+ sin.sin_family = AF_INET;
+ byte_copy(&sin.sin_addr,4,ipl);
+ sin.sin_port = 0;
+- if (bind(s,(struct sockaddr *) &sin,sizeof(sin)) == -1) { close(s); return 0; }
+- if (timeoutconn(s,ipr,113,timeout) == -1) { close(s); return 0; }
++ if (bind(s,(struct sockaddr *) &sin,sizeof(sin)) == -1) { close(s); return 0; } */
++ if (timeoutconn(s,ipr,ipl,113,timeout) == -1) { close(s); return 0; }
+ fcntl(s,F_SETFL,fcntl(s,F_GETFL,0) & ~O_NDELAY);
+
+ len = 0;
+diff --git i/timeoutconn.c w/timeoutconn.c
+index 33a16d9..e768b52 100644
+--- i/timeoutconn.c
++++ w/timeoutconn.c
+@@ -10,9 +10,10 @@
+ #include "byte.h"
+ #include "timeoutconn.h"
+
+-int timeoutconn(s,ip,port,timeout)
++int timeoutconn(s,ip,outip,port,timeout)
+ int s;
+ struct ip_address *ip;
++struct ip_address *outip;
+ unsigned int port;
+ int timeout;
+ {
+@@ -22,6 +23,13 @@ int timeout;
+ fd_set wfds;
+ struct timeval tv;
+
++ /* bind() an outgoing ipaddr */
++ byte_zero(&sin,sizeof(sin));
++ byte_copy(&sin.sin_addr.s_addr,4,outip);
++ sin.sin_family = AF_INET;
++
++ if (-1 == bind(s,(struct sockaddr *) &sin,sizeof(sin))) return -1;
++
+ byte_zero(&sin,sizeof(sin));
+ byte_copy(&sin.sin_addr,4,ip);
+ x = (char *) &sin.sin_port;
diff --git a/www-apps/cgit-1.2.3/submodule-case.patch b/www-apps/cgit-1.2.3/submodule-case.patch
new file mode 100644
index 0000000..89665e2
--- /dev/null
+++ b/www-apps/cgit-1.2.3/submodule-case.patch
@@ -0,0 +1,30 @@
+Subject: [PATCH] shared: compare submodules case-insensitively
+
+If module-link is read from a repository's Git config, then our callback
+is invoked with the name converted to lower case (as all Git config keys
+are). This means we can never match a submodule containing uppercase
+characters against such a module-link.
+
+Compare submodule names case-insensitively to avoid this problem. This
+may break a use case where two submodules differ only in case, but that
+is much less likely than a submodule name using uppercase characters.
+
+Signed-off-by: John Keeping <john@keeping.me.uk>
+---
+ shared.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/shared.c b/shared.c
+index 609bd2a..777618d 100644
+--- a/shared.c
++++ b/shared.c
+@@ -77,6 +77,7 @@ struct cgit_repo *cgit_add_repo(const char *url)
+ ret->owner_filter = ctx.cfg.owner_filter;
+ ret->clone_url = ctx.cfg.clone_url;
+ ret->submodules.strdup_strings = 1;
++ ret->submodules.cmp = strcasecmp;
+ ret->hide = ret->ignore = 0;
+ return ret;
+ }
+--
+2.28.0
diff --git a/www-apps/cgit-1.2.3/submodules-cache.patch b/www-apps/cgit-1.2.3/submodules-cache.patch
new file mode 100644
index 0000000..e440cf9
--- /dev/null
+++ b/www-apps/cgit-1.2.3/submodules-cache.patch
@@ -0,0 +1,31 @@
+From 9c8f12809a7727b19a111d717b27143c4e2001bd Mon Sep 17 00:00:00 2001
+From: dakkar <dakkar@thenautilus.net>
+Date: Sat, 26 Mar 2022 10:39:45 +0000
+Subject: [PATCH] cgit.c: teach repo config printing about per-path module-link
+
+This prevented path-specific module-links from working when cache was
+enabled, since the cache repo config didn't include them.
+
+Signed-off-by: Gianni Ceccarelli <dakkar@thenautilus.net>
+---
+ cgit.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/cgit.c b/cgit.c
+index 08d81a1..ae3a66e 100644
+--- a/cgit.c
++++ b/cgit.c
+@@ -810,6 +810,10 @@ static void print_repo(FILE *f, struct cgit_repo *repo)
+ fprintf(f, "repo.extra-head-content=%s\n", repo->extra_head_content);
+ if (repo->module_link)
+ fprintf(f, "repo.module-link=%s\n", repo->module_link);
++ for_each_string_list_item(item, &repo->submodules) {
++ if (item->util)
++ fprintf(f, "repo.module-link.%s=%s\n", item->string, (char*)item->util);
++ }
+ if (repo->section)
+ fprintf(f, "repo.section=%s\n", repo->section);
+ if (repo->homepage)
+--
+2.34.1
+