diff --git a/erlang.spec b/erlang.spec index dbac58a..14887e4 100644 --- a/erlang.spec +++ b/erlang.spec @@ -17,13 +17,6 @@ %bcond_without doc -# No fop for EPEL5, and only for x86/x86_64 in EPEL6, so just disable there too -%if 0%{?el5}%{?el6} -%global use_prebuilt_docs 1 -%else -%global use_prebuilt_docs 0 -%endif - %ifarch %{arm} %{ix86} x86_64 ppc %{power64} %global __with_hipe 1 %endif @@ -32,18 +25,16 @@ Name: erlang Version: %{upstream_ver} -Release: %{upstream_rel_for_rpm}.7%{?dist} +Release: %{upstream_rel_for_rpm}.10%{?dist} Summary: General-purpose programming language and runtime environment Group: Development/Languages License: ERPL URL: http://www.erlang.org -Source0: http://www.erlang.org/download/otp_src_%{upstream_ver}%{upstream_rel}-1.tar.gz -%if %{use_prebuilt_docs} -Source1: http://erlang.org/download/otp_doc_html_%{upstream_ver}%{upstream_rel}-1.tar.gz -Source2: http://erlang.org/download/otp_doc_man_%{upstream_ver}%{upstream_rel}-1.tar.gz +%if 0%{?el7}%{?fedora} +VCS: scm:git:https://github.com/erlang/otp %endif -Source4: http://www.erlang.org/download/otp_src_%{upstream_ver}%{upstream_rel}-1.readme +Source0: http://www.erlang.org/download/otp_src_%{upstream_ver}%{upstream_rel}-1.tar.gz Source5: epmd.service Source6: epmd.socket Source7: epmd@.service @@ -104,11 +95,26 @@ Patch12: otp-0012-Add-systemd-support-to-epmd.patch # Fedora specific patch # Added systemd notify support to EPMD Patch13: otp-0013-Added-systemd-notify-support-to-EPMD.patch +# Fedora specific patch +# Install internal hrl files when necessary +Patch14: otp-0014-Install-internal-hrl-files-when-necessary.patch +# Fedora specific patch +# Expose NIF version +Patch15: otp-0015-Expose-NIF-version.patch +# Fedora specific patch +# Split off webtool dependency from tools +Patch16: otp-0016-Split-off-webtool-dependency-from-tools.patch +# Fedora specific patch +# lib/inets/src/ftp/ftp.erl: Check the filenames, usernames, +Patch17: otp-0017-lib-inets-src-ftp-ftp.erl-Check-the-filenames-userna.patch +# Fedora specific patch +# Introduce os:getenv/2 +Patch18: otp-0018-Introduce-os-getenv-2.patch +# Fedora specific patch +# Patch removes support for SSLv3 protocol because it is proved +Patch19: otp-0019-Patch-removes-support-for-SSLv3-protocol-because-it-.patch # end of autogenerated patch tag list -# BuildRoot not strictly needed since F10, but keep it for spec file robustness -BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) - BuildRequires: lksctp-tools-devel BuildRequires: ncurses-devel BuildRequires: openssl-devel @@ -116,8 +122,7 @@ BuildRequires: zlib-devel BuildRequires: flex BuildRequires: m4 %if %{with doc} -%if %{use_prebuilt_docs} -%else +# BEWARE. No fop for EPEL5, and only for x86/x86_64 in EPEL6, so we cannot regenerate docs here BuildRequires: fop BuildRequires: libxslt @@ -126,14 +131,11 @@ BuildRequires: libxslt BuildRequires: erlang %endif %endif -%endif -%if 0%{?el6}%{?fedora} BuildRequires: emacs BuildRequires: xemacs BuildRequires: emacs-el BuildRequires: xemacs-packages-extra-el -%endif %if 0%{?el7}%{?fedora} # for @@ -144,63 +146,64 @@ Requires(postun):systemd Requires: systemd %endif -Requires: erlang-appmon%{?_isa} = %{version}-%{release} -Requires: erlang-asn1%{?_isa} = %{version}-%{release} -Requires: erlang-common_test%{?_isa} = %{version}-%{release} -Requires: erlang-compiler%{?_isa} = %{version}-%{release} -Requires: erlang-cosEvent%{?_isa} = %{version}-%{release} -Requires: erlang-cosEventDomain%{?_isa} = %{version}-%{release} -Requires: erlang-cosFileTransfer%{?_isa} = %{version}-%{release} -Requires: erlang-cosNotification%{?_isa} = %{version}-%{release} -Requires: erlang-cosProperty%{?_isa} = %{version}-%{release} -Requires: erlang-cosTime%{?_isa} = %{version}-%{release} -Requires: erlang-cosTransactions%{?_isa} = %{version}-%{release} -Requires: erlang-crypto%{?_isa} = %{version}-%{release} -Requires: erlang-debugger%{?_isa} = %{version}-%{release} +BuildRequires: erlang-rpm-macros -Requires: erlang-dialyzer%{?_isa} = %{version}-%{release} -Requires: erlang-diameter%{?_isa} = %{version}-%{release} -Requires: erlang-edoc%{?_isa} = %{version}-%{release} -Requires: erlang-eldap%{?_isa} = %{version}-%{release} -Requires: erlang-erl_docgen%{?_isa} = %{version}-%{release} -Requires: erlang-erl_interface%{?_isa} = %{version}-%{release} -Requires: erlang-erts%{?_isa} = %{version}-%{release} -Requires: erlang-et%{?_isa} = %{version}-%{release} -Requires: erlang-eunit%{?_isa} = %{version}-%{release} -Requires: erlang-examples%{?_isa} = %{version}-%{release} -Requires: erlang-gs%{?_isa} = %{version}-%{release} -Requires: erlang-hipe%{?_isa} = %{version}-%{release} -Requires: erlang-ic%{?_isa} = %{version}-%{release} -Requires: erlang-inets%{?_isa} = %{version}-%{release} -Requires: erlang-jinterface%{?_isa} = %{version}-%{release} -Requires: erlang-kernel%{?_isa} = %{version}-%{release} -Requires: erlang-megaco%{?_isa} = %{version}-%{release} -Requires: erlang-mnesia%{?_isa} = %{version}-%{release} -Requires: erlang-observer%{?_isa} = %{version}-%{release} -Requires: erlang-odbc%{?_isa} = %{version}-%{release} -Requires: erlang-orber%{?_isa} = %{version}-%{release} -Requires: erlang-os_mon%{?_isa} = %{version}-%{release} -Requires: erlang-otp_mibs%{?_isa} = %{version}-%{release} -Requires: erlang-parsetools%{?_isa} = %{version}-%{release} -Requires: erlang-percept%{?_isa} = %{version}-%{release} -Requires: erlang-pman%{?_isa} = %{version}-%{release} -Requires: erlang-public_key%{?_isa} = %{version}-%{release} -Requires: erlang-reltool%{?_isa} = %{version}-%{release} -Requires: erlang-runtime_tools%{?_isa} = %{version}-%{release} -Requires: erlang-sasl%{?_isa} = %{version}-%{release} -Requires: erlang-snmp%{?_isa} = %{version}-%{release} -Requires: erlang-ssh%{?_isa} = %{version}-%{release} -Requires: erlang-ssl%{?_isa} = %{version}-%{release} -Requires: erlang-stdlib%{?_isa} = %{version}-%{release} -Requires: erlang-syntax_tools%{?_isa} = %{version}-%{release} -Requires: erlang-test_server%{?_isa} = %{version}-%{release} -Requires: erlang-toolbar%{?_isa} = %{version}-%{release} -Requires: erlang-tools%{?_isa} = %{version}-%{release} -Requires: erlang-tv%{?_isa} = %{version}-%{release} -Requires: erlang-typer%{?_isa} = %{version}-%{release} -Requires: erlang-webtool%{?_isa} = %{version}-%{release} -Requires: erlang-wx%{?_isa} = %{version}-%{release} -Requires: erlang-xmerl%{?_isa} = %{version}-%{release} +Requires: %{name}-appmon%{?_isa} = %{version}-%{release} +Requires: %{name}-asn1%{?_isa} = %{version}-%{release} +Requires: %{name}-common_test%{?_isa} = %{version}-%{release} +Requires: %{name}-compiler%{?_isa} = %{version}-%{release} +Requires: %{name}-cosEvent%{?_isa} = %{version}-%{release} +Requires: %{name}-cosEventDomain%{?_isa} = %{version}-%{release} +Requires: %{name}-cosFileTransfer%{?_isa} = %{version}-%{release} +Requires: %{name}-cosNotification%{?_isa} = %{version}-%{release} +Requires: %{name}-cosProperty%{?_isa} = %{version}-%{release} +Requires: %{name}-cosTime%{?_isa} = %{version}-%{release} +Requires: %{name}-cosTransactions%{?_isa} = %{version}-%{release} +Requires: %{name}-crypto%{?_isa} = %{version}-%{release} +Requires: %{name}-debugger%{?_isa} = %{version}-%{release} +Requires: %{name}-dialyzer%{?_isa} = %{version}-%{release} +Requires: %{name}-diameter%{?_isa} = %{version}-%{release} +Requires: %{name}-edoc%{?_isa} = %{version}-%{release} +Requires: %{name}-eldap%{?_isa} = %{version}-%{release} +Requires: %{name}-erl_docgen%{?_isa} = %{version}-%{release} +Requires: %{name}-erl_interface%{?_isa} = %{version}-%{release} +Requires: %{name}-erts%{?_isa} = %{version}-%{release} +Requires: %{name}-et%{?_isa} = %{version}-%{release} +Requires: %{name}-eunit%{?_isa} = %{version}-%{release} +Requires: %{name}-examples%{?_isa} = %{version}-%{release} +Requires: %{name}-gs%{?_isa} = %{version}-%{release} +Requires: %{name}-hipe%{?_isa} = %{version}-%{release} +Requires: %{name}-ic%{?_isa} = %{version}-%{release} +Requires: %{name}-inets%{?_isa} = %{version}-%{release} +Requires: %{name}-jinterface%{?_isa} = %{version}-%{release} +Requires: %{name}-kernel%{?_isa} = %{version}-%{release} +Requires: %{name}-megaco%{?_isa} = %{version}-%{release} +Requires: %{name}-mnesia%{?_isa} = %{version}-%{release} +Requires: %{name}-observer%{?_isa} = %{version}-%{release} +Requires: %{name}-odbc%{?_isa} = %{version}-%{release} +Requires: %{name}-orber%{?_isa} = %{version}-%{release} +Requires: %{name}-os_mon%{?_isa} = %{version}-%{release} +Requires: %{name}-otp_mibs%{?_isa} = %{version}-%{release} +Requires: %{name}-parsetools%{?_isa} = %{version}-%{release} +Requires: %{name}-percept%{?_isa} = %{version}-%{release} +Requires: %{name}-pman%{?_isa} = %{version}-%{release} +Requires: %{name}-public_key%{?_isa} = %{version}-%{release} +Requires: %{name}-reltool%{?_isa} = %{version}-%{release} +Requires: %{name}-runtime_tools%{?_isa} = %{version}-%{release} +Requires: %{name}-sasl%{?_isa} = %{version}-%{release} +Requires: %{name}-snmp%{?_isa} = %{version}-%{release} +Requires: %{name}-ssh%{?_isa} = %{version}-%{release} +Requires: %{name}-ssl%{?_isa} = %{version}-%{release} +Requires: %{name}-stdlib%{?_isa} = %{version}-%{release} +Requires: %{name}-syntax_tools%{?_isa} = %{version}-%{release} +Requires: %{name}-test_server%{?_isa} = %{version}-%{release} +Requires: %{name}-toolbar%{?_isa} = %{version}-%{release} +Requires: %{name}-tools%{?_isa} = %{version}-%{release} +Requires: %{name}-tv%{?_isa} = %{version}-%{release} +Requires: %{name}-typer%{?_isa} = %{version}-%{release} +Requires: %{name}-webtool%{?_isa} = %{version}-%{release} +Requires: %{name}-wx%{?_isa} = %{version}-%{release} +Requires: %{name}-xmerl%{?_isa} = %{version}-%{release} Obsoletes: erlang-docbuilder Obsoletes: erlang-inviso @@ -405,15 +408,15 @@ Requires: %{name}-syntax_tools%{?_isa} = %{version}-%{release} %description diameter Diameter (RFC 3588) library +%if %{with doc} %package doc Summary: Erlang documentation Group: Development/Languages -%if 0%{?el6}%{?el7}%{?fedora} BuildArch: noarch -%endif %description doc Documentation for Erlang. +%endif %package edoc Summary: A utility used to generate documentation out of tags in source files @@ -464,8 +467,12 @@ Summary: Functionality necessary to run the Erlang System itself Group: Development/Languages Requires: %{name}-kernel%{?_isa} = %{version}-%{release} Requires: %{name}-stdlib%{?_isa} = %{version}-%{release} +# This library is dlopened so it can't be picked up automatically by the RPM +# dependency checker Requires: lksctp-tools +# See erts/emulator/beam/erl_driver.h or call erlang:system_info(driver_version). Provides: erlang(erl_drv_version) = 2.2 +# See erts/emulator/beam/erl_nif.h or call erlang:system_info(nif_version). Provides: erlang(erl_nif_version) = 2.4 %description erts @@ -558,7 +565,7 @@ Group: Development/Languages Requires: %{name}-erts%{?_isa} = %{version}-%{release} # FIXME see erlang-ic also #Requires: jpackage-utils -%if 0%{?fedora}%{?el7} +%if 0%{?el7}%{?fedora} BuildRequires: java-devel %else %ifarch %{ix86} x86_64 @@ -788,7 +795,6 @@ Secure Shell application with sftp and ssh support. %package ssl Summary: Secure Socket Layer support Group: Development/Languages -#Requires: %{name}-asn1%{?_isa} = %{version}-%{release} Requires: %{name}-crypto%{?_isa} = %{version}-%{release} Requires: %{name}-erts%{?_isa} = %{version}-%{release} Requires: %{name}-kernel%{?_isa} = %{version}-%{release} @@ -828,7 +834,6 @@ Requires: %{name}-inets%{?_isa} = %{version}-%{release} Requires: %{name}-kernel%{?_isa} = %{version}-%{release} Requires: %{name}-observer%{?_isa} = %{version}-%{release} Requires: %{name}-runtime_tools%{?_isa} = %{version}-%{release} -#Requires: %{name}-sasl%{?_isa} = %{version}-%{release} Requires: %{name}-stdlib%{?_isa} = %{version}-%{release} Requires: %{name}-tools%{?_isa} = %{version}-%{release} @@ -855,7 +860,12 @@ Requires: %{name}-inets%{?_isa} = %{version}-%{release} Requires: %{name}-kernel%{?_isa} = %{version}-%{release} Requires: %{name}-runtime_tools%{?_isa} = %{version}-%{release} Requires: %{name}-stdlib%{?_isa} = %{version}-%{release} -Requires: %{name}-webtool%{?_isa} = %{version}-%{release} +# This is a weak dependency triggered by the "cover_web" application. +# Unfortunately Recommends/Suggests tags are supported only in Fedora 21+ and +# RHEL 8+ (eventually) +%if 0%{?fedora} >= 21 || 0%{?rhel} >= 8 +Suggests: %{name}-webtool%{?_isa} = %{version}-%{release} +%endif Provides: emacs-common-erlang = %{version}-%{release} %description tools @@ -922,7 +932,6 @@ Requires: %{name}-stdlib%{?_isa} = %{version}-%{release} %description xmerl Provides support for XML 1.0. -%if 0%{?el6}%{?fedora} %package -n emacs-erlang Summary: Compiled elisp files for erlang-mode under GNU Emacs Requires: emacs-common-erlang = %{version}-%{release} @@ -960,7 +969,6 @@ BuildArch: noarch %description -n xemacs-erlang-el Erlang mode for XEmacs (source lisp files). -%endif %prep %setup -q -n otp_src_%{upstream_ver}%{upstream_rel}-1 @@ -983,6 +991,12 @@ Erlang mode for XEmacs (source lisp files). %patch11 -p1 -b .Add_systemd_option_to_empd_Check_for_include_system %patch12 -p1 -b .Add_systemd_support_to_epmd %patch13 -p1 -b .Added_systemd_notify_support_to_EPMD +%patch14 -p1 -b .Install_internal_hrl_files_when_necessary +%patch15 -p1 -b .Expose_NIF_version +%patch16 -p1 -b .Split_off_webtool_dependency_from_tools +%patch17 -p1 -b .lib_inets_src_ftp_ftp_erl_Check_the_filenames_userna +%patch18 -p1 -b .Introduce_os_getenv_2 +%patch19 -p1 -b .Patch_removes_support_for_SSLv3_protocol_because_it_ # end of autogenerated prep patch list # FIXME we should come up with a better solution @@ -1005,9 +1019,9 @@ rm -f lib/ssl/examples/certs/etc/erlangCA/index.txt.old %build %ifarch sparcv9 sparc64 -CFLAGS="$RPM_OPT_FLAGS -mcpu=ultrasparc -fno-strict-aliasing" %configure --enable-shared-zlib --enable-sctp %{?__with_hipe:--enable-hipe} +CFLAGS="$RPM_OPT_FLAGS -mcpu=ultrasparc -fno-strict-aliasing" %configure --enable-shared-zlib --enable-sctp --enable-systemd %{?__with_hipe:--enable-hipe} %else -CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" %configure --enable-shared-zlib --enable-sctp %{?__with_hipe:--enable-hipe} +CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" %configure --enable-shared-zlib --enable-sctp --enable-systemd %{?__with_hipe:--enable-hipe} %endif # Remove pre-built BEAM files @@ -1016,7 +1030,6 @@ make clean # GNU Emacs/XEmacs related stuff erlang_tools_vsn="$(sed -n 's/TOOLS_VSN = //p' lib/tools/vsn.mk)" -%if 0%{?el6}%{?fedora} # GNU Emacs related stuff cat > emacs-erlang-init.el << EOF (setq load-path (cons "%{_emacs_sitelispdir}/erlang" load-path)) @@ -1043,12 +1056,10 @@ rm -f xemacs-erlang/erlang-flymake.el pushd xemacs-erlang %{_xemacs_bytecompile} *.el popd -%endif make + %if %{with doc} -%if %{use_prebuilt_docs} -%else # should use FOP_OPTS after #832323 is resolved %ifnarch ppc %{power64} export BASE_OPTIONS=-Xmx1024m @@ -1057,13 +1068,9 @@ export BASE_OPTIONS=-Xmx1536m %endif make docs %endif -%endif %install -rm -rf $RPM_BUILD_ROOT - -%if 0%{?el6}%{?fedora} # GNU Emacs/XEmacs related stuff erlang_tools_vsn="$(sed -n 's/TOOLS_VSN = //p' lib/tools/vsn.mk)" @@ -1089,25 +1096,12 @@ for f in lib/tools/emacs/{README,*.el}; do done rm -f "$RPM_BUILD_ROOT%{_xemacs_sitelispdir}/erlang/erlang-flymake.el" install -m 0644 xemacs-erlang/*.elc "$RPM_BUILD_ROOT%{_xemacs_sitelispdir}/erlang/" -%endif make DESTDIR=$RPM_BUILD_ROOT install + %if %{with doc} -%if %{use_prebuilt_docs} -# extract prebuilt docs and man-pages -tar xf %{SOURCE1} -C $RPM_BUILD_ROOT%{_libdir}/erlang -tar xf %{SOURCE2} -C $RPM_BUILD_ROOT%{_libdir}/erlang -# rm Win32-specific functionality -rm -f $RPM_BUILD_ROOT%{_libdir}/erlang/man/man3/nteventlog.* -# rm VxWorks specific -rm -f $RPM_BUILD_ROOT%{_libdir}/erlang/man/man3/erl_set_memory_block.* -# rm unneeded files -rm -f $RPM_BUILD_ROOT%{_libdir}/erlang/erts-*/info -rm -f $RPM_BUILD_ROOT%{_libdir}/erlang/lib/*-*/info -%else env ERL_LIBS="$RPM_BUILD_ROOT%{_libdir}/erlang/lib" make DESTDIR=$RPM_BUILD_ROOT install-docs %endif -%endif # Do not install info files - they are almost empty and useless find $RPM_BUILD_ROOT%{_libdir}/erlang -type f -name info -exec rm -f {} \; @@ -1194,10 +1188,6 @@ useradd -r -g epmd -d /tmp -s /sbin/nologin \ -c "Erlang Port Mapper Daemon" epmd 2>/dev/null || : -%clean -rm -rf $RPM_BUILD_ROOT - - %files %if %{with doc} %dir %{_docdir}/%{n_uvr}/ @@ -1410,8 +1400,8 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/erlang/man/man4/diameter_dict.* %endif -%files doc %if %{with doc} +%files doc %doc %{_docdir}/%{n_uvr}/doc %doc %{_docdir}/%{n_uvr}/erts-*/ %doc %{_docdir}/%{n_uvr}/lib/ @@ -1436,7 +1426,9 @@ rm -rf $RPM_BUILD_ROOT %files erl_docgen %{_libdir}/erlang/lib/erl_docgen-*/ +%if %{with doc} %{_libdir}/erlang/man/man6/erl_docgen.* +%endif %files erl_interface %{_libdir}/erlang/lib/erl_interface-*/ @@ -1455,7 +1447,9 @@ rm -rf $RPM_BUILD_ROOT %endif %files erts -# TODO these directories should be packaged separately +# TODO +# In order to have a parallel-installable Erlang packages these directories +# should be packaged separately %dir %{_libdir}/erlang/ %dir %{_libdir}/erlang/bin/ %dir %{_libdir}/erlang/lib/ @@ -1556,6 +1550,7 @@ rm -rf $RPM_BUILD_ROOT %dir %{_libdir}/erlang/lib/eunit-*/ %{_libdir}/erlang/lib/eunit-*/ebin %{_libdir}/erlang/lib/eunit-*/include +%{_libdir}/erlang/lib/eunit-*/src %if %{with doc} %{_libdir}/erlang/man/man3/eunit.* %{_libdir}/erlang/man/man3/eunit_surefire.* @@ -2313,7 +2308,6 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/erlang/man/man3/xmerl_xsd.* %endif -%if 0%{?el6}%{?fedora} %files -n emacs-erlang %dir %{_emacs_sitelispdir}/erlang %doc %{_emacs_sitelispdir}/erlang/README @@ -2331,10 +2325,20 @@ rm -rf $RPM_BUILD_ROOT %files -n xemacs-erlang-el %{_xemacs_sitelispdir}/erlang/*.el -%endif %changelog +* Mon Dec 01 2014 Peter Lemenkov - R16B-03.10 +- Disable SSLv3 (see rhbz #1169375) +- Backport useful os:getenv/2 from master (see https://github.com/erlang/otp/pull/535 ) + +* Mon Nov 17 2014 Peter Lemenkov - R16B-03.9 +- Fixed CVE-2014-1693 (backported fix from ver. 17.x.x, see patch no. 17) + +* Tue Nov 11 2014 Peter Lemenkov - R16B-03.8 +- Trimmed dependency chain +- Cleaned up spec-file + * Wed Jun 11 2014 Peter Lemenkov - R16B-03.7 - Added missing template for epmd@.socket diff --git a/otp-0014-Install-internal-hrl-files-when-necessary.patch b/otp-0014-Install-internal-hrl-files-when-necessary.patch new file mode 100644 index 0000000..14cf312 --- /dev/null +++ b/otp-0014-Install-internal-hrl-files-when-necessary.patch @@ -0,0 +1,97 @@ +From: Peter Lemenkov +Date: Tue, 26 Aug 2014 13:53:49 +0400 +Subject: [PATCH] Install internal hrl files when necessary + +Sometimes we install *.erl files. Some these files include a private +*.hrl files, so in order to make these *.erl files usable we have to +install these private includes as well. + +Signed-off-by: Peter Lemenkov + +Conflicts: + lib/eunit/src/Makefile + lib/percept/src/Makefile + lib/test_server/src/Makefile + +diff --git a/lib/debugger/src/Makefile b/lib/debugger/src/Makefile +index 5a6f298..b40ef23 100644 +--- a/lib/debugger/src/Makefile ++++ b/lib/debugger/src/Makefile +@@ -77,7 +77,7 @@ MODULES= \ + + HRL_FILES= + +-INTERNAL_HRL_FILES= dbg_ieval.hrl ++INTERNAL_HRL_FILES= dbg_ieval.hrl dbg_wx_filedialog_win.hrl + + ERL_FILES= $(MODULES:%=%.erl) + +diff --git a/lib/eunit/src/Makefile b/lib/eunit/src/Makefile +index a5e147d..8483e28 100644 +--- a/lib/eunit/src/Makefile ++++ b/lib/eunit/src/Makefile +@@ -46,6 +46,8 @@ SOURCES= \ + + INCLUDE_FILES = eunit.hrl + ++INTERNAL_HRL_FILES= eunit_internal.hrl ++ + PARSE_TRANSFORM_BIN = $(PARSE_TRANSFORM:%.erl=$(EBIN)/%.$(EMULATOR)) + + TARGET_FILES= $(SOURCES:%.erl=$(EBIN)/%.$(EMULATOR)) +@@ -117,6 +119,8 @@ include $(ERL_TOP)/make/otp_release_targets.mk + release_spec: opt + $(INSTALL_DIR) "$(RELSYSDIR)/ebin" + $(INSTALL_DATA) $(PARSE_TRANSFORM_BIN) $(OBJECTS) "$(RELSYSDIR)/ebin" ++ $(INSTALL_DIR) "$(RELSYSDIR)/src" ++ $(INSTALL_DATA) $(INTERNAL_HRL_FILES) "$(RELSYSDIR)/src" + $(INSTALL_DIR) "$(RELSYSDIR)/include" + $(INSTALL_DATA) $(INCLUDE_DELIVERABLES) "$(RELSYSDIR)/include" + +diff --git a/lib/kernel/src/Makefile b/lib/kernel/src/Makefile +index dbda2a2..3e1792f 100644 +--- a/lib/kernel/src/Makefile ++++ b/lib/kernel/src/Makefile +@@ -122,6 +122,7 @@ HRL_FILES= ../include/file.hrl ../include/inet.hrl ../include/inet_sctp.hrl \ + ../include/net_address.hrl + + INTERNAL_HRL_FILES= application_master.hrl disk_log.hrl \ ++ erl_epmd.hrl hipe_ext_format.hrl \ + inet_dns.hrl inet_res.hrl \ + inet_boot.hrl inet_config.hrl inet_int.hrl \ + inet_dns_record_adts.hrl +diff --git a/lib/percept/src/Makefile b/lib/percept/src/Makefile +index e501539..5902da3 100644 +--- a/lib/percept/src/Makefile ++++ b/lib/percept/src/Makefile +@@ -50,6 +50,8 @@ MODULES= \ + + #HRL_FILES= ../include/ + ++INTERNAL_HRL_FILES= egd.hrl percept.hrl ++ + ERL_FILES= $(MODULES:%=%.erl) + + TARGET_FILES= $(MODULES:%=$(EBIN)/%.$(EMULATOR)) $(APP_TARGET) $(APPUP_TARGET) +@@ -93,6 +95,8 @@ docs: + include $(ERL_TOP)/make/otp_release_targets.mk + + release_spec: opt ++ $(INSTALL_DIR) "$(RELSYSDIR)/src" ++ $(INSTALL_DATA) $(INTERNAL_HRL_FILES) "$(RELSYSDIR)/src" + # $(INSTALL_DIR) "$(RELSYSDIR)/include" + # $(INSTALL_DATA) $(HRL_FILES) "$(RELSYSDIR)/include" + $(INSTALL_DIR) "$(RELSYSDIR)/ebin" +diff --git a/lib/test_server/src/Makefile b/lib/test_server/src/Makefile +index bcb1bc3..deb7caf 100644 +--- a/lib/test_server/src/Makefile ++++ b/lib/test_server/src/Makefile +@@ -123,7 +123,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk + + release_spec: opt + $(INSTALL_DIR) "$(RELSYSDIR)/src" +- $(INSTALL_DATA) $(INTERNAL_HRL_FILES) "$(RELSYSDIR)/src" ++ $(INSTALL_DATA) $(INTERNAL_HRL_FILES) $(TS_HRL_FILES) "$(RELSYSDIR)/src" + $(INSTALL_DIR) "$(RELSYSDIR)/include" + $(INSTALL_DATA) $(HRL_FILES) "$(RELSYSDIR)/include" + $(INSTALL_DIR) "$(RELSYSDIR)/ebin" diff --git a/otp-0015-Expose-NIF-version.patch b/otp-0015-Expose-NIF-version.patch new file mode 100644 index 0000000..3ae0096 --- /dev/null +++ b/otp-0015-Expose-NIF-version.patch @@ -0,0 +1,90 @@ +From: Peter Lemenkov +Date: Sun, 2 Nov 2014 19:49:55 +0300 +Subject: [PATCH] Expose NIF version + +This patch allows checking for NIF API version in a way similar to +driver version. E.g. by calling erlang:system_info(nif_version). + +Signed-off-by: Peter Lemenkov + +Conflicts: + erts/emulator/test/driver_SUITE.erl + +diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml +index e3ef48a..b9d7230 100644 +--- a/erts/doc/src/erlang.xml ++++ b/erts/doc/src/erlang.xml +@@ -5903,6 +5903,11 @@ ok + erlang:system_info(multi_scheduling), and + erlang:system_info(schedulers).

