Skip to content
Commits on Source (15)
2018-05-07 Gerd Stolpmann <gerd@gerdbook.fritz.box>
* Release 4.1.6
* Support for OCaml-4.07
2017-12-06 Gerd Stolpmann <gerd@gerdbook.fritz.box>
* Release 4.1.5
2017-12-05 Gerd Stolpmann <gerd@gerdbook.fritz.box>
* Support for native plugins (cmxs files) (Jaap Boender)
* Fix Nettls_gnutls: If a TLS server is configured to
authenticate the client, it does not expect that the
name in the certificate matches the DNS name of the
client. (In particular, the check is not done anymore
when [peer_name] is [None].)
* Fix: compatibility with library Nettle-3.4
2017-08-14 Gerd Stolpmann <gerd@gerdbook.fritz.box>
* Release 4.1.4
* Fix: incompatibility for OCaml < 4.03 because of -opaque
2017-08-05 Gerd Stolpmann <gerd@gerdbook.fritz.box>
* Release 4.1.3
* Building modules with -opaque flag when we don't install the cmx file
* Fix: incompatbility with OCaml-4.05 (O_KEEPEXEC flag)
* Fix: the local cppo built has been made compatible with -safe-string
2016-06-19 Gerd Stolpmann <gerd@e130.lan.sumadev.de>
* Release 4.1.2
......
......@@ -48,7 +48,7 @@ doc:
.PHONY: tools
tools:
( cd tools/cppo-$(CPPO_VERSION) && $(MAKE) all )
( cd tools/cppo-$(CPPO_VERSION) && rm -f depend && $(MAKE) -f Makefile.pre generate && $(MAKE) all )
( cd tools/unimap_to_ocaml && $(MAKE) all )
......
......@@ -48,15 +48,20 @@ ARCHIVE ?= $(PKGNAME)
ARCHIVE_CMA ?= $(ARCHIVE).cma
ARCHIVE_CMXA ?= $(ARCHIVE).cmxa
ARCHIVE_CMXS ?= $(ARCHIVE).cmxs
ARCHIVE_P ?= $(ARCHIVE).p
ARCHIVE_P_CMXA ?= $(ARCHIVE_P).cmxa
ARCHIVE_P_CMXS ?= $(ARCHIVE_P).cmxs
MT_TYPE ?= posix
HAVE_GPROF ?= 0
HAVE_SHARED ?= 0
ALL ?= $(ARCHIVE_CMA) $(ALL_EXTRA) \
all-mt-$(MT_TYPE)
OPT ?= $(ARCHIVE_CMXA) $(OPT_EXTRA) \
opt-mt-$(MT_TYPE) opt-p-$(HAVE_GPROF) opt-mt-$(MT_TYPE)-p-$(HAVE_GPROF)
opt-mt-$(MT_TYPE) opt-p-$(HAVE_GPROF) opt-mt-$(MT_TYPE)-p-$(HAVE_GPROF) \
opt-shared-$(HAVE_SHARED) opt-p-$(HAVE_GPROF)-shared-$(HAVE_SHARED)
all: $(ALL)
......@@ -72,7 +77,12 @@ opt-mt-vm-p-0:
opt-mt-posix-p-0:
opt-mt-vm-p-1:
opt-mt-posix-p-1: $(OPTMTP_EXTRA)
opt-shared-0:
opt-shared-1: $(ARCHIVE_CMXS)
opt-p-0-shared-0:
opt-p-0-shared-1:
opt-p-1-shared-0:
opt-p-1-shared-1: $(ARCHIVE_P_CMXS)
$(ARCHIVE_CMA): $(OBJECTS) $(COBJECTS)
......@@ -89,6 +99,9 @@ $(ARCHIVE_CMXA): $(XOBJECTS) $(COBJECTS)
$(OCAMLMKLIB) -o $(ARCHIVE) $(XOBJECTS) $(COBJECTS) $(LINK_OPTIONS); \
fi
$(ARCHIVE_CMXS): $(ARCHIVE_CMXA)
$(OCAMLOPT) -linkall -shared -I . -o $(ARCHIVE_CMXS) $(ARCHIVE_CMXA);
$(ARCHIVE_P_CMXA): $(XOBJECTS) $(COBJECTS)
if [ "X$(COBJECTS)" = "X" ]; then \
$(OCAMLOPT) -a -o $(ARCHIVE_P_CMXA) $(POBJECTS); \
......@@ -96,9 +109,12 @@ $(ARCHIVE_P_CMXA): $(XOBJECTS) $(COBJECTS)
$(OCAMLMKLIB) -o $(ARCHIVE_P) $(POBJECTS) $(COBJECTS) $(LINK_OPTIONS); \
fi
$(ARCHIVE_P_CMXS): $(ARCHIVE_P_CMXA)
$(OCAMLOPT) -linkall -shared -I . -o $(ARCHIVE_P_CMXS) $(ARCHIVE_P_CMXA);
# Files to remove everywhere by "make clean":
CLEAN_LIST = *.cmi *.cmo *.cma *.cmx *.o *.a *.cmxa dll* packlist-* \
CLEAN_LIST = *.cmi *.cmo *.cma *.cmx *.o *.a *.cmxa *.cmxs dll* packlist-* \
ocamldoc.dump META depend $(PACKLIST) $(GENERATE)
# Generic build rules:
......@@ -106,14 +122,16 @@ CLEAN_LIST = *.cmi *.cmo *.cma *.cmx *.o *.a *.cmxa dll* packlist-* \
.SUFFIXES: .cmo .cmi .cmx .ml .mli .mll .mly .c .o
.ml.cmx:
$(OCAMLOPT) -c $(OCAMLOPT_OPTIONS_FOR_$<) $<
$(OCAMLOPT) -c $(OCAMLOPT_OPTIONS_FOR_$<) $< && \
[ $(HAVE_GPROF) -eq 0 ] || $(OCAMLOPT) -c -p -o `basename $@ .cmx`.p.cmx $(OCAMLOPT_OPTIONS_FOR_$<) $<
.ml.cmo:
$(OCAMLC) -c $(OCAMLC_OPTIONS_FOR_$<) $<
.mli.cmi:
$(OCAMLC_MLI) -c $(OCAMLC_OPTIONS_FOR_$<) $<
opts="$(OPAQUE)"; \
if [ -f "$$(basename $< .ml)".nopaque ]; then opts=""; fi; \
$(OCAMLC_MLI) -c $(OCAMLC_OPTIONS_FOR_$<) $$opts $<
.mll.ml:
$(OCAMLLEX) $<
......@@ -158,7 +176,7 @@ realuninstall: $(UNINSTOTHER) uninstall-$(INSTMETHOD)
.PHONY: install-findlib
install-findlib: META
files=`$(COLLECT_FILES) *.mli *.cmi *.cma *.cmxa *.a dll* META $(INSTALL_EXTRA)` && \
files=`$(COLLECT_FILES) *.mli *.cmi *.cma *.cmxa *.cmxs *.a dll* META $(INSTALL_EXTRA)` && \
$(OCAMLFIND) install $(PKGNAME) $$files
.PHONY: uninstall-findlib
......
OASISFormat: 0.4
Name: ocamlnet
Version: 4.1.2
Version: 4.1.6
Synopsis: Internet protocols and helper data structures
Authors: Gerd Stolpmann et al.
ConfType: custom (0.4)
......
......@@ -73,7 +73,7 @@ set_defaults () {
ocamlc=`get_path ocamlc`
set_defaults
version="4.1.2"
version="4.1.6"
exec_suffix=""
path_sep=":"
......@@ -522,6 +522,18 @@ if ocamlopt -thread -o tmp/t${exec_suffix} ${OCAMLOPTFLAGS} unix.cmxa threads.cm
fi
echo "$mt_type $mt_comment"
######################################################################
# Check for cmxs support
printf "%s" "Checking whether cmxs is supported... "
have_shared=0
if ocamlopt -shared -o .dummy.cmxs >/dev/null 2>/dev/null; then
have_shared=1
echo "yes"
else
echo "no"
fi
######################################################################
# Check word size at al
......@@ -614,9 +626,34 @@ fi
if [ $istring -gt 0 ]; then
string_opts="-safe-string"
pp_bytes="-D HAVE_BYTES"
echo "#define STRING_COPY (fun s -> s)" >> config.cppo
else
string_opts=""
pp_bytes="-U HAVE_BYTES"
echo "#define STRING_COPY String.copy" >> config.cppo
fi
######################################################################
printf "Checking for String.lowercase_ascii and the like... "
cat <<EOF >tmp/t.ml
let s = String.lowercase_ascii "FOO"
EOF
if ocamlc -c tmp/t.ml >/dev/null 2>/dev/null; then
echo "yes"
echo "#define STRING_LOWERCASE String.lowercase_ascii" >> config.cppo
echo "#define STRING_UPPERCASE String.uppercase_ascii" >> config.cppo
echo "#define STRING_CAPITALIZE String.capitalize_ascii" >> config.cppo
echo "#define CHAR_LOWERCASE Char.lowercase_ascii" >> config.cppo
echo "#define CHAR_UPPERCASE Char.uppercase_ascii" >> config.cppo
else
echo "no"
echo "#define STRING_LOWERCASE String.lowercase" >> config.cppo
echo "#define STRING_UPPERCASE String.uppercase" >> config.cppo
echo "#define STRING_CAPITALIZE String.capitalize" >> config.cppo
echo "#define CHAR_LOWERCASE Char.lowercase" >> config.cppo
echo "#define CHAR_UPPERCASE Char.uppercase" >> config.cppo
fi
######################################################################
......@@ -635,6 +672,67 @@ else
echo "#undef HAVE_EXTENSIBLE_VARIANTS" >> config.cppo
fi
######################################################################
# check whether we have Unix.map_file
printf "Checking for Unix.map_file... "
mkdir -p tmp
cat <<_EOF_ >tmp/t.ml
let f = Unix.map_file;;
_EOF_
if ocaml unix.cma tmp/t.ml >/dev/null 2>/dev/null; then
echo "yes"
echo "#define HAVE_UNIX_MAP_FILE" >> config.cppo
else
echo "no"
echo "#undef HAVE_UNIX_MAP_FILE" >> config.cppo
fi
######################################################################
# check whether to prefer [@@noalloc]
printf "Checking for [@@noalloc]... "
mkdir -p tmp
cat <<_EOF_ >tmp/t.ml
external foo : float -> float = "foo" [@@noalloc]
_EOF_
if ocamlc -c tmp/t.ml >/dev/null 2>/dev/null; then
mkdir -p tmp
cat <<_EOF_ >tmp/t.ml
external foo : float -> float = "foo" "noalloc"
_EOF_
if ocamlc -c tmp/t.ml >tmp/t.log 2>&1; then
if [ -s tmp/t.log ]; then
echo "yes"
echo '#define NOALLOC [@@noalloc]' >> config.cppo
else
echo "unclear"
echo '#define NOALLOC "noalloc"' >> config.cppo
fi
else
echo "something is wrong"
exit 2
fi
else
echo "no"
echo '#define NOALLOC "noalloc"' >> config.cppo
fi
######################################################################
# check for -opaque
printf "checking for -opaque... "
if ocamlc -opaque >/dev/null 2>/dev/null; then
echo "present"
opaque="-opaque"
else
echo "not present"
opaque=""
fi
######################################################################
# Check that pcre is available:
......@@ -712,7 +810,6 @@ else
echo "no"
fi
######################################################################
# TCL
......@@ -1124,6 +1221,9 @@ INSTMETHOD = findlib
# Multi-threading type:
MT_TYPE = $mt_type
# whether cmxs is supported:
HAVE_SHARED = $have_shared
# word size:
WORD_SIZE = $word_size
......@@ -1133,6 +1233,9 @@ ENDIANESS = $endianess
# gprof:
HAVE_GPROF = $have_gprof
# opaque
OPAQUE = $opaque
# definition of the DEPRECATED macro
PP_DEPRECATED =
......
ocamlnet (4.1.6-1) unstable; urgency=medium
* New upstream release
* Remove libcryptgps-ocaml-dev from Build-Depends
* Bump Standards-Version to 4.4.0
* Bump debhelper compat level to 12
-- Stéphane Glondu <glondu@debian.org> Mon, 12 Aug 2019 16:12:54 +0200
ocamlnet (4.1.2-4) unstable; urgency=high
* Force rebuild of all packages on buildds
......
.dummy.cmxs
......@@ -5,7 +5,7 @@ Maintainer: Debian OCaml Maintainers <debian-ocaml-maint@lists.debian.org>
Uploaders:
Stéphane Glondu <glondu@debian.org>
Build-Depends:
debhelper (>= 9),
debhelper (>= 12),
dh-ocaml (>= 0.9),
dh-apache2,
ocaml-nox (>= 4),
......@@ -14,11 +14,10 @@ Build-Depends:
libfindlib-ocaml-dev,
libpcre-ocaml-dev (>= 6.0.1-2~),
liblablgtk2-ocaml-dev (>= 2.12.0-4~),
libcryptgps-ocaml-dev (>= 0.2.1-7~),
libzip-ocaml-dev,
libgnutls28-dev,
apache2-dev
Standards-Version: 3.9.8
Standards-Version: 4.4.0
Homepage: http://projects.camlcity.org/projects/ocamlnet.html
Vcs-Git: https://salsa.debian.org/ocaml-team/ocamlnet.git
Vcs-Browser: https://salsa.debian.org/ocaml-team/ocamlnet
......
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Packaged-By: Stefano Zacchiroli <zack@debian.org>
Packaged-Date: Wed, 8 May 2002 00:27:44 +0200.
Source: http://projects.camlcity.org/projects/ocamlnet.html
......
......@@ -10,7 +10,7 @@ Signed-off-by: Stefano Zacchiroli <zack@debian.org>
1 file changed, 1 insertion(+)
diff --git a/Makefile b/Makefile
index b2f114d..070f6c3 100644
index f0c33a0..3f31036 100644
--- a/Makefile
+++ b/Makefile
@@ -55,6 +55,7 @@ tools:
......
......@@ -12,10 +12,10 @@ Signed-off-by: Stefano Zacchiroli <zack@upsilon.cc>
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 281c918..33147c5 100755
index 8766026..5826074 100755
--- a/configure
+++ b/configure
@@ -962,8 +962,8 @@ if [ $enable_apache -gt 0 ]; then
@@ -1059,8 +1059,8 @@ if [ $enable_apache -gt 0 ]; then
apache=`get_path apache`
fi
......
......@@ -24,10 +24,10 @@ index e5eec77..d402e1c 100644
+distclean::
+ $(RM) -rf .libs/ *.cds
diff --git a/src/netsys/Makefile b/src/netsys/Makefile
index cbc1ce2..06e7240 100644
index d1113b7..11b4209 100644
--- a/src/netsys/Makefile
+++ b/src/netsys/Makefile
@@ -103,7 +103,8 @@ netsys_oothr-posix: netsys_oothr_mt.cmx
@@ -125,7 +125,8 @@ netsys_oothr-posix: netsys_oothr_mt.cmx
clean::
......
......@@ -9,7 +9,7 @@ Subject: Fix distclean target
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 070f6c3..fae21f8 100644
index 3f31036..4c4b2a9 100644
--- a/Makefile
+++ b/Makefile
@@ -90,12 +90,12 @@ CLEAN: clean
......
From: Stephane Glondu <steph@glondu.net>
Date: Mon, 12 Aug 2019 16:00:55 +0200
Subject: Remove call to deprecated Dynlink.init
It has been removed in OCaml 4.08.0.
---
src/netcgi2-apache/netcgi_apache_mod.ml.in | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/netcgi2-apache/netcgi_apache_mod.ml.in b/src/netcgi2-apache/netcgi_apache_mod.ml.in
index 145f3c8..2af5f20 100644
--- a/src/netcgi2-apache/netcgi_apache_mod.ml.in
+++ b/src/netcgi2-apache/netcgi_apache_mod.ml.in
@@ -310,7 +310,6 @@ struct
let () =
try
- Dynlink.init ();
Dynlink.allow_unsafe_modules true
with
Dynlink.Error(e) -> failwith(Dynlink.error_message e)
From: Dimitri John Ledkov <xnox@ubuntu.com>
Date: Thu, 20 Jul 2017 22:00:51 +0200
Subject: Ship cmx files to fix reverse-depends FTBFS
---
Makefile.rules | 2 +-
src/netcgi2-apache/Makefile.pre | 2 ++
src/netsys/Makefile.pre | 1 +
src/netunidata/Makefile.pre | 7 ++++++-
4 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/Makefile.rules b/Makefile.rules
index 1eb01bc..5c99b70 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -158,7 +158,7 @@ realuninstall: $(UNINSTOTHER) uninstall-$(INSTMETHOD)
.PHONY: install-findlib
install-findlib: META
- files=`$(COLLECT_FILES) *.mli *.cmi *.cma *.cmxa *.a dll* META $(INSTALL_EXTRA)` && \
+ files=`$(COLLECT_FILES) *.mli *.cmi *.cma *.cmx *.cmxa *.a dll* META $(INSTALL_EXTRA)` && \
$(OCAMLFIND) install $(PKGNAME) $$files
.PHONY: uninstall-findlib
diff --git a/src/netcgi2-apache/Makefile.pre b/src/netcgi2-apache/Makefile.pre
index d402e1c..f79306e 100644
--- a/src/netcgi2-apache/Makefile.pre
+++ b/src/netcgi2-apache/Makefile.pre
@@ -7,6 +7,8 @@ PKGNAME = netcgi2-apache
GENERATE = config.h netcgi_apache_mod.ml META 500netcgi_apache.info
INSTALL_EXTRA = netcgi_modtpl.cma 500netcgi_apache.info \
+ netcgi_apache_mod.cmx netcgi_apache_mod.o \
+ netcgi_apache_mod.p.cmx netcgi_apache_mod.p.o \
mod_netcgi_apache.so
PP_OPTIONS = -pp "$(CPPO) $(PP_BYTES) $(PP_DEPRECATED)"
diff --git a/src/netsys/Makefile.pre b/src/netsys/Makefile.pre
index 471a519..ff0564d 100644
--- a/src/netsys/Makefile.pre
+++ b/src/netsys/Makefile.pre
@@ -9,6 +9,7 @@ INSTALL_EXTRA = netsys_oothr.cmo \
netsys_oothr_mt_init.cmo \
netsys_oothr_mt_init.cmx netsys_oothr_mt_init.o \
netsys_oothr_mt_init.p.cmx netsys_oothr_mt_init.p.o \
+ netsys_gprof_init.cmx netsys_gprof_init.o \
netsys_gprof_init.p.cmx netsys_gprof_init.p.o \
netsys_c_gprof.o \
netsys_c_event.h \
diff --git a/src/netunidata/Makefile.pre b/src/netunidata/Makefile.pre
index 4b5114b..66155a4 100644
--- a/src/netunidata/Makefile.pre
+++ b/src/netunidata/Makefile.pre
@@ -26,7 +26,12 @@ OTHER_MAPPINGS = mappings/cp*.unimap \
INSTOTHER = install-netdb
PACKLIST = netdb-packlist
INSTALL_EXTRA = $(MAPPINGS:.ml=.cmo) $(MAPPINGS:.ml=.cmx) $(MAPPINGS:.ml=.o) \
- netuniinit.cmo netuniinit.cmx netuniinit.o
+ netuniinit.cmo netuniinit.cmx netuniinit.o \
+ netmappings_iso.p.cmx netmappings_iso.p.o \
+ netmappings_jp.p.cmx netmappings_jp.p.o \
+ netmappings_kr.p.cmx netmappings_kr.p.o \
+ netmappings_other.p.cmx netmappings_other.p.o \
+ netuniinit.p.cmx netuniinit.p.o
PP_OPTIONS = -pp "$(CPPO) $(PP_BYTES) $(PP_DEPRECATED)"
From: Gerd Stolpmann <gerd@gerd-stolpmann.de>
Date: Thu, 20 Jul 2017 22:07:14 +0200
Subject: ocaml-4.05: support for O_KEEPEXEC
---
src/netsys/Makefile | 2 +-
src/netsys/configure | 16 ++++++++++++++++
src/netsys/netsys_c.c | 31 +++++++++++++++++++++----------
src/netsys/netsys_posix.ml | 7 +++++++
4 files changed, 45 insertions(+), 11 deletions(-)
diff --git a/src/netsys/Makefile b/src/netsys/Makefile
index 06e7240..d8f58cd 100644
--- a/src/netsys/Makefile
+++ b/src/netsys/Makefile
@@ -56,7 +56,7 @@ OCAMLC_OPTIONS_FOR_netsys_c_xdr.c = -ccopt -O
OCAMLC_OPTIONS += $(STRING_OPTS)
OCAMLOPT_OPTIONS += $(STRING_OPTS)
-PP_OPTIONS = -pp "$(CPPO) $(DEF_O_SHARE_DELETE) $(DEF_O_CLOEXEC) $(PP_BYTES) $(PP_DEPRECATED)"
+PP_OPTIONS = -pp "$(CPPO) $(DEF_O_SHARE_DELETE) $(DEF_O_CLOEXEC) $(DEF_O_KEEPEXEC) $(PP_BYTES) $(PP_DEPRECATED)"
INSTALL_EXTRA += netsys_c_event.h $(OOH_OBJECT)
diff --git a/src/netsys/configure b/src/netsys/configure
index 1325843..f4dbc09 100755
--- a/src/netsys/configure
+++ b/src/netsys/configure
@@ -437,6 +437,21 @@ else
echo "no"
fi
+######################################################################
+
+printf "Checking for O_KEEPEXEC... "
+mkdir -p tmp
+cat <<_EOF_ >tmp/t.ml
+let x = Unix.O_KEEPEXEC;;
+_EOF_
+
+def_o_keepexec="-D NO_O_KEEPEXEC"
+if ocaml unix.cma tmp/t.ml >/dev/null 2>/dev/null; then
+ echo "yes"
+ def_o_keepexec="-D HAVE_O_KEEPEXEC"
+else
+ echo "no"
+fi
######################################################################
@@ -445,6 +460,7 @@ cat <<EOF >Makefile.conf
NETSYS_LINK_OPTIONS = $netsys_link_options
DEF_O_SHARE_DELETE = $def_o_share_delete
DEF_O_CLOEXEC = $def_o_cloexec
+DEF_O_KEEPEXEC = $def_o_keepexec
OOH_OBJECT = $def_ooh_object
EOF
diff --git a/src/netsys/netsys_c.c b/src/netsys/netsys_c.c
index a8b16be..4c30873 100644
--- a/src/netsys/netsys_c.c
+++ b/src/netsys/netsys_c.c
@@ -448,32 +448,43 @@ static int at_flags_table[] = {
#ifndef O_RSYNC
#define O_RSYNC 0
#endif
-#ifndef O_CLOEXEC
-#define NEED_CLOEXEC_EMULATION
-#define O_CLOEXEC 0
-#endif
static int open_flag_table[] = {
O_RDONLY, O_WRONLY, O_RDWR, O_NONBLOCK, O_APPEND, O_CREAT, O_TRUNC, O_EXCL,
- O_NOCTTY, O_DSYNC, O_SYNC, O_RSYNC, 0 /* O_SHARE_DELETE */, O_CLOEXEC
+ O_NOCTTY, O_DSYNC, O_SYNC, O_RSYNC,
+ 0 /* O_SHARE_DELETE */, 0 /* O_CLOEXEC */, 0 /* O_KEEPEXEC */
};
-#ifdef NEED_CLOEXEC_EMULATION
+enum { CLOEXEC = 1, KEEPEXEC = 2 };
+
static int open_cloexec_table[] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CLOEXEC, KEEPEXEC
};
+#ifndef HAVE_O_KEEPEXEC
+#define unix_cloexec_default 0
#endif
+
#endif
CAMLprim value netsys_openat(value dirfd, value path, value flags, value perm)
{
#ifdef HAVE_AT
CAMLparam4(dirfd, path, flags, perm);
- int ret, cv_flags;
+ int ret, cv_flags, clo_flags, cloexec;
char * p;
/* shamelessly copied from ocaml distro */
cv_flags = convert_flag_list(flags, open_flag_table);
+ clo_flags = convert_flag_list(flags, open_cloexec_table);
+ if (clo_flags & CLOEXEC)
+ cloexec = 1;
+ else if (clo_flags & KEEPEXEC)
+ cloexec = 0;
+ else
+ cloexec = unix_cloexec_default;
+#if defined(O_CLOEXEC)
+ if (cloexec) cv_flags |= O_CLOEXEC;
+#endif
p = stat_alloc(string_length(path) + 1);
strcpy(p, String_val(path));
enter_blocking_section();
@@ -481,8 +492,8 @@ CAMLprim value netsys_openat(value dirfd, value path, value flags, value perm)
leave_blocking_section();
stat_free(p);
if (ret == -1) uerror("openat", path);
-#if defined(NEED_CLOEXEC_EMULATION) && defined(FD_CLOEXEC)
- if (convert_flag_list(flags, open_cloexec_table) != 0) {
+#if !defined(O_CLOEXEC)
+ {
int flags = fcntl(Int_val(dirfd), F_GETFD, 0);
if (flags == -1 || fcntl(Int_val(dirfd), F_SETFD, flags | FD_CLOEXEC) == -1)
uerror("openat", path);
diff --git a/src/netsys/netsys_posix.ml b/src/netsys/netsys_posix.ml
index 602ceae..3bf3e7c 100644
--- a/src/netsys/netsys_posix.ml
+++ b/src/netsys/netsys_posix.ml
@@ -715,6 +715,12 @@ type at_flag = AT_EACCESS | AT_SYMLINK_NOFOLLOW | AT_SYMLINK_FOLLOW |
AT_REMOVEDIR
(* The stubs assume these type definitions: *)
+#ifdef HAVE_O_KEEPEXEC
+type open_flag1 = Unix.open_flag =
+ O_RDONLY | O_WRONLY | O_RDWR | O_NONBLOCK | O_APPEND | O_CREAT | O_TRUNC
+ | O_EXCL | O_NOCTTY | O_DSYNC | O_SYNC | O_RSYNC | O_SHARE_DELETE
+ | O_CLOEXEC | O_KEEPEXEC
+#else
#ifdef HAVE_O_CLOEXEC
type open_flag1 = Unix.open_flag =
O_RDONLY | O_WRONLY | O_RDWR | O_NONBLOCK | O_APPEND | O_CREAT | O_TRUNC
@@ -731,6 +737,7 @@ type open_flag1 = Unix.open_flag =
| O_EXCL | O_NOCTTY | O_DSYNC | O_SYNC | O_RSYNC
#endif
#endif
+#endif
type access_permission1 = Unix.access_permission =
R_OK | W_OK | X_OK | F_OK
From: Mehdi Dogguy <mehdi@debian.org>
Date: Sat, 27 Jan 2018 20:19:53 +0100
Subject: Support for nettle-3.4
Upstream: https://gitlab.camlcity.org/gerd/lib-ocamlnet3/commit/a23ef6b4941243063ae2c1bcc7e08cd839725820
---
src/nettls-gnutls/gnutls.descr | 25 -------------------------
src/nettls-gnutls/nettle.c | 19 +++++++++++++++++--
src/nettls-gnutls/nettle.descr | 2 ++
tools/stubgen.ml | 15 ++++++++++++++-
4 files changed, 33 insertions(+), 28 deletions(-)
diff --git a/src/nettls-gnutls/gnutls.descr b/src/nettls-gnutls/gnutls.descr
index 4f5708d..68cd1ea 100644
--- a/src/nettls-gnutls/gnutls.descr
+++ b/src/nettls-gnutls/gnutls.descr
@@ -29,7 +29,6 @@ let types =
"gnutls_x509_crl_t", abstract_ptr "gnutls_x509_crl_deinit";
"gnutls_x509_crt_t", abstract_ptr "gnutls_x509_crt_deinit";
(* "gnutls_x509_crq_t", `Abstract_ptr; (* in x509.h *) *)
- "gnutls_openpgp_keyring_t", abstract_ptr "gnutls_openpgp_keyring_deinit";
"gnutls_certificate_credentials_t", abstract_ptr "gnutls_certificate_free_credentials";
"gnutls_anon_server_credentials_t", abstract_ptr "gnutls_anon_free_server_credentials";
"gnutls_anon_client_credentials_t", abstract_ptr "gnutls_anon_free_client_credentials";
@@ -37,8 +36,6 @@ let types =
"gnutls_srp_client_credentials_t", abstract_ptr "gnutls_srp_free_client_credentials";
"gnutls_psk_server_credentials_t", abstract_ptr "gnutls_psk_free_server_credentials";
"gnutls_psk_client_credentials_t", abstract_ptr "gnutls_psk_free_client_credentials";
- (* "gnutls_openpgp_crt_t", `Abstract_ptr; *)
- (* "gnutls_openpgp_privkey_t", `Abstract_ptr; *)
(* "gnutls_pkcs11_privkey_t", `Abstract_ptr; *)
(* "gnutls_datum_t", `Abstract_ptr; *)
@@ -143,10 +140,6 @@ let types =
"?GNUTLS_VERIFY_|DISABLE_CRL_CHECKS";
];
- "gnutls_openpgp_crt_status_t",
- `Enum [ "GNUTLS_OPENPGP_|CERT";
- "GNUTLS_OPENPGP_|CERT_FINGERPRINT"
- ];
"gnutls_close_request_t", `Enum [ "GNUTLS_SHUT_|RDWR";
"GNUTLS_SHUT_|WR";
];
@@ -1059,14 +1052,6 @@ let functions =
gnutls_x509_crl_t array crl_list, \
crl_list array_size crl_list_size)";
(* NB: crls are copied by this function *)
-(*
- "gnutls_certificate_get_openpgp_keyring",
- [ "sc", `In, "gnutls_certificate_credentials_t";
- "keyring", `Out, "gnutls_openpgp_keyring_t";
- "result", `Return_ignore, "void";
- ],
- [ ];
- *)
(**********************************************************************)
@@ -1219,16 +1204,6 @@ let functions =
uint max_bits, \
uint max_depth)";
- (**********************************************************************)
- (* OpenPGP details *)
- (**********************************************************************)
-
- standard
- "void gnutls_openpgp_send_cert \
- (gnutls_session_t session, gnutls_openpgp_crt_status_t status)";
-
-
-
(**********************************************************************)
(* SRP *)
(**********************************************************************)
diff --git a/src/nettls-gnutls/nettle.c b/src/nettls-gnutls/nettle.c
index 62f9996..77d00ff 100644
--- a/src/nettls-gnutls/nettle.c
+++ b/src/nettls-gnutls/nettle.c
@@ -98,6 +98,7 @@ static const char *net_nettle_cipher_name(net_nettle_cipher_t cipher) {
return cipher->name;
}
+#ifndef HAVE_FUN_nettle_get_ciphers
#ifndef HAVE_FUN_nettle_ciphers
const struct nettle_cipher * const nettle_ciphers[] = {
&nettle_aes128,
@@ -122,13 +123,19 @@ const struct nettle_cipher * const nettle_ciphers[] = {
NULL
};
#endif
-
+#endif
static void net_nettle_ciphers(net_nettle_cipher_t **ciphers,
size_t *n) {
size_t k;
+ const struct nettle_cipher * const *nciphers;
+#ifdef HAVE_FUN_nettle_get_ciphers
+ nciphers = nettle_get_ciphers();
+#else
+ nciphers = nettle_ciphers;
+#endif
k = 0;
- while (nettle_ciphers[k] != NULL) k++;
+ while (nciphers[k] != NULL) k++;
*ciphers = (net_nettle_cipher_t *) nettle_ciphers;
*n = k;
}
@@ -337,6 +344,7 @@ static void net_nettle_hash_digest(net_nettle_hash_t hash,
hash->digest(ctx, length, dst);
}
+#ifndef HAVE_FUN_nettle_get_hashes
#ifndef HAVE_FUN_nettle_hashes
const struct nettle_hash * const nettle_hashes[] = {
&nettle_md2,
@@ -347,10 +355,17 @@ const struct nettle_hash * const nettle_hashes[] = {
NULL
};
#endif
+#endif
static void net_nettle_hashes(net_nettle_hash_t **hashes,
size_t *n) {
size_t k;
+ const struct nettle_hash * const *nhashes;
+#ifdef HAVE_FUN_nettle_get_hashes
+ nhashes = nettle_get_hashes();
+#else
+ nhashes = nettle_hashes;
+#endif
k = 0;
while (nettle_hashes[k] != NULL) k++;
*hashes = (net_nettle_hash_t *) nettle_hashes;
diff --git a/src/nettls-gnutls/nettle.descr b/src/nettls-gnutls/nettle.descr
index 0320dfb..82d7d9a 100644
--- a/src/nettls-gnutls/nettle.descr
+++ b/src/nettls-gnutls/nettle.descr
@@ -137,7 +137,9 @@ let optional_types =
[ "nettle_cipher_func" ]
let optional_functions =
[ "nettle_ciphers"; (* actually a variable *)
+ "nettle_get_ciphers";
"nettle_hashes"; (* actually a variable *)
+ "nettle_get_hashes";
]
diff --git a/tools/stubgen.ml b/tools/stubgen.ml
index 2433b23..3cd35c4 100644
--- a/tools/stubgen.ml
+++ b/tools/stubgen.ml
@@ -683,8 +683,21 @@ let gen_flags c mli ml tyname cases ~optional =
let gen_same_as c mli ml old_tyname tyname =
fprintf mli "type %s = %s\n" tyname old_tyname;
fprintf ml "type %s = %s\n" tyname old_tyname;
+ (* (* this generates gcc warnings: *)
fprintf c "#define wrap_%s wrap_%s\n" tyname old_tyname;
fprintf c "#define unwrap_%s unwrap_%s\n" tyname old_tyname
+ *)
+ fprintf c "/************** %s *************/\n\n" tyname;
+ fprintf c "static value wrap_%s(%s x) {\n" tyname tyname;
+ fprintf c " %s y;\n" old_tyname;
+ fprintf c " y = (%s) x;\n" old_tyname;
+ fprintf c " return wrap_%s(y);\n" old_tyname;
+ fprintf c "}\n\n";
+ fprintf c "static %s unwrap_%s(value v) {\n" tyname tyname;
+ fprintf c " %s y;\n" old_tyname;
+ fprintf c " y = unwrap_%s(v);\n" old_tyname;
+ fprintf c " return (%s) y;\n" tyname;
+ fprintf c "}\n\n"
(**********************************************************************)
(* Functions *)
@@ -804,7 +817,7 @@ let rec translate_type_to_c name ty =
| _ ->
ty, `Unsupported in
let c_ty1 =
- if is_const then "const " ^ c_ty else c_ty in
+ if is_const && tag <> `Unsupported then "const " ^ c_ty else c_ty in
(c_ty1, tag)
......@@ -5,6 +5,4 @@
0005-Fix-upstream-cleaning-rules.patch
0006-Fix-compilation-of-Apache-module.patch
0007-Fix-distclean-target.patch
0008-Ship-cmx-files-to-fix-reverse-depends-FTBFS.patch
0009-ocaml-4.05-support-for-O_KEEPEXEC.patch
0010-Support-for-nettle-3.4.patch
0008-Remove-call-to-deprecated-Dynlink.init.patch
......@@ -56,9 +56,8 @@ override_dh_auto_install:
override_dh_auto_clean: Makefile.conf
$(MAKE) distclean
.PHONY: override_dh_install
override_dh_install:
dh_install --fail-missing -X.so.owner -Xmod_netcgi_apache.so
override_dh_missing:
dh_missing --fail-missing -X.so.owner -Xmod_netcgi_apache.so
.PHONY: override_dh_compress
override_dh_compress:
......