Compare commits

1 Commits
main ... 1.1

5 changed files with 24 additions and 124 deletions

View File

@@ -1,55 +0,0 @@
---
src/exopen.c | 4 ++--
src/robust.c | 14 +++++++++++++-
2 files changed, 15 insertions(+), 3 deletions(-)
--- src/exopen.c
+++ src/exopen.c 2025-02-12 09:33:08.114189510 +0000
@@ -110,7 +110,7 @@ in: if(flags&doMAILDIR)
#define ropen(path,type,mode) creat(path,mode)
#endif
while((!i||errno!=ENOENT|| /* casually check if it already exists */
- (0>(i=ropen(full,O_WRONLY|O_CREAT|O_EXCL,mode))&&errno==EEXIST))&&
+ (0>(i=ropen(full,O_WRONLY|O_CREAT|O_EXCL|O_NOFOLLOW,mode))&&errno==EEXIST))&&
(i= -1,retry--));
if(flags&doCHOWN&&didnice)
nice(nicediff); /* put back the priority to the old level */
@@ -180,7 +180,7 @@ int hlink(old,newn)const char*const old,
{ int fd;
#ifdef O_CREAT /* failure due to filesystem? */
if(stbuf.st_nlink<2&&errno==EXDEV&& /* try it by conventional means */
- 0<=(fd=ropen(newn,O_WRONLY|O_CREAT|O_EXCL,stbuf.st_mode)))
+ 0<=(fd=ropen(newn,O_WRONLY|O_CREAT|O_EXCL|O_NOFOLLOW,stbuf.st_mode)))
return fd+1;
#endif
return -1;
--- src/robust.c
+++ src/robust.c 2025-02-12 10:06:32.165135534 +0000
@@ -10,6 +10,7 @@
static /*const*/char rcsid[]=
"$Id$";
#endif
+#include <libgen.h>
#include "procmail.h"
#include "robust.h"
#include "misc.h"
@@ -121,7 +122,18 @@ void opnlog(file)const char*file;
int opena(a)const char*const a;
{ yell("Opening",a);
#ifdef O_CREAT
- return ropen(a,O_WRONLY|O_APPEND|O_CREAT,NORMperm);
+ int flags = O_WRONLY|O_APPEND|O_CREAT;
+ struct stat stbuf;
+ char *d, *t = tstrdup(a);
+ d = dirname(t);
+ if (stat(d,&stbuf) < 0) {
+ free(t);
+ return -1;
+ }
+ free(t);
+ if (stbuf.st_mode & S_IWOTH)
+ flags |= O_NOFOLLOW;
+ return ropen(a,flags,NORMperm);
#else
;{ int fd;
return (fd=ropen(a,O_WRONLY,0))<0?creat(a,NORMperm):fd;

View File

@@ -1,24 +1,3 @@
-------------------------------------------------------------------
Wed Mar 19 22:31:50 UTC 2025 - Andreas Stieger <andreas.stieger@gmx.de>
- drop unneeded build dependency on pcre
-------------------------------------------------------------------
Wed Feb 12 09:30:38 UTC 2025 - Dr. Werner Fink <werner@suse.de>
- Add patch procmail-o_nofollow.patch
* Avoid to follow symblic link below /var/spool/mail/
-------------------------------------------------------------------
Thu Feb 29 14:34:26 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>
- Use %patch -P N instead of deprecated %patchN.
-------------------------------------------------------------------
Sun Dec 3 08:06:34 UTC 2023 - Bernhard Wiedemann <bwiedemann@suse.com>
- Update reproducible.patch to drop more benchmarking (boo#1041534)
-------------------------------------------------------------------
Wed Aug 9 09:09:55 UTC 2023 - Dr. Werner Fink <werner@suse.de>

View File

@@ -1,7 +1,7 @@
#
# spec file for package procmail
#
# Copyright (c) 2025 SUSE LLC
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -32,12 +32,11 @@ Patch3: procmail-3.22-headerconcat.dif
Patch4: procmail-3.22-owl-truncate.dif
Patch5: procmail-3.22-autoconf.dif
Patch6: procmail-3.22-ipv6.patch
# PATCH-FIX-SUSE Avoid that link() follows symbolic links
Patch7: procmail-o_nofollow.patch
# PATCH-FIX-SUSE bmwiedemann -- make build reproducible
Patch8: reproducible.patch
Patch10: procmail-fix-Werror=return-type.patch
Patch11: reproducible2.patch
BuildRequires: pcre-devel
BuildRequires: postfix
Requires: /bin/sed
Recommends: %{_bindir}/mimencode
@@ -53,17 +52,16 @@ for p in ../procmail-%{version}-patches/* ; do
echo Patch $p
patch -s -p1 --fuzz=0 < $p
done
%patch -P 0
%patch -P 1
%patch -P 2
%patch -P 3
%patch -P 4
%patch -P 5
%patch -P 6
%patch -P 7 -b .nofollow
%patch -P 8 -p1
%patch -P 10 -p1
%patch -P 11 -p1
%patch0
%patch1
%patch2
%patch3
%patch4
%patch5
%patch6
%patch8 -p1
%patch10 -p1
%patch11 -p1
sed -ri '\@^/\*@,\@\*/@{ s@^(/\*[^*]*)(/\*)@\1\*/ \2@; }' config.h
sed -ri '\@^/\*@,\@\*/@{ s@^(/\*[^*]*)(/\*)@\1\*/ \2@; }' src/includes.h
sed -ri '\@^#.*[[:blank:]]+/\*[^/]*$@M,\@\*/$@{ s@(^[[:blank:]]+)/\*@\1 @;}' src/includes.h

View File

@@ -1,38 +1,16 @@
https://bugzilla.opensuse.org/show_bug.cgi?id=1041534
Avoid benchmarking the build machine
to determine compilation results
Index: procmail-3.24/src/autoconf
Index: procmail-3.22/src/autoconf
===================================================================
--- procmail-3.24.orig/src/autoconf
+++ procmail-3.24/src/autoconf
@@ -951,6 +951,7 @@ void*realloc(),*malloc();
#endif
int main()
{ char*p=malloc(1),*q=0;
+#if 0
size_t len,last,max=BLKSIZ*64; /* 1M on non-SMALLHEAP systems */
int count=0;
for(last=len=INITIAL;len<=max+INITIAL;len+=BLKSIZ)
@@ -968,6 +969,7 @@ int main()
{ puts("#define INEFFICIENTrealloc");
exit(1);
}
+#endif
exit(0);
}
HERE
@@ -1248,10 +1250,9 @@ int main(argc,argv)int argc;const char*a
if(!iter)
iter=1;
printf("\
-/* Your system's strstr() is %.2f times %sER than my C-routine */\n",
- syscnt>=iter?(double)syscnt/iter:(double)iter/syscnt,
- syscnt>=iter?"SLOW":"FAST");
---
src/autoconf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/src/autoconf
+++ b/src/autoconf 2023-08-09 08:57:47.506347981 +0000
@@ -1251,7 +1251,7 @@ int main(argc,argv)int argc;const char*a
/* Your system's strstr() is %.2f times %sER than my C-routine */\n",
syscnt>=iter?(double)syscnt/iter:(double)iter/syscnt,
syscnt>=iter?"SLOW":"FAST");
- if(syscnt>iter+iter/16) /* if at least 1.0625 times slower */
+/* Your system's strstr() is %sER than my C-routine */\n",
+ "FAST");
+ if(0) /* always use system strstr to have reproducible binaries */
printf("\
#define SLOWstrstr\t\t\t /* using my substitute instead */\n");

View File

@@ -11,7 +11,7 @@ diff --git a/src/autoconf b/src/autoconf
index b0fef8a..f2f8351 100755
--- a/src/autoconf
+++ b/src/autoconf
@@ -1303,8 +1303,7 @@ int main(argc,argv)int argc;const char*argv[];
@@ -1302,8 +1302,7 @@ int main(argc,argv)int argc;const char*argv[];
if(!setrgid(groups[i])&&getgid()!=groups[i])
puts("#define setrgid_BRAIN_DAMAGE");
}