Related: #2013578 (Add patch to build against samba 4.15)

This commit is contained in:
Milan Crha 2021-12-01 12:36:20 +01:00
parent 80b8596bc7
commit 087684ac78
3 changed files with 133 additions and 4 deletions

View File

@ -0,0 +1,12 @@
diff -up openchange-openchange-2.3-VULCAN/configure.ac.disable-server-reqs openchange-openchange-2.3-VULCAN/configure.ac
--- openchange-openchange-2.3-VULCAN/configure.ac.disable-server-reqs 2021-06-17 21:40:49.938611315 +0200
+++ openchange-openchange-2.3-VULCAN/configure.ac 2021-06-17 21:41:18.616614841 +0200
@@ -436,7 +436,7 @@ dnl AC_SUBST(MYSQL_LIBS)
dnl ----------------------------------------------------------------------------
dnl Check for memcached
dnl ----------------------------------------------------------------------------
-PKG_CHECK_MODULES([MEMCACHED], [libmemcached >= 1.0.18], [], [AC_MSG_ERROR(memcached >= 1.0.18 required to build mapistore library)])
+dnl PKG_CHECK_MODULES([MEMCACHED], [libmemcached >= 1.0.18], [], [AC_MSG_ERROR(memcached >= 1.0.18 required to build mapistore library)])
dnl ----------------------------------------------------------------------------
dnl Check for Flex

View File