+ ++ nif_version ++ ++

Returns a string containing the erlang NIF version ++ used by the runtime system. It will be on the form "<major ver>.<minor ver>".

++
+ otp_release + +

Returns a string containing the OTP release number.

+diff --git a/erts/emulator/beam/erl_bif_info.c b/erts/emulator/beam/erl_bif_info.c +index d7f1e2d..7a7f23e 100755 +--- a/erts/emulator/beam/erl_bif_info.c ++++ b/erts/emulator/beam/erl_bif_info.c +@@ -27,6 +27,7 @@ + #include "erl_process.h" + #include "error.h" + #include "erl_driver.h" ++#include "erl_nif.h" + #include "bif.h" + #include "big.h" + #include "erl_version.h" +@@ -2428,6 +2429,13 @@ BIF_RETTYPE system_info_1(BIF_ALIST_1) + ERL_DRV_EXTENDED_MINOR_VERSION); + hp = HAlloc(BIF_P, 2*n); + BIF_RET(buf_to_intlist(&hp, buf, n, NIL)); ++ } else if (ERTS_IS_ATOM_STR("nif_version", BIF_ARG_1)) { ++ char buf[42]; ++ int n = erts_snprintf(buf, 42, "%d.%d", ++ ERL_NIF_MAJOR_VERSION, ++ ERL_NIF_MINOR_VERSION); ++ hp = HAlloc(BIF_P, 2*n); ++ BIF_RET(buf_to_intlist(&hp, buf, n, NIL)); + } else if (ERTS_IS_ATOM_STR("smp_support", BIF_ARG_1)) { + #ifdef ERTS_SMP + BIF_RET(am_true); +diff --git a/erts/preloaded/src/erlang.erl b/erts/preloaded/src/erlang.erl +index 2919265..c0f14ad 100644 +--- a/erts/preloaded/src/erlang.erl ++++ b/erts/preloaded/src/erlang.erl +@@ -2124,6 +2124,7 @@ tuple_to_list(_Tuple) -> + (modified_timing_level) -> integer() | undefined; + (multi_scheduling) -> disabled | blocked | enabled; + (multi_scheduling_blockers) -> [PID :: pid()]; ++ (nif_version) -> string(); + (otp_release) -> string(); + (port_count) -> non_neg_integer(); + (port_limit) -> pos_integer(); +diff --git a/lib/runtime_tools/src/system_information.erl b/lib/runtime_tools/src/system_information.erl +index 1d4b878..64f1b82 100644 +--- a/lib/runtime_tools/src/system_information.erl ++++ b/lib/runtime_tools/src/system_information.erl +@@ -344,6 +344,7 @@ erlang_system_info() -> + logical_processors_online, + logical_processors_available, + driver_version, ++ nif_version, + emu_args, + ethread_info, + beam_jump_table, +diff --git a/lib/runtime_tools/test/system_information_SUITE_data/information_test_report.dat b/lib/runtime_tools/test/system_information_SUITE_data/information_test_report.dat +index 0900ead..9ded5a1 100644 +--- a/lib/runtime_tools/test/system_information_SUITE_data/information_test_report.dat ++++ b/lib/runtime_tools/test/system_information_SUITE_data/information_test_report.dat +@@ -9720,6 +9720,7 @@ + {logical_processors_online,4}, + {logical_processors_available,4}, + {driver_version,"2.1"}, ++ {nif_version,"1.1"}, + {taints,[]}]}, + {erts_compile_info, + [{ldflags,[]}, diff --git a/otp-0016-Split-off-webtool-dependency-from-tools.patch b/otp-0016-Split-off-webtool-dependency-from-tools.patch new file mode 100644 index 0000000..f2de8ac --- /dev/null +++ b/otp-0016-Split-off-webtool-dependency-from-tools.patch @@ -0,0 +1,40 @@ +From: Peter Lemenkov +Date: Sat, 8 Nov 2014 22:54:57 +0300 +Subject: [PATCH] Split off webtool dependency from tools + +Signed-off-by: Peter Lemenkov + +diff --git a/lib/tools/src/cover_web.erl b/lib/tools/src/cover_web.erl +index 69f2f3b..9085300 100644 +--- a/lib/tools/src/cover_web.erl ++++ b/lib/tools/src/cover_web.erl +@@ -50,14 +50,25 @@ + %%%---------------------------------------------------------------------- + %% Start webtool and webcover from erlang shell + start() -> +- webtool:start(), +- webtool:start_tools([],"app=webcover"), ++ try ++ % Disable automatic dependency picking up ++ erlang:apply(webtool, start, []), ++ erlang:apply(webtool, start_tools, [[],"app=webcover"]) ++ catch ++ error:undef -> error_logger:error_msg("No erlang-webtool found.~nPlease install erlang-webtool package first.~n") ++ end, + ok. + + %% Stop webtool and webcover from erlang shell + stop() -> +- webtool:stop_tools([],"app=webcover"), +- webtool:stop(). ++ try ++ % Disable automatic dependency picking up ++ erlang:apply(webtool, stop_tools, [[],"app=webcover"]), ++ erlang:apply(webtool, stop, []) ++ catch ++ error:undef -> error_logger:error_msg("No erlang-webtool found.~nPlease install erlang-webtool package first.~n") ++ end, ++ ok. + + + diff --git a/otp-0017-lib-inets-src-ftp-ftp.erl-Check-the-filenames-userna.patch b/otp-0017-lib-inets-src-ftp-ftp.erl-Check-the-filenames-userna.patch new file mode 100644 index 0000000..7b7ad77 --- /dev/null +++ b/otp-0017-lib-inets-src-ftp-ftp.erl-Check-the-filenames-userna.patch @@ -0,0 +1,430 @@ +From: Sergei Golovan +Date: Sun, 9 Feb 2014 23:06:25 +0400 +Subject: [PATCH] lib/inets/src/ftp/ftp.erl: Check the filenames, usernames, + passwords etc. for and in them and return error if these + offending chars are found. See + http://erlang.org/pipermail/erlang-bugs/2014-January/003998.html for + details. lib/inets/test/ftp_suite_lib.erl: Added checks for in file + and directory names. + + +diff --git a/lib/inets/src/ftp/ftp.erl b/lib/inets/src/ftp/ftp.erl +index 520db1b..5674599 100644 +--- a/lib/inets/src/ftp/ftp.erl ++++ b/lib/inets/src/ftp/ftp.erl +@@ -192,7 +192,12 @@ do_open(Pid, OpenOptions, TLSOpts) -> + 'ok' | {'error', Reason :: 'euser' | common_reason()}. + + user(Pid, User, Pass) -> +- call(Pid, {user, User, Pass}, atom). ++ case {is_name_sane(User), is_name_sane(Pass)} of ++ {true, true} -> ++ call(Pid, {user, User, Pass}, atom); ++ _ -> ++ {error, euser} ++ end. + + -spec user(Pid :: pid(), + User :: string(), +@@ -201,7 +206,12 @@ user(Pid, User, Pass) -> + 'ok' | {'error', Reason :: 'euser' | common_reason()}. + + user(Pid, User, Pass, Acc) -> +- call(Pid, {user, User, Pass, Acc}, atom). ++ case {is_name_sane(User), is_name_sane(Pass), is_name_sane(Acc)} of ++ {true, true, true} -> ++ call(Pid, {user, User, Pass, Acc}, atom); ++ _ -> ++ {error, euser} ++ end. + + + %%-------------------------------------------------------------------------- +@@ -216,7 +226,12 @@ user(Pid, User, Pass, Acc) -> + 'ok' | {'error', Reason :: 'eacct' | common_reason()}. + + account(Pid, Acc) -> +- call(Pid, {account, Acc}, atom). ++ case is_name_sane(Acc) of ++ true -> ++ call(Pid, {account, Acc}, atom); ++ _ -> ++ {error, eacct} ++ end. + + + %%-------------------------------------------------------------------------- +@@ -262,7 +277,12 @@ lpwd(Pid) -> + 'ok' | {'error', Reason :: restriction_reason() | common_reason()}. + + cd(Pid, Dir) -> +- call(Pid, {cd, Dir}, atom). ++ case is_name_sane(Dir) of ++ true -> ++ call(Pid, {cd, Dir}, atom); ++ _ -> ++ {error, efnamena} ++ end. + + + %%-------------------------------------------------------------------------- +@@ -305,7 +325,12 @@ ls(Pid) -> + {'error', Reason :: restriction_reason() | common_reason()}. + + ls(Pid, Dir) -> +- call(Pid, {dir, long, Dir}, string). ++ case is_name_sane(Dir) of ++ true -> ++ call(Pid, {dir, long, Dir}, string); ++ _ -> ++ {error, efnamena} ++ end. + + + %%-------------------------------------------------------------------------- +@@ -333,7 +358,12 @@ nlist(Pid) -> + {'error', Reason :: restriction_reason() | common_reason()}. + + nlist(Pid, Dir) -> +- call(Pid, {dir, short, Dir}, string). ++ case is_name_sane(Dir) of ++ true -> ++ call(Pid, {dir, short, Dir}, string); ++ _ -> ++ {error, efnamena} ++ end. + + + %%-------------------------------------------------------------------------- +@@ -349,7 +379,12 @@ nlist(Pid, Dir) -> + 'ok' | {'error', Reason :: restriction_reason() | common_reason()}. + + rename(Pid, Old, New) -> +- call(Pid, {rename, Old, New}, string). ++ case {is_name_sane(Old), is_name_sane(New)} of ++ {true, true} -> ++ call(Pid, {rename, Old, New}, string); ++ _ -> ++ {error, efnamena} ++ end. + + + %%-------------------------------------------------------------------------- +@@ -365,7 +400,12 @@ rename(Pid, Old, New) -> + 'ok' | {'error', Reason :: restriction_reason() | common_reason()}. + + delete(Pid, File) -> +- call(Pid, {delete, File}, string). ++ case is_name_sane(File) of ++ true -> ++ call(Pid, {delete, File}, string); ++ _ -> ++ {error, efnamena} ++ end. + + + %%-------------------------------------------------------------------------- +@@ -380,7 +420,12 @@ delete(Pid, File) -> + 'ok' | {'error', Reason :: restriction_reason() | common_reason()}. + + mkdir(Pid, Dir) -> +- call(Pid, {mkdir, Dir}, atom). ++ case is_name_sane(Dir) of ++ true -> ++ call(Pid, {mkdir, Dir}, atom); ++ _ -> ++ {error, efnamena} ++ end. + + + %%-------------------------------------------------------------------------- +@@ -395,7 +440,12 @@ mkdir(Pid, Dir) -> + 'ok' | {'error', Reason :: restriction_reason() | common_reason()}. + + rmdir(Pid, Dir) -> +- call(Pid, {rmdir, Dir}, atom). ++ case is_name_sane(Dir) of ++ true -> ++ call(Pid, {rmdir, Dir}, atom); ++ _ -> ++ {error, efnamena} ++ end. + + + %%-------------------------------------------------------------------------- +@@ -437,7 +487,12 @@ recv(Pid, RemotFileName) -> + 'ok' | {'error', Reason :: term()}. + + recv(Pid, RemotFileName, LocalFileName) -> +- call(Pid, {recv, RemotFileName, LocalFileName}, atom). ++ case is_name_sane(RemotFileName) of ++ true -> ++ call(Pid, {recv, RemotFileName, LocalFileName}, atom); ++ _ -> ++ {error, efnamena} ++ end. + + + %%-------------------------------------------------------------------------- +@@ -456,7 +511,12 @@ recv(Pid, RemotFileName, LocalFileName) -> + {'error', Reason :: restriction_reason() | common_reason()}. + + recv_bin(Pid, RemoteFile) -> +- call(Pid, {recv_bin, RemoteFile}, bin). ++ case is_name_sane(RemoteFile) of ++ true -> ++ call(Pid, {recv_bin, RemoteFile}, bin); ++ _ -> ++ {error, efnamena} ++ end. + + + %%-------------------------------------------------------------------------- +@@ -473,7 +533,12 @@ recv_bin(Pid, RemoteFile) -> + 'ok' | {'error', Reason :: restriction_reason() | common_reason()}. + + recv_chunk_start(Pid, RemoteFile) -> +- call(Pid, {recv_chunk_start, RemoteFile}, atom). ++ case is_name_sane(RemoteFile) of ++ true -> ++ call(Pid, {recv_chunk_start, RemoteFile}, atom); ++ _ -> ++ {error, efnamena} ++ end. + + + %%-------------------------------------------------------------------------- +@@ -521,7 +586,12 @@ send(Pid, LocalFileName) -> + shortage_reason()}. + + send(Pid, LocalFileName, RemotFileName) -> +- call(Pid, {send, LocalFileName, RemotFileName}, atom). ++ case is_name_sane(RemotFileName) of ++ true -> ++ call(Pid, {send, LocalFileName, RemotFileName}, atom); ++ _ -> ++ {error, efnamena} ++ end. + + + %%-------------------------------------------------------------------------- +@@ -541,7 +611,12 @@ send(Pid, LocalFileName, RemotFileName) -> + shortage_reason()}. + + send_bin(Pid, Bin, RemoteFile) when is_binary(Bin) -> +- call(Pid, {send_bin, Bin, RemoteFile}, atom); ++ case is_name_sane(RemoteFile) of ++ true -> ++ call(Pid, {send_bin, Bin, RemoteFile}, atom); ++ _ -> ++ {error, efnamena} ++ end; + send_bin(_Pid, _Bin, _RemoteFile) -> + {error, enotbinary}. + +@@ -559,7 +634,12 @@ send_bin(_Pid, _Bin, _RemoteFile) -> + 'ok' | {'error', Reason :: restriction_reason() | common_reason()}. + + send_chunk_start(Pid, RemoteFile) -> +- call(Pid, {send_chunk_start, RemoteFile}, atom). ++ case is_name_sane(RemoteFile) of ++ true -> ++ call(Pid, {send_chunk_start, RemoteFile}, atom); ++ _ -> ++ {error, efnamena} ++ end. + + + %%-------------------------------------------------------------------------- +@@ -575,7 +655,12 @@ send_chunk_start(Pid, RemoteFile) -> + 'ok' | {'error', Reason :: term()}. + + append_chunk_start(Pid, RemoteFile) -> +- call(Pid, {append_chunk_start, RemoteFile}, atom). ++ case is_name_sane(RemoteFile) of ++ true -> ++ call(Pid, {append_chunk_start, RemoteFile}, atom); ++ _ -> ++ {error, efnamena} ++ end. + + + %%-------------------------------------------------------------------------- +@@ -683,7 +768,12 @@ append(Pid, LocalFileName) -> + 'ok' | {'error', Reason :: term()}. + + append(Pid, LocalFileName, RemotFileName) -> +- call(Pid, {append, LocalFileName, RemotFileName}, atom). ++ case is_name_sane(RemotFileName) of ++ true -> ++ call(Pid, {append, LocalFileName, RemotFileName}, atom); ++ _ -> ++ {error, efnamena} ++ end. + + + %%-------------------------------------------------------------------------- +@@ -705,7 +795,12 @@ append(Pid, LocalFileName, RemotFileName) -> + shortage_reason()}. + + append_bin(Pid, Bin, RemoteFile) when is_binary(Bin) -> +- call(Pid, {append_bin, Bin, RemoteFile}, atom); ++ case is_name_sane(RemoteFile) of ++ true -> ++ call(Pid, {append_bin, Bin, RemoteFile}, atom); ++ _ -> ++ {error, efnamena} ++ end; + append_bin(_Pid, _Bin, _RemoteFile) -> + {error, enotbinary}. + +@@ -2302,6 +2397,15 @@ send_bin(State, Bin) -> + mk_cmd(Fmt, Args) -> + [io_lib:format(Fmt, Args)| [?CR, ?LF]]. % Deep list ok. + ++is_name_sane([]) -> ++ true; ++is_name_sane([?CR| _]) -> ++ false; ++is_name_sane([?LF| _]) -> ++ false; ++is_name_sane([_| Rest]) -> ++ is_name_sane(Rest). ++ + pwd_result(Lines) -> + {_, [?DOUBLE_QUOTE | Rest]} = + lists:splitwith(fun(?DOUBLE_QUOTE) -> false; (_) -> true end, Lines), +diff --git a/lib/inets/test/ftp_suite_lib.erl b/lib/inets/test/ftp_suite_lib.erl +index 35f21cc..daee1bd 100644 +--- a/lib/inets/test/ftp_suite_lib.erl ++++ b/lib/inets/test/ftp_suite_lib.erl +@@ -1266,6 +1266,8 @@ read_log_6035([]) -> + %%-------------------------------------------------------------------- + do_user(Pid) -> + {error, euser} = ftp:user(Pid, ?BAD_USER, ?FTP_PASS), ++ {error, euser} = ftp:user(Pid, ?FTP_USER++"\r\nPASS "++?FTP_PASS, ?FTP_PASS), ++ {error, euser} = ftp:user(Pid, ?FTP_USER, ?FTP_PASS++"\r\nCWD ."), + ok = ftp:user(Pid, ?FTP_USER, ?FTP_PASS), + ok. + +@@ -1278,6 +1280,7 @@ do_pwd(Pid) -> + do_cd(Pid) -> + ok = ftp:cd(Pid, "/pub"), + {error, epath} = ftp:cd(Pid, ?BAD_DIR), ++ {error, efnamena} = ftp:cd(Pid, "/pub\r\nCWD ."), + ok. + + do_lcd(Pid, Dir) -> +@@ -1294,11 +1297,14 @@ do_ls(Pid) -> + %% directory, but can also be a filename or a group + %% of files (including wildcards). + {ok, _} = ftp:ls(Pid, "incom*"), ++ %% but \r\n can't be in the wildcard ++ {error, efnamena} = ftp:ls(Pid, "incoming\r\nCWD ."), + ok. + + do_nlist(Pid, WildcardSupport) -> + {ok, _} = ftp:nlist(Pid), + {ok, _} = ftp:nlist(Pid, "incoming"), ++ {error, efnamena} = ftp:ls(Pid, "incoming\r\nCWD ."), + %% neither nlist nor ls operates on a directory + %% they operate on a pathname, which *can* be a + %% directory, but can also be a filename or a group +@@ -1324,6 +1330,8 @@ do_rename(Pid, Config) -> + ftp:delete(Pid, NewLFile), % reset + ok = ftp:send(Pid, LFile), + {error, epath} = ftp:rename(Pid, NewLFile, LFile), ++ {error, efnamena} = ftp:rename(Pid, NewLFile++"\r\nRNTO "++LFile++"\r\nRNFR "++NewLFile, LFile), ++ {error, efnamena} = ftp:rename(Pid, NewLFile, LFile++"\r\nCWD ."), + ok = ftp:rename(Pid, LFile, NewLFile), + ftp:delete(Pid, LFile), % cleanup + ftp:delete(Pid, NewLFile), % cleanup +@@ -1338,6 +1346,7 @@ do_delete(Pid, Config) -> + ok = ftp:cd(Pid, "incoming"), + ok = ftp:lcd(Pid, PrivDir), + ftp:delete(Pid,LFile), % reset ++ {error, efnamena} = ftp:delete(Pid,LFile++"\r\nCWD ."), + ok = ftp:send(Pid, LFile), + ok = ftp:delete(Pid,LFile), + ok. +@@ -1348,6 +1357,8 @@ do_mkdir(Pid) -> + integer_to_list(B) ++ "_" ++ integer_to_list(C), + ok = ftp:cd(Pid, "incoming"), + {ok, CurrDir} = ftp:pwd(Pid), ++ {error, efnamena} = ftp:mkdir(Pid, NewDir++"\r\nCWD ."), ++ {error, efnamena} = ftp:rmdir(Pid, NewDir++"\r\nCWD ."), + ok = ftp:mkdir(Pid, NewDir), + ok = ftp:cd(Pid, NewDir), + ok = ftp:cd(Pid, CurrDir), +@@ -1363,6 +1374,7 @@ do_send(Pid, Config) -> + ok = file:write_file(AbsLFile, list_to_binary(Contents)), + ok = ftp:cd(Pid, "incoming"), + ok = ftp:lcd(Pid, PrivDir), ++ {error, efnamena} = ftp:send(Pid, LFile, RFile++"1\r\nCWD ."), + ok = ftp:send(Pid, LFile, RFile), + {ok, RFilesString} = ftp:nlist(Pid), + RFiles = split(RFilesString), +@@ -1392,6 +1404,7 @@ do_append(Pid, Config) -> + ftp:delete(Pid, RFile), + ftp:delete(Pid, LFile), + ++ {error, efnamena} = ftp:append(Pid, LFile, RFile++"1\r\nCWD ."), + ok = ftp:append(Pid, LFile, RFile), + ok = ftp:append(Pid, LFile, RFile), + ok = ftp:append(Pid, LFile), +@@ -1413,6 +1426,7 @@ do_send_bin(Pid, Config) -> + Bin = list_to_binary(Contents), + ok = ftp:cd(Pid, "incoming"), + {error, enotbinary} = ftp:send_bin(Pid, Contents, File), ++ {error, efnamena} = ftp:send_bin(Pid, Bin, File++"1\r\nCWD ."), + ok = ftp:send_bin(Pid, Bin, File), + {ok, RFilesString} = ftp:nlist(Pid), + RFiles = split(RFilesString), +@@ -1426,6 +1440,7 @@ do_append_bin(Pid, Config) -> + Bin = list_to_binary(Contents), + ok = ftp:cd(Pid, "incoming"), + {error, enotbinary} = ftp:append_bin(Pid, Contents, File), ++ {error, efnamena} = ftp:append_bin(Pid, Bin, File++"1\r\nCWD ."), + ok = ftp:append_bin(Pid, Bin, File), + ok = ftp:append_bin(Pid, Bin, File), + %% Control the contents of the file +@@ -1438,6 +1453,7 @@ do_send_chunk(Pid, Config) -> + Contents = "ftp_SUITE test ...", + Bin = list_to_binary(Contents), + ok = ftp:cd(Pid, "incoming"), ++ {error, efnamena} = ftp:send_chunk_start(Pid, File++"1\r\nCWD ."), + ok = ftp:send_chunk_start(Pid, File), + {error, echunk} = ftp:cd(Pid, "incoming"), + {error, enotbinary} = ftp:send_chunk(Pid, Contents), +@@ -1454,6 +1470,7 @@ do_append_chunk(Pid, Config) -> + File = ?config(file, Config), + Contents = ["ER","LE","RL"], + ok = ftp:cd(Pid, "incoming"), ++ {error, efnamena} = ftp:append_chunk_start(Pid, File++"1\r\nCWD ."), + ok = ftp:append_chunk_start(Pid, File), + {error, enotbinary} = ftp:append_chunk(Pid, lists:nth(1,Contents)), + ok = ftp:append_chunk(Pid,list_to_binary(lists:nth(1,Contents))), +@@ -1480,6 +1497,7 @@ do_recv(Pid, Config) -> + ok = file:delete(AbsFile), % cleanup + test_server:sleep(100), + ok = ftp:lcd(Pid, PrivDir), ++ {error, efnamena} = ftp:recv(Pid, File++"\r\nCWD ."), + ok = ftp:recv(Pid, File), + {ok, Files} = file:list_dir(PrivDir), + true = lists:member(File, Files), +@@ -1495,6 +1513,7 @@ do_recv_bin(Pid, Config) -> + ok = ftp:cd(Pid, "incoming"), + ok = ftp:send_bin(Pid, Bin1, File), + test_server:sleep(100), ++ {error, efnamena} = ftp:recv_bin(Pid, File++"\r\nCWD ."), + {ok, Bin2} = ftp:recv_bin(Pid, File), + ok = ftp:delete(Pid, File), % cleanup + Contents2 = binary_to_list(Bin2), +@@ -1520,6 +1539,7 @@ do_recv_chunk(Pid, Config) -> + ok = ftp:send_bin(Pid, Bin1, File), + test_server:sleep(100), + {error, "ftp:recv_chunk_start/2 not called"} = recv_chunk(Pid, <<>>), ++ {error, efnamena} = ftp:recv_chunk_start(Pid, File++"\r\nCWD ."), + ok = ftp:recv_chunk_start(Pid, File), + {ok, Contents2} = recv_chunk(Pid, <<>>), + ok = ftp:delete(Pid, File), % cleanup diff --git a/otp-0018-Introduce-os-getenv-2.patch b/otp-0018-Introduce-os-getenv-2.patch new file mode 100644 index 0000000..7ee1429 --- /dev/null +++ b/otp-0018-Introduce-os-getenv-2.patch @@ -0,0 +1,63 @@ +From: Peter Lemenkov +Date: Sat, 8 Nov 2014 15:11:04 +0300 +Subject: [PATCH] Introduce os:getenv/2 + +Signed-off-by: Peter Lemenkov + +diff --git a/lib/kernel/doc/src/os.xml b/lib/kernel/doc/src/os.xml +index 9122267..7ec1f8e 100644 +--- a/lib/kernel/doc/src/os.xml ++++ b/lib/kernel/doc/src/os.xml +@@ -100,6 +100,19 @@ DirOut = os:cmd("dir"), % on Win32 platform + + + ++ ++ Get the value of an environment variable ++ ++

