File imap-2007e.patch of Package imap

---
 imap-2007f/Makefile                |    3 ++-
 imap-2007f/src/c-client/mail.c     |    6 ++++--
 imap-2007f/src/dmail/Makefile      |    6 +++---
 imap-2007f/src/imapd/Makefile      |    6 +++---
 imap-2007f/src/ipopd/Makefile      |    6 +++---
 imap-2007f/src/mailutil/Makefile   |    6 +++---
 imap-2007f/src/mlock/Makefile      |    4 ++--
 imap-2007f/src/mlock/mlock.c       |    1 +
 imap-2007f/src/mtest/Makefile      |    6 +++---
 imap-2007f/src/osdep/unix/Makefile |   26 ++++++++++++++++++++------
 imap-2007f/src/osdep/unix/mbx.c    |    1 +
 imap-2007f/src/osdep/unix/mh.c     |    1 +
 imap-2007f/src/osdep/unix/mmdf.c   |    1 +
 imap-2007f/src/osdep/unix/mtx.c    |    1 +
 imap-2007f/src/osdep/unix/mx.c     |    1 +
 imap-2007f/src/osdep/unix/tenex.c  |    1 +
 imap-2007f/src/tmail/Makefile      |    6 +++---
 17 files changed, 53 insertions(+), 29 deletions(-)

--- imap-2007f/Makefile
+++ imap-2007f/Makefile	2018-04-10 14:49:53.635927625 +0000
@@ -639,7 +639,8 @@ ip6:
 	@echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 	@echo
 	@echo Do you want to build with IPv6 anyway?  Type y or n please:
-	@$(SH) -c 'read x; case "$$x" in y) exit 0;; *) (make noip6;exit 1);; esac'
+	@$(SH) -c 'read x; case "$$x" in y) exit 0;; *) exit 0;; esac'
+# *) (make noip6;exit 1);; esac'
 	@echo OK, I will remember that you really want to build with IPv6.
 	@echo You will not see this message again.
 	@$(TOUCH) ip6