@ -0,0 +1,103 @@
diff -up openchange-openchange-2.3-VULCAN/libmapi/IProfAdmin.c.samba-4.15 openchange-openchange-2.3-VULCAN/libmapi/IProfAdmin.c
--- openchange-openchange-2.3-VULCAN/libmapi/IProfAdmin.c.samba-4.15 2021-07-19 12:26:37.615770488 +0200
+++ openchange-openchange-2.3-VULCAN/libmapi/IProfAdmin.c 2021-07-19 12:26:39.640771957 +0200
@@ -794,7 +794,7 @@ _PUBLIC_ enum MAPISTATUS LoadProfile(str
cli_credentials_set_password(profile->credentials, profile->password, CRED_SPECIFIED);
}
if (use_krb != CRED_USE_KERBEROS_DESIRED) {
- cli_credentials_set_kerberos_state(profile->credentials, use_krb);
+ cli_credentials_set_kerberos_state(profile->credentials, use_krb, CRED_SPECIFIED);
}
return MAPI_E_SUCCESS;
diff -up openchange-openchange-2.3-VULCAN/ndr_mapi.c.samba-4.15 openchange-openchange-2.3-VULCAN/ndr_mapi.c
--- openchange-openchange-2.3-VULCAN/ndr_mapi.c.samba-4.15 2021-07-19 12:59:29.801210983 +0200
+++ openchange-openchange-2.3-VULCAN/ndr_mapi.c 2021-07-19 13:07:49.382594567 +0200
@@ -1235,15 +1235,18 @@ _PUBLIC_ enum ndr_err_code ndr_pull_EcDo
TALLOC_CTX *_mem_save_rgbAuxOut_1;
if (flags & NDR_IN) {
+ uint32_t array_length = 0, array_size = 0;
OC_ZERO_STRUCT(r->out);
NDR_CHECK(ndr_pull_array_size(ndr, &r->in.szUserDN));
NDR_CHECK(ndr_pull_array_length(ndr, &r->in.szUserDN));
- if (ndr_get_array_length(ndr, &r->in.szUserDN) > ndr_get_array_size(ndr, &r->in.szUserDN)) {
- return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.szUserDN), ndr_get_array_length(ndr, &r->in.szUserDN));
+ NDR_CHECK(ndr_get_array_length(ndr, &r->in.szUserDN, &array_length));
+ NDR_CHECK(ndr_get_array_size(ndr, &r->in.szUserDN, &array_size));
+ if (array_length > array_size) {
+ return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", array_size, array_length);
}
- NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.szUserDN), sizeof(uint8_t)));
- NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.szUserDN, ndr_get_array_length(ndr, &r->in.szUserDN), sizeof(uint8_t), CH_DOS));
+ NDR_CHECK(ndr_check_string_terminator(ndr, array_length, sizeof(uint8_t)));
+ NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.szUserDN, array_length, sizeof(uint8_t), CH_DOS));
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.ulFlags));
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.ulConMod));
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.cbLimit));
@@ -1317,6 +1320,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_EcDo
}
if (flags & NDR_OUT) {
+ uint32_t array_length = 0, array_size = 0;
if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->out.handle);
}
@@ -1366,11 +1370,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull_EcDo
NDR_PULL_SET_MEM_CTX(ndr, *r->out.szDNPrefix, 0);
NDR_CHECK(ndr_pull_array_size(ndr, r->out.szDNPrefix));
NDR_CHECK(ndr_pull_array_length(ndr, r->out.szDNPrefix));
- if (ndr_get_array_length(ndr, r->out.szDNPrefix) > ndr_get_array_size(ndr, r->out.szDNPrefix)) {
- return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.szDNPrefix), ndr_get_array_length(ndr, r->out.szDNPrefix));
+ NDR_CHECK(ndr_get_array_length(ndr, r->out.szDNPrefix, &array_length));
+ NDR_CHECK(ndr_get_array_size(ndr, r->out.szDNPrefix, &array_size));
+ if (array_length > array_size) {
+ return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", array_size, array_length);
}
- NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.szDNPrefix), sizeof(uint8_t)));
- NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.szDNPrefix, ndr_get_array_length(ndr, r->out.szDNPrefix), sizeof(uint8_t), CH_DOS));
+ NDR_CHECK(ndr_check_string_terminator(ndr, array_length, sizeof(uint8_t)));
+ NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.szDNPrefix, array_length, sizeof(uint8_t), CH_DOS));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_szDNPrefix_1, 0);
}
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_szDNPrefix_0, LIBNDR_FLAG_REF_ALLOC);
@@ -1391,11 +1397,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull_EcDo
NDR_PULL_SET_MEM_CTX(ndr, *r->out.szDisplayName, 0);
NDR_CHECK(ndr_pull_array_size(ndr, r->out.szDisplayName));
NDR_CHECK(ndr_pull_array_length(ndr, r->out.szDisplayName));
- if (ndr_get_array_length(ndr, r->out.szDisplayName) > ndr_get_array_size(ndr, r->out.szDisplayName)) {
- return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.szDisplayName), ndr_get_array_length(ndr, r->out.szDisplayName));
+ NDR_CHECK(ndr_get_array_length(ndr, r->out.szDisplayName, &array_length));
+ NDR_CHECK(ndr_get_array_size(ndr, r->out.szDisplayName, &array_size));
+ if (array_length > array_size) {
+ return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", array_size, array_length);
}
- NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.szDisplayName), sizeof(uint8_t)));
- NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.szDisplayName, ndr_get_array_length(ndr, r->out.szDisplayName), sizeof(uint8_t), CH_DOS));
+ NDR_CHECK(ndr_check_string_terminator(ndr, array_length, sizeof(uint8_t)));
+ NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.szDisplayName, array_length, sizeof(uint8_t), CH_DOS));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_szDisplayName_1, 0);
}
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_szDisplayName_0, LIBNDR_FLAG_REF_ALLOC);
@@ -1415,14 +1423,16 @@ _PUBLIC_ enum ndr_err_code ndr_pull_EcDo
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pulTimeStamp_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_array_size(ndr, &r->out.rgbAuxOut));
NDR_CHECK(ndr_pull_array_length(ndr, &r->out.rgbAuxOut));
- if (ndr_get_array_length(ndr, &r->out.rgbAuxOut) > ndr_get_array_size(ndr, &r->out.rgbAuxOut)) {
- return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->out.rgbAuxOut), ndr_get_array_length(ndr, &r->out.rgbAuxOut));
+ NDR_CHECK(ndr_get_array_length(ndr, &r->out.rgbAuxOut, &array_length));
+ NDR_CHECK(ndr_get_array_size(ndr, &r->out.rgbAuxOut, &array_size));
+ if (array_length > array_size) {
+ return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", array_size, array_length);
}
if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
- NDR_PULL_ALLOC_N(ndr, r->out.rgbAuxOut, ndr_get_array_size(ndr, &r->out.rgbAuxOut));
+ NDR_PULL_ALLOC_N(ndr, r->out.rgbAuxOut, array_size);
}
/* Only try to pull rgbAuxOut if the fake array size is > 0 */
- if (ndr_get_array_size(ndr, &r->out.rgbAuxOut)) {
+ if (array_size) {
_mem_save_rgbAuxOut_1 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->out.rgbAuxOut, 0);
NDR_CHECK(ndr_pull_mapi2k7_AuxInfo(ndr, NDR_SCALARS, r->out.rgbAuxOut));

View File

@ -23,7 +23,7 @@
Name: openchange
Version: 2.3
Release: 37%{?dist}
Release: 38%{?dist}
Summary: Provides access to Microsoft Exchange servers using native protocols
License: GPLv3+ and Public Domain
URL: http://www.openchange.org/
@ -43,7 +43,6 @@ BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: libical-devel
BuildRequires: libldb-devel
BuildRequires: libmemcached-devel
BuildRequires: libtalloc-devel >= %{talloc_version}
BuildRequires: libtdb-devel
BuildRequires: pkgconfig
@ -56,9 +55,13 @@ BuildRequires: samba-common >= %{samba_version}
BuildRequires: samba-devel >= %{samba_version}
BuildRequires: samba-libs >= %{samba_version}
BuildRequires: samba-pidl >= %{samba_version}
BuildRequires: sqlite-devel
BuildRequires: zlib-devel
%if %{build_server_package}
BuildRequires: libmemcached-devel
BuildRequires: sqlite-devel
%endif
# Certain versions of libtevent have incorrect
# internal ABI versions
Conflicts: libtevent < 0.9.13
@ -94,7 +97,10 @@ Patch15: openchange-2.3-samba-4.10-macros.patch
Patch16: openchange-2.3-samba-4.11.patch
Patch17: openchange-2.3-samba-4.12.patch
Patch18: openchange-2.3-samba-4.13.patch
%if !%{build_server_package}
Patch19: openchange-2.3-disable-server-reqs.patch
%endif
Patch20: openchange-2.3-samba-4.15.patch
%description
OpenChange provides libraries to access Microsoft Exchange servers
using native protocols.
@ -169,6 +175,10 @@ This package provides the server elements for OpenChange.
%patch16 -p1 -b .samba-4.11
%patch17 -p1 -b .samba-4.12
%patch18 -p1 -b .samba-4.13
%if !%{build_server_package}
%patch19 -p1 -b .disable-server-reqs
%endif
%patch20 -p1 -b .samba-4.15
%build
./autogen.sh
@ -313,6 +323,10 @@ cp -r apidocs/html/libmapi++/* $RPM_BUILD_ROOT%{_datadir}/devhelp/books/openchan
%endif
%changelog
* Wed Dec 01 2021 Milan Crha <mcrha@redhat.com> - 2.3-38
- Related: #2013578 (Add patch to build against samba 4.15)
- Avoid build time dependencies related to server, when it's not built
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 2.3-37
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688