Returns the Value of the environment variable ++ VarName, or DefaultValue if the environment variable ++ is undefined.

++

If Unicode file name encoding is in effect (see the erl manual ++ page), the strings (both VarName and ++ Value) may contain characters with codepoints > 255.

++
++
++ + + Return the process identifier of the emulator process + +diff --git a/lib/kernel/src/os.erl b/lib/kernel/src/os.erl +index 9415593..d5ef994 100644 +--- a/lib/kernel/src/os.erl ++++ b/lib/kernel/src/os.erl +@@ -26,7 +26,7 @@ + + %%% BIFs + +--export([getenv/0, getenv/1, getpid/0, putenv/2, timestamp/0, unsetenv/1]). ++-export([getenv/0, getenv/1, getenv/2, getpid/0, putenv/2, timestamp/0, unsetenv/1]). + + -spec getenv() -> [string()]. + +@@ -39,6 +39,19 @@ getenv() -> erlang:nif_error(undef). + getenv(_) -> + erlang:nif_error(undef). + ++-spec getenv(VarName, DefaultValue) -> Value when ++ VarName :: string(), ++ DefaultValue :: string(), ++ Value :: string(). ++ ++getenv(VarName, DefaultValue) -> ++ case os:getenv(VarName) of ++ false -> ++ DefaultValue; ++ Value -> ++ Value ++ end. ++ + -spec getpid() -> Value when + Value :: string(). + diff --git a/otp-0019-Patch-removes-support-for-SSLv3-protocol-because-it-.patch b/otp-0019-Patch-removes-support-for-SSLv3-protocol-because-it-.patch new file mode 100644 index 0000000..359c011 --- /dev/null +++ b/otp-0019-Patch-removes-support-for-SSLv3-protocol-because-it-.patch @@ -0,0 +1,99 @@ +From: Sergei Golovan +Date: Sun, 30 Nov 2014 20:20:41 +0300 +Subject: [PATCH] Patch removes support for SSLv3 protocol because it is proved + to be insecure and nobody should use it anymore. + + +diff --git a/lib/ssl/doc/src/ssl.xml b/lib/ssl/doc/src/ssl.xml +index 1d74faf..912acc2 100644 +--- a/lib/ssl/doc/src/ssl.xml ++++ b/lib/ssl/doc/src/ssl.xml +@@ -123,7 +123,7 @@ + +

