openldap-2.4.44-consolidated-2.patch 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. Submitted by: Bruce Dubbs <bdubbs at linuxfromscratch.org>
  2. Date: 2012-03-26
  3. Initial Package Version: 2.4.40
  4. Upstream Status: BLFS Specific
  5. Origin: Armin K. <krejzi at email dot com> and Debian
  6. Comment: Rediffed by Fernando de Oliveira <famobr at yahoo dot
  7. com dot br> for version 2.4.44 - 2016.02.06
  8. Rediffed by Pierre Labastie <pierre dot labastie at
  9. neuf dot fr> to add mdb backend and slapd.ldif. See
  10. ticket #7394 - 2016.02.24
  11. Description: Consolidate earlier patches to:
  12. 1. Update various installation options, such as ldap database path,
  13. configuration file options, slapd install location, etc.
  14. 2. Remove reference to bdb module
  15. 3. Enables symbol versioning in ldap libraries. Without these changes
  16. some applications might generate a warning about missing symbol versions.
  17. diff -Naur openldap-2.4.40.orig/build/openldap.m4 openldap-2.4.40/build/openldap.m4
  18. --- openldap-2.4.40.orig/build/openldap.m4 2014-09-18 20:48:49.000000000 -0500
  19. +++ openldap-2.4.40/build/openldap.m4 2015-03-26 15:37:39.801077750 -0500
  20. @@ -1142,3 +1142,54 @@
  21. #endif
  22. ], [ol_cv_ssl_crl_compat=yes], [ol_cv_ssl_crl_compat=no])])
  23. ])
  24. +
  25. +dnl ====================================================================
  26. +dnl check for symbol versioning support
  27. +AC_DEFUN([OL_SYMBOL_VERSIONING],
  28. +[AC_CACHE_CHECK([for .symver assembler directive],
  29. + [ol_cv_asm_symver_directive],[
  30. +cat > conftest.s <<EOF
  31. +${libc_cv_dot_text}
  32. +_sym:
  33. +.symver _sym,sym@VERS
  34. +EOF
  35. +if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
  36. + ol_cv_asm_symver_directive=yes
  37. +else
  38. + ol_cv_asm_symver_directive=no
  39. +fi
  40. +rm -f conftest*])
  41. +AC_CACHE_CHECK([for ld --version-script],
  42. + [ol_cv_ld_version_script_option],[
  43. +if test $ol_cv_asm_symver_directive = yes; then
  44. + cat > conftest.s <<EOF
  45. +${libc_cv_dot_text}
  46. +_sym:
  47. +.symver _sym,sym@VERS
  48. +EOF
  49. + cat > conftest.map <<EOF
  50. +VERS_1 {
  51. + global: sym;
  52. +};
  53. +
  54. +VERS_2 {
  55. + global: sym;
  56. +} VERS_1;
  57. +EOF
  58. + if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
  59. + if AC_TRY_COMMAND([${CC-cc} $CFLAGS $LDFLAGS -shared
  60. + -o conftest.so conftest.o
  61. + -Wl,--version-script,conftest.map
  62. + 1>&AS_MESSAGE_LOG_FD]);
  63. + then
  64. + ol_cv_ld_version_script_option=yes
  65. + else
  66. + ol_cv_ld_version_script_option=no
  67. + fi
  68. + else
  69. + ol_cv_ld_version_script_option=no
  70. + fi
  71. +else
  72. + ol_cv_ld_version_script_option=no
  73. +fi
  74. +rm -f conftest*])])
  75. diff -Naur openldap-2.4.40.orig/build/top.mk openldap-2.4.40/build/top.mk
  76. --- openldap-2.4.40.orig/build/top.mk 2014-09-18 20:48:49.000000000 -0500
  77. +++ openldap-2.4.40/build/top.mk 2015-03-26 15:37:39.801077750 -0500
  78. @@ -104,6 +104,9 @@
  79. # LINK_LIBS referenced in library and module link commands.
  80. LINK_LIBS = $(MOD_LIBS) $(@PLAT@_LINK_LIBS)
  81. +# option to pass to $(CC) to support library symbol versioning, if any
  82. +VERSION_OPTION = @VERSION_OPTION@
  83. +
  84. LTSTATIC = @LTSTATIC@
  85. LTLINK = $(LIBTOOL) --mode=link \
  86. @@ -113,7 +116,7 @@
  87. $(CC) $(LT_CFLAGS) $(LT_CPPFLAGS) $(LIB_DEFS) -c
  88. LTLINK_LIB = $(LIBTOOL) $(LTONLY_LIB) --mode=link \
  89. - $(CC) $(LT_CFLAGS) $(LDFLAGS) $(LTFLAGS_LIB)
  90. + $(CC) $(LT_CFLAGS) $(LDFLAGS) $(LTFLAGS_LIB) $(VERSION_FLAGS)
  91. LTCOMPILE_MOD = $(LIBTOOL) $(LTONLY_MOD) --mode=compile \
  92. $(CC) $(LT_CFLAGS) $(LT_CPPFLAGS) $(MOD_DEFS) -c
  93. diff -Naur openldap-2.4.40.orig/configure.in openldap-2.4.40/configure.in
  94. --- openldap-2.4.40.orig/configure.in 2014-09-18 20:48:49.000000000 -0500
  95. +++ openldap-2.4.40/configure.in 2015-03-26 15:37:39.801077750 -0500
  96. @@ -1916,6 +1916,13 @@
  97. fi
  98. AC_SUBST(LTSTATIC)dnl
  99. +VERSION_OPTION=""
  100. +OL_SYMBOL_VERSIONING
  101. +if test $ol_cv_ld_version_script_option = yes ; then
  102. + VERSION_OPTION="-Wl,--version-script="
  103. +fi
  104. +AC_SUBST(VERSION_OPTION)
  105. +
  106. dnl ----------------------------------------------------------------
  107. if test $ol_enable_wrappers != no ; then
  108. AC_CHECK_HEADERS(tcpd.h,[
  109. diff -Naur openldap-2.4.40.orig/doc/man/man5/slapd-bdb.5 openldap-2.4.40/doc/man/man5/slapd-bdb.5
  110. --- openldap-2.4.40.orig/doc/man/man5/slapd-bdb.5 2014-09-18 20:48:49.000000000 -0500
  111. +++ openldap-2.4.40/doc/man/man5/slapd-bdb.5 2015-03-26 15:36:59.637464038 -0500
  112. @@ -135,7 +135,7 @@
  113. associated indexes live.
  114. A separate directory must be specified for each database.
  115. The default is
  116. -.BR LOCALSTATEDIR/openldap\-data .
  117. +.BR LOCALSTATEDIR/lib/openldap .
  118. .TP
  119. .B dirtyread
  120. Allow reads of modified but not yet committed data.
  121. diff -Naur openldap-2.4.40.orig/doc/man/man5/slapd-config.5 openldap-2.4.40/doc/man/man5/slapd-config.5
  122. --- openldap-2.4.40.orig/doc/man/man5/slapd-config.5 2014-09-18 20:48:49.000000000 -0500
  123. +++ openldap-2.4.40/doc/man/man5/slapd-config.5 2015-03-26 15:36:59.638464004 -0500
  124. @@ -2051,7 +2051,7 @@
  125. # The database directory MUST exist prior to
  126. # running slapd AND should only be accessible
  127. # by the slapd/tools. Mode 0700 recommended.
  128. -olcDbDirectory: LOCALSTATEDIR/openldap\-data
  129. +olcDbDirectory: LOCALSTATEDIR/lib/openldap
  130. # Indices to maintain
  131. olcDbIndex: objectClass eq
  132. olcDbIndex: cn,sn,mail pres,eq,approx,sub
  133. diff -Naur openldap-2.4.40.orig/doc/man/man5/slapd.conf.5 openldap-2.4.40/doc/man/man5/slapd.conf.5
  134. --- openldap-2.4.40.orig/doc/man/man5/slapd.conf.5 2014-09-18 20:48:49.000000000 -0500
  135. +++ openldap-2.4.40/doc/man/man5/slapd.conf.5 2015-03-26 15:36:59.638464004 -0500
  136. @@ -2021,7 +2021,7 @@
  137. # The database directory MUST exist prior to
  138. # running slapd AND should only be accessible
  139. # by the slapd/tools. Mode 0700 recommended.
  140. -directory LOCALSTATEDIR/openldap\-data
  141. +directory LOCALSTATEDIR/lib/openldap
  142. # Indices to maintain
  143. index objectClass eq
  144. index cn,sn,mail pres,eq,approx,sub
  145. diff -Naur openldap-2.4.40.orig/include/ldap_defaults.h openldap-2.4.40/include/ldap_defaults.h
  146. --- openldap-2.4.40.orig/include/ldap_defaults.h 2014-09-18 20:48:49.000000000 -0500
  147. +++ openldap-2.4.40/include/ldap_defaults.h 2015-03-26 15:36:59.638464004 -0500
  148. @@ -39,7 +39,7 @@
  149. #define LDAP_ENV_PREFIX "LDAP"
  150. /* default ldapi:// socket */
  151. -#define LDAPI_SOCK LDAP_RUNDIR LDAP_DIRSEP "run" LDAP_DIRSEP "ldapi"
  152. +#define LDAPI_SOCK LDAP_RUNDIR LDAP_DIRSEP "run" LDAP_DIRSEP "openldap" LDAP_DIRSEP "ldapi"
  153. /*
  154. * SLAPD DEFINITIONS
  155. @@ -47,7 +47,7 @@
  156. /* location of the default slapd config file */
  157. #define SLAPD_DEFAULT_CONFIGFILE LDAP_SYSCONFDIR LDAP_DIRSEP "slapd.conf"
  158. #define SLAPD_DEFAULT_CONFIGDIR LDAP_SYSCONFDIR LDAP_DIRSEP "slapd.d"
  159. -#define SLAPD_DEFAULT_DB_DIR LDAP_RUNDIR LDAP_DIRSEP "openldap-data"
  160. +#define SLAPD_DEFAULT_DB_DIR LDAP_RUNDIR LDAP_DIRSEP "lib" LDAP_DIRSEP "openldap"
  161. #define SLAPD_DEFAULT_DB_MODE 0600
  162. #define SLAPD_DEFAULT_UCDATA LDAP_DATADIR LDAP_DIRSEP "ucdata"
  163. /* default max deref depth for aliases */
  164. diff -Naur openldap-2.4.40.orig/libraries/liblber/Makefile.in openldap-2.4.40/libraries/liblber/Makefile.in
  165. --- openldap-2.4.40.orig/libraries/liblber/Makefile.in 2014-09-18 20:48:49.000000000 -0500
  166. +++ openldap-2.4.40/libraries/liblber/Makefile.in 2015-03-26 15:37:39.801077750 -0500
  167. @@ -38,6 +38,9 @@
  168. XXLIBS =
  169. NT_LINK_LIBS = $(AC_LIBS)
  170. UNIX_LINK_LIBS = $(AC_LIBS)
  171. +ifneq (,$(VERSION_OPTION))
  172. + VERSION_FLAGS = "$(VERSION_OPTION)$(srcdir)/liblber.map"
  173. +endif
  174. dtest: $(XLIBS) dtest.o
  175. $(LTLINK) -o $@ dtest.o $(LIBS)
  176. @@ -48,6 +51,6 @@
  177. install-local: FORCE
  178. -$(MKDIR) $(DESTDIR)$(libdir)
  179. - $(LTINSTALL) $(INSTALLFLAGS) -m 644 $(LIBRARY) $(DESTDIR)$(libdir)
  180. + $(LTINSTALL) $(INSTALLFLAGS) -m 755 $(LIBRARY) $(DESTDIR)$(libdir)
  181. $(LTFINISH) $(DESTDIR)$(libdir)
  182. diff -Naur openldap-2.4.40.orig/libraries/liblber/liblber.map openldap-2.4.40/libraries/liblber/liblber.map
  183. --- openldap-2.4.40.orig/libraries/liblber/liblber.map 1969-12-31 18:00:00.000000000 -0600
  184. +++ openldap-2.4.40/libraries/liblber/liblber.map 2015-03-26 15:37:39.801077750 -0500
  185. @@ -0,0 +1,8 @@
  186. +OPENLDAP_2.4_2 {
  187. + global:
  188. + ber_*;
  189. + der_alloc;
  190. + lutil_*;
  191. + local:
  192. + *;
  193. +};
  194. diff -Naur openldap-2.4.40.orig/libraries/libldap/Makefile.in openldap-2.4.40/libraries/libldap/Makefile.in
  195. --- openldap-2.4.40.orig/libraries/libldap/Makefile.in 2014-09-18 20:48:49.000000000 -0500
  196. +++ openldap-2.4.40/libraries/libldap/Makefile.in 2015-03-26 15:37:39.802077716 -0500
  197. @@ -52,6 +52,9 @@
  198. XXLIBS = $(SECURITY_LIBS) $(LUTIL_LIBS)
  199. NT_LINK_LIBS = $(LDAP_LIBLBER_LA) $(AC_LIBS) $(SECURITY_LIBS)
  200. UNIX_LINK_LIBS = $(LDAP_LIBLBER_LA) $(AC_LIBS) $(SECURITY_LIBS)
  201. +ifneq (,$(VERSION_OPTION))
  202. + VERSION_FLAGS = $(VERSION_OPTION)$(srcdir)/libldap.map
  203. +endif
  204. apitest: $(XLIBS) apitest.o
  205. $(LTLINK) -o $@ apitest.o $(LIBS)
  206. @@ -68,7 +71,7 @@
  207. install-local: $(CFFILES) FORCE
  208. -$(MKDIR) $(DESTDIR)$(libdir)
  209. - $(LTINSTALL) $(INSTALLFLAGS) -m 644 $(LIBRARY) $(DESTDIR)$(libdir)
  210. + $(LTINSTALL) $(INSTALLFLAGS) -m 755 $(LIBRARY) $(DESTDIR)$(libdir)
  211. $(LTFINISH) $(DESTDIR)$(libdir)
  212. -$(MKDIR) $(DESTDIR)$(sysconfdir)
  213. @for i in $(CFFILES); do \
  214. diff -Naur openldap-2.4.40.orig/libraries/libldap/libldap.map openldap-2.4.40/libraries/libldap/libldap.map
  215. --- openldap-2.4.40.orig/libraries/libldap/libldap.map 1969-12-31 18:00:00.000000000 -0600
  216. +++ openldap-2.4.40/libraries/libldap/libldap.map 2015-03-26 15:37:39.802077716 -0500
  217. @@ -0,0 +1,7 @@
  218. +OPENLDAP_2.4_2 {
  219. + global:
  220. + ldap_*;
  221. + ldif_*;
  222. + local:
  223. + *;
  224. +};
  225. diff -Naur openldap-2.4.40.orig/libraries/libldap_r/Makefile.in openldap-2.4.40/libraries/libldap_r/Makefile.in
  226. --- openldap-2.4.40.orig/libraries/libldap_r/Makefile.in 2014-09-18 20:48:49.000000000 -0500
  227. +++ openldap-2.4.40/libraries/libldap_r/Makefile.in 2015-03-26 15:37:39.802077716 -0500
  228. @@ -61,6 +61,9 @@
  229. XXXLIBS = $(LTHREAD_LIBS)
  230. NT_LINK_LIBS = $(LDAP_LIBLBER_LA) $(AC_LIBS) $(SECURITY_LIBS)
  231. UNIX_LINK_LIBS = $(LDAP_LIBLBER_LA) $(AC_LIBS) $(SECURITY_LIBS) $(LTHREAD_LIBS)
  232. +ifneq (,$(VERSION_OPTION))
  233. + VERSION_FLAGS = "$(VERSION_OPTION)$(XXDIR)/libldap.map"
  234. +endif
  235. .links : Makefile
  236. @for i in $(XXSRCS); do \
  237. @@ -83,6 +86,6 @@
  238. install-local: $(CFFILES) FORCE
  239. -$(MKDIR) $(DESTDIR)$(libdir)
  240. - $(LTINSTALL) $(INSTALLFLAGS) -m 644 $(LIBRARY) $(DESTDIR)$(libdir)
  241. + $(LTINSTALL) $(INSTALLFLAGS) -m 755 $(LIBRARY) $(DESTDIR)$(libdir)
  242. $(LTFINISH) $(DESTDIR)$(libdir)
  243. diff -Naur openldap-2.4.40.orig/servers/slapd/Makefile.in openldap-2.4.40/servers/slapd/Makefile.in
  244. --- openldap-2.4.40.orig/servers/slapd/Makefile.in 2014-09-18 20:48:49.000000000 -0500
  245. +++ openldap-2.4.40/servers/slapd/Makefile.in 2015-03-26 15:36:59.639463969 -0500
  246. @@ -376,10 +376,10 @@
  247. install-conf install-dbc-maybe install-schema install-tools
  248. install-slapd: FORCE
  249. - -$(MKDIR) $(DESTDIR)$(libexecdir)
  250. + -$(MKDIR) $(DESTDIR)$(sbindir)
  251. -$(MKDIR) $(DESTDIR)$(localstatedir)/run
  252. $(LTINSTALL) $(INSTALLFLAGS) $(STRIP) -m 755 \
  253. - slapd$(EXEEXT) $(DESTDIR)$(libexecdir)
  254. + slapd$(EXEEXT) $(DESTDIR)$(sbindir)
  255. @for i in $(SUBDIRS); do \
  256. if test -d $$i && test -f $$i/Makefile ; then \
  257. echo; echo " cd $$i; $(MAKE) $(MFLAGS) install"; \
  258. @@ -445,9 +445,9 @@
  259. install-db-config: FORCE
  260. @-$(MKDIR) $(DESTDIR)$(localstatedir) $(DESTDIR)$(sysconfdir)
  261. - @-$(INSTALL) -m 700 -d $(DESTDIR)$(localstatedir)/openldap-data
  262. + @-$(INSTALL) -m 700 -d $(DESTDIR)$(localstatedir)/lib/openldap
  263. $(INSTALL) $(INSTALLFLAGS) -m 600 $(srcdir)/DB_CONFIG \
  264. - $(DESTDIR)$(localstatedir)/openldap-data/DB_CONFIG.example
  265. + $(DESTDIR)$(localstatedir)/lib/openldap/DB_CONFIG.example
  266. $(INSTALL) $(INSTALLFLAGS) -m 600 $(srcdir)/DB_CONFIG \
  267. $(DESTDIR)$(sysconfdir)/DB_CONFIG.example
  268. @@ -455,6 +455,6 @@
  269. -$(MKDIR) $(DESTDIR)$(sbindir)
  270. for i in $(SLAPTOOLS); do \
  271. $(RM) $(DESTDIR)$(sbindir)/$$i$(EXEEXT); \
  272. - $(LN_S) -f $(DESTDIR)$(libexecdir)/slapd$(EXEEXT) $(DESTDIR)$(sbindir)/$$i$(EXEEXT); \
  273. + $(LN_S) -f $(DESTDIR)$(sbindir)/slapd$(EXEEXT) $(DESTDIR)$(sbindir)/$$i$(EXEEXT); \
  274. done
  275. diff -Naur openldap-2.4.44.orig/servers/slapd/slapd.conf openldap-2.4.44/servers/slapd/slapd.conf
  276. --- openldap-2.4.44.orig/servers/slapd/slapd.conf 2016-02-06 00:57:45.000000000 +0100
  277. +++ openldap-2.4.44/servers/slapd/slapd.conf 2016-02-22 23:01:47.681372594 +0100
  278. @@ -10,12 +10,12 @@
  279. # service AND an understanding of referrals.
  280. #referral ldap://root.openldap.org
  281. -pidfile %LOCALSTATEDIR%/run/slapd.pid
  282. -argsfile %LOCALSTATEDIR%/run/slapd.args
  283. +pidfile %LOCALSTATEDIR%/run/openldap/slapd.pid
  284. +argsfile %LOCALSTATEDIR%/run/openldap/slapd.args
  285. # Load dynamic backend modules:
  286. -# modulepath %MODULEDIR%
  287. -# moduleload back_mdb.la
  288. +modulepath %MODULEDIR%
  289. +moduleload back_mdb.la
  290. # moduleload back_ldap.la
  291. # Sample security restrictions
  292. @@ -60,6 +60,6 @@
  293. # The database directory MUST exist prior to running slapd AND
  294. # should only be accessible by the slapd and slap tools.
  295. # Mode 700 recommended.
  296. -directory %LOCALSTATEDIR%/openldap-data
  297. +directory %LOCALSTATEDIR%/lib/openldap
  298. # Indices to maintain
  299. index objectClass eq
  300. diff -Naur openldap-2.4.44.orig/servers/slapd/slapd.ldif openldap-2.4.44/servers/slapd/slapd.ldif
  301. --- openldap-2.4.44.orig/servers/slapd/slapd.ldif 2016-02-06 00:57:45.000000000 +0100
  302. +++ openldap-2.4.44/servers/slapd/slapd.ldif 2016-02-22 22:59:57.824364446 +0100
  303. @@ -9,8 +9,8 @@
  304. #
  305. # Define global ACLs to disable default read access.
  306. #
  307. -olcArgsFile: %LOCALSTATEDIR%/run/slapd.args
  308. -olcPidFile: %LOCALSTATEDIR%/run/slapd.pid
  309. +olcArgsFile: %LOCALSTATEDIR%/run/openldap/slapd.args
  310. +olcPidFile: %LOCALSTATEDIR%/run/openldap/slapd.pid
  311. #
  312. # Do not enable referrals until AFTER you have a working directory
  313. # service AND an understanding of referrals.
  314. @@ -26,10 +26,11 @@
  315. #
  316. # Load dynamic backend modules:
  317. #
  318. -#dn: cn=module,cn=config
  319. -#objectClass: olcModuleList
  320. -#cn: module
  321. -#olcModulepath: %MODULEDIR%
  322. +dn: cn=module,cn=config
  323. +objectClass: olcModuleList
  324. +cn: module
  325. +olcModulepath: %MODULEDIR%
  326. +olcModuleload: back_mdb.la
  327. #olcModuleload: back_bdb.la
  328. #olcModuleload: back_hdb.la
  329. #olcModuleload: back_ldap.la
  330. @@ -90,6 +91,6 @@
  331. # The database directory MUST exist prior to running slapd AND
  332. # should only be accessible by the slapd and slap tools.
  333. # Mode 700 recommended.
  334. -olcDbDirectory: %LOCALSTATEDIR%/openldap-data
  335. +olcDbDirectory: %LOCALSTATEDIR%/lib/openldap
  336. # Indices to maintain
  337. olcDbIndex: objectClass eq
  338. diff -Naur openldap-2.4.40.orig/servers/slapd/slapi/Makefile.in openldap-2.4.40/servers/slapd/slapi/Makefile.in
  339. --- openldap-2.4.40.orig/servers/slapd/slapi/Makefile.in 2014-09-18 20:48:49.000000000 -0500
  340. +++ openldap-2.4.40/servers/slapd/slapi/Makefile.in 2015-03-26 15:36:59.639463969 -0500
  341. @@ -46,6 +46,6 @@
  342. install-local: FORCE
  343. if test "$(BUILD_MOD)" = "yes"; then \
  344. $(MKDIR) $(DESTDIR)$(libdir); \
  345. - $(LTINSTALL) $(INSTALLFLAGS) -m 644 $(LIBRARY) $(DESTDIR)$(libdir); \
  346. + $(LTINSTALL) $(INSTALLFLAGS) -m 755 $(LIBRARY) $(DESTDIR)$(libdir); \
  347. fi