--- imap-2007f/src/c-client/mail.c
+++ imap-2007f/src/c-client/mail.c	2018-04-10 14:49:53.635927625 +0000
@@ -2931,8 +2931,10 @@ long mail_parse_date (MESSAGECACHE *elt,
 				/* parse time */
     d = strtoul (s+1,(char **) &s,10);
     if (*s != ':') return NIL;
-    m = strtoul (++s,(char **) &s,10);
-    y = (*s == ':') ? strtoul (++s,(char **) &s,10) : 0;
+	s++;
+    m = strtoul (s,(char **) &s,10);
+	s++;
+    y = (*s == ':') ? strtoul (s,(char **) &s,10) : 0;
 				/* validity check time */
     if ((d > 23) || (m > 59) || (y > 60)) return NIL; 
 				/* set values in elt */
--- imap-2007f/src/dmail/Makefile
+++ imap-2007f/src/dmail/Makefile	2018-04-10 14:53:05.064455252 +0000
@@ -31,9 +31,9 @@ SHELL = /bin/sh
 
 # Get local definitions from c-client directory
 
-CC = `cat $C/CCTYPE`
-CFLAGS = -I$C `cat $C/CFLAGS`
-LDFLAGS = $(CCLIENTLIB) `cat $C/LDFLAGS`
+CC = $(shell cat $C/CCTYPE)
+CFLAGS = -I$C $(shell cat $C/CFLAGS)
+LDFLAGS = $(CCLIENTLIB) $(shell cat $C/LDFLAGS)
 
 dmail: $(CCLIENTLIB) dmail.o dquota.o
 	$(CC) $(CFLAGS) -o dmail dmail.o dquota.o $(LDFLAGS)
--- imap-2007f/src/imapd/Makefile
+++ imap-2007f/src/imapd/Makefile	2018-04-10 14:53:49.523648772 +0000
@@ -44,11 +44,11 @@ SHELL= /bin/sh
 
 C = ../c-client
 CCLIENTLIB = $C/c-client.a
-CC = `cat $C/CCTYPE`
-CFLAGS = -I$C `cat $C/CFLAGS` $(NSBD) $(ENBD) -DANOFILE=\"$(ANO)\" \
+CC = $(shell cat $C/CCTYPE)
+CFLAGS = -I$C $(shell cat $C/CFLAGS) $(NSBD) $(ENBD) -DANOFILE=\"$(ANO)\" \
 	-DALERTFILE=\"$(ALERT)\" -DNNTPFILE=\"$(NNTP)\" \
 	-DUSERALERTFILE=\"$(USERALERT)\" -DSHUTDOWNFILE=\"$(SHUTDOWN)\"
-LDFLAGS = $(CCLIENTLIB) `cat $C/LDFLAGS`
+LDFLAGS = $(CCLIENTLIB) $(shell cat $C/LDFLAGS)
 
 all:	imapd
 
--- imap-2007f/src/ipopd/Makefile
+++ imap-2007f/src/ipopd/Makefile	2018-04-10 14:58:28.970579484 +0000
@@ -31,9 +31,9 @@ SHELL = /bin/sh
 
 # Get local definitions from c-client directory
 
-CC = `cat $C/CCTYPE`
-CFLAGS = -I$C `cat $C/CFLAGS`
-LDFLAGS = $(CCLIENTLIB) `cat $C/LDFLAGS`
+CC = $(shell cat $C/CCTYPE)
+CFLAGS = -I$C $(shell cat $C/CFLAGS)
+LDFLAGS = $(CCLIENTLIB) $(shell cat $C/LDFLAGS)
 
 ipopd: ipop2d ipop3d
 
--- imap-2007f/src/mailutil/Makefile
+++ imap-2007f/src/mailutil/Makefile	2018-04-10 14:51:59.369646925 +0000
@@ -31,9 +31,9 @@ SHELL = /bin/sh
 
 # Get local definitions from c-client directory
 
-CC = `cat $C/CCTYPE`
-CFLAGS = -I$C `cat $C/CFLAGS`
-LDFLAGS = $(CCLIENTLIB) `cat $C/LDFLAGS`
+CC = $(shell cat $C/CCTYPE)
+CFLAGS = -I$C $(shell cat $C/CFLAGS)
+LDFLAGS = $(CCLIENTLIB) $(shell cat $C/LDFLAGS)
 
 mailutil: $(CCLIENTLIB) mailutil.o
 	$(CC) $(CFLAGS) -o mailutil mailutil.o $(LDFLAGS)
--- imap-2007f/src/mlock/Makefile
+++ imap-2007f/src/mlock/Makefile	2018-04-10 15:01:32.711246182 +0000
@@ -30,8 +30,8 @@ SHELL = /bin/sh
 
 # Get local definitions from c-client directory
 
-CC = `cat $C/CCTYPE`
-CFLAGS = `cat $C/CFLAGS`
+CC = $(shell cat $C/CCTYPE)
+CFLAGS = $(shell cat $C/CFLAGS)
 
 all:	mlock
 
--- imap-2007f/src/mlock/mlock.c
+++ imap-2007f/src/mlock/mlock.c	2018-04-10 14:49:53.635927625 +0000
@@ -38,6 +38,7 @@
 #include <sys/param.h>
 #include <stdlib.h>
 #include <netdb.h>
+#include <unistd.h>
 #include <ctype.h>
 #include <string.h>
 
--- imap-2007f/src/mtest/Makefile
+++ imap-2007f/src/mtest/Makefile	2018-04-10 14:58:58.482044115 +0000
@@ -31,9 +31,9 @@ SHELL = /bin/sh
 
 # Get local definitions from c-client directory
 
-CC = `cat $C/CCTYPE`
-CFLAGS = -I$C `cat $C/CFLAGS`
-LDFLAGS = $(CCLIENTLIB) `cat $C/LDFLAGS`
+CC = $(shell cat $C/CCTYPE)
+CFLAGS = -I$C $(shell cat $C/CFLAGS)
+LDFLAGS = $(CCLIENTLIB) $(shell cat $C/LDFLAGS)
 
 all:	mtest
 
--- imap-2007f/src/osdep/unix/Makefile
+++ imap-2007f/src/osdep/unix/Makefile	2018-04-10 14:57:51.339262151 +0000
@@ -170,11 +170,13 @@ BUILD=$(MAKE) build EXTRACFLAGS='$(EXTRA
  EXTRADRIVERS='$(EXTRADRIVERS)' EXTRAAUTHENTICATORS='$(EXTRAAUTHENTICATORS)'\
  PASSWDTYPE=$(PASSWDTYPE) SSLTYPE=$(SSLTYPE) IP=$(IP)
 
+.SUFFIXES: .o .so
+SOFILES=${BINARIES:.o=.so}
 
 # Here if no make argument established
 
 missing: osdep.h
-	$(MAKE) all `$(CAT) SPECIALS`
+	$(MAKE) all $(shell $(CAT) SPECIALS)
 
 osdep.h:
 	@echo You must specify what type of system
@@ -853,17 +855,24 @@ vu2:	# VAX Ultrix 2.3, etc.
 
 # Build it!
 
-build:	clean once $(ARCHIVE)
+build:	clean once $(ARCHIVE) $(SHLIBNAME)
 
-all:	$(ARCHIVE)
+all:	$(ARCHIVE) $(SHLIBNAME)
 
 $(ARCHIVE): $(BINARIES)
 	sh -c '$(RM) $(ARCHIVE) || true'
 	@$(CAT) ARCHIVE
 	@$(SH) ARCHIVE
 
+$(SHLIBNAME):  $(SOFILES)
+	`$(CAT) CCTYPE` -shared -Wl,-soname,$(SHLIBNAME) -o $(SHLIBNAME) $(SOFILES) `$(CAT) LDFLAGS`
+	ln -s $(SHLIBNAME) $(SHLIBBASE)
+       
+.c.so: osdep.h
+	`$(CAT) CCTYPE` -fPIC -DPIC -D_REENTRANT -c `$(CAT) CFLAGS` ${@:.so=.c} -o $@
+
 .c.o:
-	`$(CAT) CCTYPE` -c `$(CAT) CFLAGS` $*.c
+	`$(CAT) CCTYPE` -fPIC -DPIC -D_REENTRANT -c `$(CAT) CFLAGS` $*.c
 
 
 # Cleanup
@@ -904,7 +913,7 @@ utf8aux.o: mail.h misc.h osdep.h utf8.h
 
 # OS-dependent
 
-osdep.o:mail.h misc.h env.h fs.h ftl.h nl.h tcp.h \
+OSDEPS= mail.h misc.h env.h fs.h ftl.h nl.h tcp.h \
 	osdep.h env_unix.h tcp_unix.h \
 	osdep.c env_unix.c fs_unix.c ftl_unix.c nl_unix.c tcp_unix.c ip_unix.c\
 	auths.c crexcl.c flockcyg.c flocklnx.c flocksim.c fsync.c \
@@ -918,12 +927,17 @@ osdep.o:mail.h misc.h env.h fs.h ftl.h n
 	write.c sslstdio.c \
 	strerror.c strpbrk.c strstr.c strtok.c strtoul.c \
 	OSCFLAGS
+
+osdep.o:	$(OSDEPS)
+	`$(CAT) CCTYPE` -fPIC -DPIC -D_REENTRANT `$(CAT) CFLAGS` `$(CAT) OSCFLAGS` -c osdep.c
 	@echo Building OS-dependent module
 	@echo If you get No such file error messages for files x509.h, ssl.h,
 	@echo pem.h, buffer.h, bio.h, and crypto.h, that means that OpenSSL
 	@echo is not installed on your system.  Either install OpenSSL first
 	@echo or build with command: make `$(CAT) OSTYPE` SSLTYPE=none
-	`$(CAT) CCTYPE` -c `$(CAT) CFLAGS` `$(CAT) OSCFLAGS` -c osdep.c
+
+osdep.so:	$(OSDEPS)
+	`$(CAT) CCTYPE` -fPIC -DPIC -D_REENTRANT `$(CAT) CFLAGS` `$(CAT) OSCFLAGS` -c osdep.c -o $@
 
 osdep.c: osdepbas.c osdepckp.c osdeplog.c osdepssl.c
 	$(CAT) osdepbas.c osdepckp.c osdeplog.c osdepssl.c > osdep.c
--- imap-2007f/src/osdep/unix/mbx.c
+++ imap-2007f/src/osdep/unix/mbx.c	2018-04-10 14:49:53.635927625 +0000
@@ -37,6 +37,7 @@
 #include <stdio.h>
 #include <ctype.h>
 #include <errno.h>
+#include <utime.h>
 extern int errno;		/* just in case */
 #include "mail.h"
 #include "osdep.h"
--- imap-2007f/src/osdep/unix/mh.c
+++ imap-2007f/src/osdep/unix/mh.c	2018-04-10 14:49:53.639927553 +0000
@@ -35,6 +35,7 @@ extern int errno;		/* just in case */
 #include "osdep.h"
 #include <pwd.h>
 #include <time.h>
+#include <utime.h>
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "misc.h"
--- imap-2007f/src/osdep/unix/mmdf.c
+++ imap-2007f/src/osdep/unix/mmdf.c	2018-04-10 14:49:53.639927553 +0000
@@ -28,6 +28,7 @@
 #include <stdio.h>
 #include <ctype.h>
 #include <errno.h>
+#include <utime.h>
 extern int errno;		/* just in case */
 #include <signal.h>
 #include "mail.h"
--- imap-2007f/src/osdep/unix/mtx.c
+++ imap-2007f/src/osdep/unix/mtx.c	2018-04-10 14:49:53.639927553 +0000
@@ -35,6 +35,7 @@
  */
 
 #include <stdio.h>
+#include <utime.h>
 #include <ctype.h>
 #include <errno.h>
 extern int errno;		/* just in case */
--- imap-2007f/src/osdep/unix/mx.c
+++ imap-2007f/src/osdep/unix/mx.c	2018-04-10 14:49:53.639927553 +0000
@@ -35,6 +35,7 @@ extern int errno;		/* just in case */
 #include "osdep.h"
 #include <pwd.h>
 #include <time.h>
+#include <utime.h>
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "misc.h"
--- imap-2007f/src/osdep/unix/tenex.c
+++ imap-2007f/src/osdep/unix/tenex.c	2018-04-10 14:49:53.639927553 +0000
@@ -41,6 +41,7 @@
 
 #include <stdio.h>
 #include <ctype.h>
+#include <utime.h>
 #include <errno.h>
 extern int errno;		/* just in case */
 #include "mail.h"
--- imap-2007f/src/tmail/Makefile
+++ imap-2007f/src/tmail/Makefile	2018-04-10 14:53:25.732080347 +0000
@@ -31,9 +31,9 @@ SHELL = /bin/sh
 
 # Get local definitions from c-client directory
 
-CC = `cat $C/CCTYPE`
-CFLAGS = -I$C `cat $C/CFLAGS`
-LDFLAGS = $(CCLIENTLIB) `cat $C/LDFLAGS`
+CC = $(shell cat $C/CCTYPE)
+CFLAGS = -I$C $(shell cat $C/CFLAGS)
+LDFLAGS = $(CCLIENTLIB) $(shell cat $C/LDFLAGS)
 
 tmail: $(CCLIENTLIB) tmail.o tquota.o
 	$(CC) $(CFLAGS) -o tmail tmail.o tquota.o $(LDFLAGS)
openSUSE Build Service is sponsored by