mail-mta/sendmail: cleanup patches

* Finally, use `PATCHES()` array
* Backport C23 fixes from 8.18.1.10 snapshot to 8.18.1

Signed-off-by: Cristian Othón Martínez Vera <cfuga@cfuga.mx>
Part-of: https://github.com/gentoo/gentoo/pull/43481
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Cristian Othón Martínez Vera
2025-08-16 20:24:23 -06:00
committed by Sam James
parent e252fde857
commit 963ccb691f
4 changed files with 134 additions and 8 deletions

View File

@@ -0,0 +1,10 @@
--- a/sendmail/conf.c
+++ b/sendmail/conf.c
@@ -117,6 +117,7 @@
{ "content-length", H_ACHECK, NULL },
{ "subject", H_ENCODABLE, NULL },
{ "x-authentication-warning", H_FORCE, NULL },
+ { "delivered-to", H_FORCE, NULL },
{ NULL, 0, NULL }
};

View File

@@ -0,0 +1,113 @@
Bug: https://bugs.gentoo.org/944460
Bug: https://bugs.gentoo.org/945726
--- a/libsm/vfscanf.c
+++ b/libsm/vfscanf.c
@@ -37,6 +37,7 @@
#define SUPPRESS 0x10 /* suppress assignment */
#define POINTER 0x20 /* weird %p pointer (`fake hex') */
#define NOSKIP 0x40 /* do not skip blanks */
+#define UNSIGNED 0x80 /* unsigned conversions */
/*
** The following are used in numeric conversions only:
@@ -122,9 +123,6 @@
int nassigned; /* number of fields assigned */
int nread; /* number of characters consumed from fp */
int base; /* base argument to strtoll/strtoull */
-
- /* conversion function (strtoll/strtoull) */
- ULONGLONG_T (*ccfn) __P((const char *, char **, int));
char ccltab[256]; /* character class table for %[...] */
char buf[BUF]; /* buffer for numeric conversions */
SM_EVENT *evt = NULL;
@@ -160,7 +158,6 @@
nassigned = 0;
nread = 0;
base = 0; /* XXX just to keep gcc happy */
- ccfn = NULL; /* XXX just to keep gcc happy */
for (;;)
{
c = *fmt++;
@@ -240,13 +237,11 @@
/* FALLTHROUGH */
case 'd':
c = CT_INT;
- ccfn = (ULONGLONG_T (*)())sm_strtoll;
base = 10;
break;
case 'i':
c = CT_INT;
- ccfn = (ULONGLONG_T (*)())sm_strtoll;
base = 0;
break;
@@ -255,21 +250,20 @@
/* FALLTHROUGH */
case 'o':
c = CT_INT;
- ccfn = sm_strtoull;
+ flags |= UNSIGNED;
base = 8;
break;
case 'u':
c = CT_INT;
- ccfn = sm_strtoull;
+ flags |= UNSIGNED;
base = 10;
break;
case 'X':
case 'x':
- flags |= PFXOK; /* enable 0x prefixing */
+ flags |= PFXOK | UNSIGNED;
c = CT_INT;
- ccfn = sm_strtoull;
base = 16;
break;
@@ -297,9 +291,8 @@
break;
case 'p': /* pointer format is like hex */
- flags |= POINTER | PFXOK;
+ flags |= POINTER | PFXOK | UNSIGNED;
c = CT_INT;
- ccfn = sm_strtoull;
base = 16;
break;
@@ -324,7 +317,6 @@
if (isupper(c))
flags |= LONG;
c = CT_INT;
- ccfn = (ULONGLONG_T (*)()) sm_strtoll;
base = 10;
break;
}
@@ -628,7 +620,12 @@
ULONGLONG_T res;
*p = 0;
- res = (*ccfn)(buf, (char **)NULL, base);
+ if (flags & UNSIGNED)
+ res = sm_strtoull(buf, (char **)NULL,
+ base);
+ else
+ res = sm_strtoll(buf, (char **)NULL,
+ base);
if (flags & POINTER)
*SM_VA_ARG(ap, void **) =
(void *)(long) res;
--- a/mailstats/mailstats.c
+++ b/mailstats/mailstats.c
@@ -65,7 +65,6 @@
char sfilebuf[MAXPATHLEN];
char buf[MAXLINE];
struct statistics stats;
- extern char *ctime();
extern char *optarg;
extern int optind;
# define MSOPTS "cC:f:opP"

View File

@@ -70,13 +70,14 @@ PDEPEND="
)
)
"
PATCHES=(
"${FILESDIR}"/${PN}-8.13.1-delivered_hdr.patch
"${FILESDIR}"/${PN}-8.16.1-build-system.patch
"${FILESDIR}"/${PN}-8.18.1-c23.patch
)
src_prepare() {
eapply "${FILESDIR}"/${PN}-8.16.1-build-system.patch
eapply "${FILESDIR}"/${PN}-8.18.1-c23-ctime.patch
eapply "${FILESDIR}"/${PN}-8.18.1-c23-sm_strtoll.patch
eapply -p0 "${FILESDIR}"/${PN}-delivered_hdr.patch
eapply_user
default
local confCCOPTS="${CFLAGS}"
local confENVDEF="-DMAXDAEMONS=64 -DHAS_GETHOSTBYNAME2=1"

View File

@@ -70,11 +70,13 @@ PDEPEND="
)
)
"
PATCHES=(
"${FILESDIR}"/${PN}-8.13.1-delivered_hdr.patch
"${FILESDIR}"/${PN}-8.16.1-build-system.patch
)
src_prepare() {
eapply "${FILESDIR}"/${PN}-8.16.1-build-system.patch
eapply -p0 "${FILESDIR}"/${PN}-delivered_hdr.patch
eapply_user
default
local confCCOPTS="${CFLAGS}"
local confENVDEF="-DMAXDAEMONS=64 -DHAS_GETHOSTBYNAME2=1"