sslsocket() - opaque to the user.

+ +-

protocol() = sslv3 | tlsv1 | 'tlsv1.1' | 'tlsv1.2'

++

protocol() = tlsv1 | 'tlsv1.1' | 'tlsv1.2'

+ +

ciphers() = [ciphersuite()] | string() (according to old API)

+ +diff --git a/lib/ssl/doc/src/ssl_app.xml b/lib/ssl/doc/src/ssl_app.xml +index 0ee5b23..c65f8a3 100644 +--- a/lib/ssl/doc/src/ssl_app.xml ++++ b/lib/ssl/doc/src/ssl_app.xml +@@ -47,10 +47,10 @@ +

+

Note that the environment parameters can be set on the command line, + for instance,

+-

erl ... -ssl protocol_version '[sslv3, tlsv1]' .... ++

erl ... -ssl protocol_version '[tlsv1.1, tlsv1]' .... +

+ +- ]]>. ++ ]]>. + +

Protocol that will be supported by started clients and + servers. If this option is not set it will default to all +@@ -58,6 +58,9 @@ + Note that this option may be overridden by the version option + to ssl:connect/[2,3] and ssl:listen/2. +

++

For Debian GNU/Linux distribution the sslv3 protocol was ++ disabled due to its security issues. ++

+
+ + ]]> +diff --git a/lib/ssl/src/ssl_internal.hrl b/lib/ssl/src/ssl_internal.hrl +index 0186f9f..6f84830 100644 +--- a/lib/ssl/src/ssl_internal.hrl ++++ b/lib/ssl/src/ssl_internal.hrl +@@ -67,8 +67,8 @@ + -define(TRUE, 0). + -define(FALSE, 1). + +--define(ALL_SUPPORTED_VERSIONS, ['tlsv1.2', 'tlsv1.1', tlsv1, sslv3]). +--define(MIN_SUPPORTED_VERSIONS, ['tlsv1.1', tlsv1, sslv3]). ++-define(ALL_SUPPORTED_VERSIONS, ['tlsv1.2', 'tlsv1.1', tlsv1]). ++-define(MIN_SUPPORTED_VERSIONS, ['tlsv1.1', tlsv1]). + -define(ALL_DATAGRAM_SUPPORTED_VERSIONS, ['dtlsv1.2', dtlsv1]). + -define(MIN_DATAGRAM_SUPPORTED_VERSIONS, ['dtlsv1.2', dtlsv1]). + +diff --git a/lib/ssl/src/ssl_record.hrl b/lib/ssl/src/ssl_record.hrl +index c17fa53..f4be9be 100644 +--- a/lib/ssl/src/ssl_record.hrl ++++ b/lib/ssl/src/ssl_record.hrl +@@ -144,6 +144,7 @@ + %% }). + + -define(LOWEST_MAJOR_SUPPORTED_VERSION, 3). ++-define(LOWEST_MINOR_SUPPORTED_VERSION, 1). + + + -record(generic_stream_cipher, { +diff --git a/lib/ssl/src/tls_record.erl b/lib/ssl/src/tls_record.erl +index 8810755..3c5c7e9 100644 +--- a/lib/ssl/src/tls_record.erl ++++ b/lib/ssl/src/tls_record.erl +@@ -269,13 +269,19 @@ supported_protocol_versions([_|_] = Vsns) -> + %% + %%-------------------------------------------------------------------- + is_acceptable_version({N,_}) +- when N >= ?LOWEST_MAJOR_SUPPORTED_VERSION -> ++ when N > ?LOWEST_MAJOR_SUPPORTED_VERSION -> ++ true; ++is_acceptable_version({N,M}) ++ when N == ?LOWEST_MAJOR_SUPPORTED_VERSION andalso M >= ?LOWEST_MINOR_SUPPORTED_VERSION -> + true; + is_acceptable_version(_) -> + false. + + is_acceptable_version({N,_} = Version, Versions) +- when N >= ?LOWEST_MAJOR_SUPPORTED_VERSION -> ++ when N > ?LOWEST_MAJOR_SUPPORTED_VERSION -> ++ lists:member(Version, Versions); ++is_acceptable_version({N,M} = Version, Versions) ++ when N == ?LOWEST_MAJOR_SUPPORTED_VERSION andalso M >= ?LOWEST_MINOR_SUPPORTED_VERSION -> + lists:member(Version, Versions); + is_acceptable_version(_,_) -> + false. diff --git a/sources b/sources index df29746..aa69160 100644 --- a/sources +++ b/sources @@ -1,4 +1 @@ -d27250e9ee98d6388e7f2e65379a0406 otp_src_R16B03-1.readme -eff44490c9bbae3a5c5741bec2390ba3 otp_doc_html_R16B03-1.tar.gz -39113c0d2515bdd8cd7e0f975a380122 otp_doc_man_R16B03-1.tar.gz e5ece977375197338c1b93b3d88514f8 otp_src_R16B03-1.tar.gz