added my Recipes
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
From 58cfb4f86b7fbf19eb643dfba87fdd890b3d4a4a Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Wed, 24 Aug 2022 19:27:31 -0700
|
||||
Subject: [PATCH] ssmtp: Correct the null pointer assignment to char pointers
|
||||
|
||||
Fixes
|
||||
error: incompatible integer to pointer conversion initializing 'char *' with an expression of type 'char' [-Wint-conversion]
|
||||
| char *from = (char)NULL; /* Use this as the From: address */
|
||||
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
ssmtp.c | 20 ++++++++++----------
|
||||
1 file changed, 10 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/ssmtp.c b/ssmtp.c
|
||||
index a74ba4e..0a719ac 100644
|
||||
--- a/ssmtp.c
|
||||
+++ b/ssmtp.c
|
||||
@@ -55,21 +55,21 @@ bool_t use_oldauth = False; /* use old AUTH LOGIN username style */
|
||||
|
||||
#define ARPADATE_LENGTH 32 /* Current date in RFC format */
|
||||
char arpadate[ARPADATE_LENGTH];
|
||||
-char *auth_user = (char)NULL;
|
||||
-char *auth_pass = (char)NULL;
|
||||
-char *auth_method = (char)NULL; /* Mechanism for SMTP authentication */
|
||||
-char *mail_domain = (char)NULL;
|
||||
-char *from = (char)NULL; /* Use this as the From: address */
|
||||
+char *auth_user = NULL;
|
||||
+char *auth_pass = NULL;
|
||||
+char *auth_method = NULL; /* Mechanism for SMTP authentication */
|
||||
+char *mail_domain = NULL;
|
||||
+char *from = NULL; /* Use this as the From: address */
|
||||
char *hostname;
|
||||
char *mailhost = "mailhub";
|
||||
-char *minus_f = (char)NULL;
|
||||
-char *minus_F = (char)NULL;
|
||||
+char *minus_f = NULL;
|
||||
+char *minus_F = NULL;
|
||||
char *gecos;
|
||||
-char *prog = (char)NULL;
|
||||
+char *prog = NULL;
|
||||
char *root = NULL;
|
||||
char *tls_cert = "/etc/ssl/certs/ssmtp.pem"; /* Default Certificate */
|
||||
-char *uad = (char)NULL;
|
||||
-char *config_file = (char)NULL; /* alternate configuration file */
|
||||
+char *uad = NULL;
|
||||
+char *config_file = NULL; /* alternate configuration file */
|
||||
|
||||
headers_t headers, *ht;
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
help compile when S != B
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
Upstream-Status: Pending
|
||||
Index: ssmtp-2.64/Makefile.in
|
||||
===================================================================
|
||||
--- ssmtp-2.64.orig/Makefile.in
|
||||
+++ ssmtp-2.64/Makefile.in
|
||||
@@ -24,7 +24,7 @@ INSTALLED_REVALIASES_FILE=$(REVALIASES_F
|
||||
# Programs
|
||||
GEN_CONFIG=$(srcdir)/generate_config
|
||||
|
||||
-SRCS=ssmtp.c arpadate.c base64.c xgethostname.c @SRCS@
|
||||
+SRCS=$(srcdir)/ssmtp.c $(srcdir)/arpadate.c $(srcdir)/base64.c $(srcdir)/xgethostname.c @SRCS@
|
||||
|
||||
OBJS=$(SRCS:.c=.o)
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
Bug-Debian: http://bugs.debian.org/584162
|
||||
Reported-By: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
|
||||
Forwarded: not-needed
|
||||
Reviewed-By: Anibal Monsalve Salazar <anibal@debian.org>
|
||||
Last-Update: 2014-08-15
|
||||
|
||||
From: "Daniel Richard G." <skunk@iSKUNK.ORG>
|
||||
Subject: Re: ssmtp: Partial loss of message body, sending message to wrong recipicients
|
||||
Date: Thu, 19 Jun 2014 14:44:30 -0400
|
||||
|
||||
Attached is a patch against the original 2.64 source that should address
|
||||
this bug, and hopefully not break anything. An overview of my changes:
|
||||
|
||||
* Added code to standarise() to drop the trailing '\r' if the line
|
||||
originally ended with "\r\n".
|
||||
|
||||
* Added a check to header_parse() that effectively converts an "\r\n" in
|
||||
the input into '\n'.
|
||||
|
||||
* Added a conditional so that header_parse() doesn't pass the empty
|
||||
string to header_save()---a behavior I observed in testing, at the end
|
||||
of a header block with "\r\n" line endings.
|
||||
|
||||
* Simplified the last if(in_header) conditional in header_parse(),
|
||||
because it erroneously assumes that if in_header == True, then c could
|
||||
have some value other than EOF. (See the condition on the previous
|
||||
"while" loop, and the lack of any other way to exit said loop.)
|
||||
|
||||
header_parse() will now properly grab a header if fed a message
|
||||
without a body (i.e. no "\n\n" ending the header block), although this
|
||||
code will still drop a header if there is no newline at the end.
|
||||
|
||||
Christoph, thank you for your excellent analysis, and the test cases. I
|
||||
made use of them, and with my changes sSMTP appears to do the right
|
||||
thing.
|
||||
|
||||
Debian patch from: https://sources.debian.net/patches/ssmtp/2.64-8/
|
||||
|
||||
Upstream-Status: Backport [debian]
|
||||
|
||||
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
|
||||
|
||||
Index: ssmtp-2.64/ssmtp.c
|
||||
===================================================================
|
||||
--- ssmtp-2.64.orig/ssmtp.c
|
||||
+++ ssmtp-2.64/ssmtp.c
|
||||
@@ -375,6 +375,12 @@ bool_t standardise(char *str, bool_t *li
|
||||
if((p = strchr(str, '\n'))) {
|
||||
*p = (char)NULL;
|
||||
*linestart = True;
|
||||
+
|
||||
+ /* If the line ended in "\r\n", then drop the '\r' too */
|
||||
+ sl = strlen(str);
|
||||
+ if(sl >= 1 && str[sl - 1] == '\r') {
|
||||
+ str[sl - 1] = (char)NULL;
|
||||
+ }
|
||||
}
|
||||
return(leadingdot);
|
||||
}
|
||||
@@ -768,6 +774,14 @@ void header_parse(FILE *stream)
|
||||
}
|
||||
len++;
|
||||
|
||||
+ if(l == '\r' && c == '\n') {
|
||||
+ /* Properly handle input that already has "\r\n"
|
||||
+ line endings; see https://bugs.debian.org/584162 */
|
||||
+ l = (len >= 2 ? *(q - 2) : '\n');
|
||||
+ q--;
|
||||
+ len--;
|
||||
+ }
|
||||
+
|
||||
if(l == '\n') {
|
||||
switch(c) {
|
||||
case ' ':
|
||||
@@ -790,7 +804,9 @@ void header_parse(FILE *stream)
|
||||
if((q = strrchr(p, '\n'))) {
|
||||
*q = (char)NULL;
|
||||
}
|
||||
- header_save(p);
|
||||
+ if(len > 0) {
|
||||
+ header_save(p);
|
||||
+ }
|
||||
|
||||
q = p;
|
||||
len = 0;
|
||||
@@ -800,35 +816,12 @@ void header_parse(FILE *stream)
|
||||
|
||||
l = c;
|
||||
}
|
||||
- if(in_header) {
|
||||
- if(l == '\n') {
|
||||
- switch(c) {
|
||||
- case ' ':
|
||||
- case '\t':
|
||||
- /* Must insert '\r' before '\n's embedded in header
|
||||
- fields otherwise qmail won't accept our mail
|
||||
- because a bare '\n' violates some RFC */
|
||||
-
|
||||
- *(q - 1) = '\r'; /* Replace previous \n with \r */
|
||||
- *q++ = '\n'; /* Insert \n */
|
||||
- len++;
|
||||
-
|
||||
- break;
|
||||
-
|
||||
- case '\n':
|
||||
- in_header = False;
|
||||
-
|
||||
- default:
|
||||
- *q = (char)NULL;
|
||||
- if((q = strrchr(p, '\n'))) {
|
||||
- *q = (char)NULL;
|
||||
- }
|
||||
- header_save(p);
|
||||
-
|
||||
- q = p;
|
||||
- len = 0;
|
||||
- }
|
||||
+ if(in_header && l == '\n') {
|
||||
+ /* Got EOF while reading the header */
|
||||
+ if((q = strrchr(p, '\n'))) {
|
||||
+ *q = (char)NULL;
|
||||
}
|
||||
+ header_save(p);
|
||||
}
|
||||
(void)free(p);
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
Use DESTDIR during install/uninstall, this helps
|
||||
with cross or staged builds. Additionally pass LDFLAGS
|
||||
during linking.
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
Upstream-Status: Pending
|
||||
|
||||
|
||||
Index: ssmtp-2.64/Makefile.in
|
||||
===================================================================
|
||||
--- ssmtp-2.64.orig/Makefile.in
|
||||
+++ ssmtp-2.64/Makefile.in
|
||||
@@ -46,40 +46,40 @@ all: ssmtp
|
||||
|
||||
.PHONY: install
|
||||
install: ssmtp $(GEN_CONFIG)
|
||||
- $(INSTALL) -d -m 755 $(bindir)
|
||||
- $(INSTALL) -s -m 755 ssmtp $(bindir)/ssmtp
|
||||
- $(INSTALL) -d -m 755 $(mandir)
|
||||
- $(INSTALL) -m 644 $(srcdir)/ssmtp.8 $(mandir)/ssmtp.8
|
||||
- $(INSTALL) -d -m 755 $(SSMTPCONFDIR)
|
||||
- $(INSTALL) -m 644 $(srcdir)/revaliases $(INSTALLED_REVALIASES_FILE)
|
||||
- $(GEN_CONFIG) $(INSTALLED_CONFIGURATION_FILE)
|
||||
+ $(INSTALL) -d -m 755 $(DESTDIR)$(bindir)
|
||||
+ $(INSTALL) -m 755 ssmtp $(DESTDIR)$(bindir)/ssmtp
|
||||
+ $(INSTALL) -d -m 755 $(DESTDIR)$(mandir)
|
||||
+ $(INSTALL) -m 644 $(srcdir)/ssmtp.8 $(DESTDIR)$(mandir)/ssmtp.8
|
||||
+ $(INSTALL) -d -m 755 $(DESTDIR)$(SSMTPCONFDIR)
|
||||
+ $(INSTALL) -m 644 $(srcdir)/revaliases $(DESTDIR)$(INSTALLED_REVALIASES_FILE)
|
||||
+ $(GEN_CONFIG) $(DESTDIR)$(INSTALLED_CONFIGURATION_FILE)
|
||||
|
||||
|
||||
.PHONY: install-sendmail
|
||||
install-sendmail: install
|
||||
- $(RM) $(bindir)/sendmail
|
||||
- $(LN_S) ssmtp $(bindir)/sendmail
|
||||
- $(INSTALL) -d -m 755 $(libexecdir)
|
||||
- $(RM) $(libexecdir)/sendmail
|
||||
- $(LN_S) sendmail /lib/sendmail
|
||||
- $(RM) $(mandir)/sendmail.8
|
||||
- $(LN_S) ssmtp.8 $(mandir)/sendmail.8
|
||||
+ $(RM) $(DESTDIR)$(bindir)/sendmail
|
||||
+ $(LN_S) ssmtp $(DESTDIR)$(bindir)/sendmail
|
||||
+ $(INSTALL) -d -m 755 $(DESTDIR)$(libexecdir)
|
||||
+ $(RM) $(DESTDIR)$(libexecdir)/sendmail
|
||||
+ $(LN_S) sendmail $(DESTDIR)/lib/sendmail
|
||||
+ $(RM) $(DESTDIR)$(mandir)/sendmail.8
|
||||
+ $(LN_S) ssmtp.8 $(DESTDIR)$(mandir)/sendmail.8
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall:
|
||||
- $(RM) $(bindir)/ssmtp
|
||||
- $(RM) $(mandir)/ssmtp.8
|
||||
- $(RM) $(CONFIGURATION_FILE) $(REVALIASES_FILE)
|
||||
- $(RM) -r $(SSMTPCONFDIR)
|
||||
+ $(RM) $(DESTDIR)$(bindir)/ssmtp
|
||||
+ $(RM) $(DESTDIR)$(mandir)/ssmtp.8
|
||||
+ $(RM) $(DESTDIR)$(CONFIGURATION_FILE) $(DESTDIR)$(REVALIASES_FILE)
|
||||
+ $(RM) -r $(DESTDIR)$(SSMTPCONFDIR)
|
||||
|
||||
.PHONY: uninstall-sendmail
|
||||
uninstall-sendmail: uninstall
|
||||
- $(RM) $(bindir)/sendmail /lib/sendmail
|
||||
- $(RM) $(mandir)/sendmail.8
|
||||
+ $(RM) $(DESTDIR)$(bindir)/sendmail $(DESTDIR)/lib/sendmail
|
||||
+ $(RM) $(DESTDIR)$(mandir)/sendmail.8
|
||||
|
||||
# Binaries:
|
||||
ssmtp: $(OBJS)
|
||||
- $(CC) -o ssmtp $(OBJS) @LIBS@ $(CFLAGS)
|
||||
+ $(CC) -o ssmtp $(OBJS) @LIBS@ $(CFLAGS) $(LDFLAGS)
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
@@ -0,0 +1,43 @@
|
||||
SUMMARY = "extremely simple MTA to get mail off the system to a mail hub"
|
||||
HOMEPAGE = "http://packages.qa.debian.org/s/ssmtp.html"
|
||||
LICENSE = "GPL-2.0-only"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=0c56db0143f4f80c369ee3af7425af6e"
|
||||
|
||||
SRC_URI = "${DEBIAN_MIRROR}/main/s/${BPN}/${BPN}_${PV}.orig.tar.bz2 \
|
||||
file://ssmtp-bug584162-fix.patch \
|
||||
file://build-ouside_srcdir.patch \
|
||||
file://use-DESTDIR.patch \
|
||||
file://0001-ssmtp-Correct-the-null-pointer-assignment-to-char-po.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "65b4e0df4934a6cd08c506cabcbe584f"
|
||||
SRC_URI[sha256sum] = "22c37dc90c871e8e052b2cab0ad219d010fa938608cd66b21c8f3c759046fa36"
|
||||
|
||||
inherit autotools update-alternatives
|
||||
|
||||
PACKAGECONFIG ?= "ssl ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
|
||||
|
||||
PACKAGECONFIG[ssl] = "--enable-ssl,--disable-ssl,openssl"
|
||||
PACKAGECONFIG[ipv6] = "--enable-inet6,--disable-inet6"
|
||||
|
||||
EXTRA_OECONF += "--mandir=${mandir}"
|
||||
|
||||
EXTRA_OEMAKE = "GEN_CONFIG='/bin/true'"
|
||||
|
||||
LDFLAGS += "${@bb.utils.contains('PACKAGECONFIG', 'ssl', '-lssl -lcrypto', '', d)}"
|
||||
|
||||
do_install:append () {
|
||||
install -d ${D}${mandir}/
|
||||
mv ${D}${exec_prefix}/man/* ${D}${mandir}/
|
||||
rmdir ${D}${exec_prefix}/man
|
||||
ln -s ssmtp ${D}${sbindir}/sendmail
|
||||
ln -s ssmtp ${D}${sbindir}/newaliases
|
||||
ln -s ssmtp ${D}${sbindir}/mailq
|
||||
}
|
||||
|
||||
ALTERNATIVE_PRIORITY_${PN} = "100"
|
||||
|
||||
ALTERNATIVE:${PN} = "mailq newaliases sendmail"
|
||||
ALTERNATIVE_LINK_NAME[sendmail] = "${sbindir}/sendmail"
|
||||
ALTERNATIVE_LINK_NAME[newaliases] = "${sbindir}/newaliases"
|
||||
ALTERNATIVE_LINK_NAME[mailq] = "${sbindir}/mailq"
|
||||
Reference in New Issue
Block a user