jabberd.patch 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. Index: util/util.h
  2. --- util/util.h.orig 2004-05-31 23:31:06 +0200
  3. +++ util/util.h 2004-09-22 21:26:44 +0200
  4. @@ -30,6 +30,8 @@
  5. #include <time.h>
  6. #include <errno.h>
  7. #include <assert.h>
  8. +#include <sys/types.h>
  9. +#include <sys/socket.h>
  10. #ifdef HAVE_NETINET_IN_H
  11. # include <netinet/in.h>
  12. Index: etc/c2s.xml.dist.in
  13. --- etc/c2s.xml.dist.in.orig 2004-04-26 07:42:53 +0200
  14. +++ etc/c2s.xml.dist.in 2004-09-22 21:48:33 +0200
  15. @@ -46,18 +46,16 @@
  16. </router>
  17. <!-- Log configuration - type is "syslog", "file" or "stdout" -->
  18. - <log type='syslog'>
  19. + <log type='file'>
  20. <!-- If logging to syslog, this is the log ident -->
  21. - <ident>jabberd/c2s</ident>
  22. + <!-- <ident>jabberd/c2s</ident> -->
  23. <!-- If logging to syslog, this is the log facility
  24. (local0 - local7) [default: local3] -->
  25. - <facility>local3</facility>
  26. + <!-- <facility>local3</facility> -->
  27. <!-- If logging to file, this is the filename of the logfile -->
  28. - <!--
  29. <file>@localstatedir@/jabberd/log/c2s.log</file>
  30. - -->
  31. </log>
  32. <!-- Local network configuration -->
  33. @@ -78,7 +76,7 @@
  34. <!-- <id realm='company'>localhost</id> -->
  35. <!-- IP address to bind to (default: 0.0.0.0) -->
  36. - <ip>0.0.0.0</ip>
  37. + <ip>127.0.0.1</ip>
  38. <!-- Port to bind to, or 0 to disable unencrypted access to the
  39. server (default: 5222) -->
  40. @@ -206,7 +204,7 @@
  41. <!-- Authentication/registration database configuration -->
  42. <authreg>
  43. <!-- Backend module to use -->
  44. - <module>mysql</module>
  45. + <module>db</module>
  46. <!-- Registration configuration -->
  47. <register>
  48. Index: etc/resolver.xml.dist.in
  49. --- etc/resolver.xml.dist.in.orig 2004-04-01 06:56:55 +0200
  50. +++ etc/resolver.xml.dist.in 2004-09-22 21:48:58 +0200
  51. @@ -46,18 +46,16 @@
  52. </router>
  53. <!-- Log configuration - type is "syslog", "file" or "stdout" -->
  54. - <log type='syslog'>
  55. + <log type='file'>
  56. <!-- If logging to syslog, this is the log ident -->
  57. - <ident>jabberd/resolver</ident>
  58. + <!-- <ident>jabberd/resolver</ident> -->
  59. <!-- If logging to syslog, this is the log facility
  60. (local0 - local7) [default: local3] -->
  61. - <facility>local3</facility>
  62. + <!-- <facility>local3</facility> -->
  63. <!-- If logging to file, this is the filename of the logfile -->
  64. - <!--
  65. <file>@localstatedir@/jabberd/log/resolver.log</file>
  66. - -->
  67. </log>
  68. <!-- SRV records will be resolved in the following order. The first
  69. Index: etc/router.xml.dist.in
  70. --- etc/router.xml.dist.in.orig 2004-04-01 06:56:55 +0200
  71. +++ etc/router.xml.dist.in 2004-09-22 21:49:28 +0200
  72. @@ -9,24 +9,22 @@
  73. <pidfile>@localstatedir@/jabberd/pid/router.pid</pidfile>
  74. <!-- Log configuration - type is "syslog", "file" or "stdout" -->
  75. - <log type='syslog'>
  76. + <log type='file'>
  77. <!-- If logging to syslog, this is the log ident -->
  78. - <ident>jabberd/router</ident>
  79. + <!-- <ident>jabberd/router</ident> -->
  80. <!-- If logging to syslog, this is the log facility
  81. (local0 - local7) [default: local3] -->
  82. - <facility>local3</facility>
  83. + <!-- <facility>local3</facility> -->
  84. <!-- If logging to file, this is the filename of the logfile -->
  85. - <!--
  86. <file>@localstatedir@/jabberd/log/router.log</file>
  87. - -->
  88. </log>
  89. <!-- Local network configuration -->
  90. <local>
  91. <!-- IP address to bind to (default: 0.0.0.0) -->
  92. - <ip>0.0.0.0</ip>
  93. + <ip>127.0.0.1</ip>
  94. <!-- Port to bind to (default: 5347) -->
  95. <port>5347</port>
  96. Index: etc/s2s.xml.dist.in
  97. --- etc/s2s.xml.dist.in.orig 2004-04-21 15:29:27 +0200
  98. +++ etc/s2s.xml.dist.in 2004-09-22 21:50:02 +0200
  99. @@ -56,25 +56,23 @@
  100. </router>
  101. <!-- Log configuration - type is "syslog", "file" or "stdout" -->
  102. - <log type='syslog'>
  103. + <log type='file'>
  104. <!-- If logging to syslog, this is the log ident -->
  105. - <ident>jabberd/s2s</ident>
  106. + <!-- <ident>jabberd/s2s</ident> -->
  107. <!-- If logging to syslog, this is the log facility
  108. (local0 - local7) [default: local3] -->
  109. - <facility>local3</facility>
  110. + <!-- <facility>local3</facility> -->
  111. <!-- if logging to file, this is the filename of the logfile -->
  112. - <!--
  113. <file>@localstatedir@/jabberd/log/s2s.log</file>
  114. - -->
  115. </log>
  116. <!-- Local network configuration -->
  117. <local>
  118. <!-- IP and port to listen for incoming s2s connections on
  119. (default: 0.0.0.0, 5269) -->
  120. - <ip>0.0.0.0</ip>
  121. + <ip>127.0.0.1</ip>
  122. <port>5269</port>
  123. <!-- Helper DNS resolver component - if this component is not
  124. Index: etc/sm.xml.dist.in
  125. --- etc/sm.xml.dist.in.orig 2004-04-02 06:32:31 +0200
  126. +++ etc/sm.xml.dist.in 2004-09-22 21:50:56 +0200
  127. @@ -49,24 +49,22 @@
  128. </router>
  129. <!-- Log configuration - type is "syslog", "file" or "stdout" -->
  130. - <log type='syslog'>
  131. + <log type='file'>
  132. <!-- If logging to syslog, this is the log ident -->
  133. - <ident>jabberd/sm</ident>
  134. + <!-- <ident>jabberd/sm</ident> -->
  135. <!-- If logging to syslog, this is the log facility
  136. (local0 - local7) [default: local3] -->
  137. - <facility>local3</facility>
  138. + <!-- <facility>local3</facility> -->
  139. <!-- If logging to file, this is the filename of the logfile -->
  140. - <!--
  141. <file>@localstatedir@/jabberd/log/sm.log</file>
  142. - -->
  143. </log>
  144. <!-- Storage database configuration -->
  145. <storage>
  146. <!-- By default, we use the MySQL driver for all storage -->
  147. - <driver>mysql</driver>
  148. + <driver>db</driver>
  149. <!-- Its also possible to explicitly list alternate drivers for
  150. specific data types. -->
  151. Index: c2s/authreg_ldap.c
  152. --- c2s/authreg_ldap.c.orig 2004-05-31 23:31:05 +0200
  153. +++ c2s/authreg_ldap.c 2004-10-03 18:56:15 +0200
  154. @@ -70,6 +70,24 @@
  155. return ld_errno;
  156. }
  157. +/** entry-point function to be called when following referrals.
  158. + this forces a re-bind, since Active Directory required you to
  159. + re-bind this makes it work with M$ Windows AD.
  160. + -- Juan F Arjona (jfarjona at jfarjona.com). */
  161. +static int rebindProc(LDAP *ld, LDAP_CONST char *url, ber_tag_t request, ber_int_t msgid, void *mdata)
  162. +{
  163. + moddata_t data = mdata;
  164. + data->ld = ld;
  165. + if (ldap_simple_bind_s(data->ld, data->binddn, data->bindpw)) {
  166. + log_write(data->ar->c2s->log, LOG_ERR, "ldap: bind failed(to %s): %s",
  167. + url, ldap_err2string(_ldap_get_lderrno(data->ld)));
  168. + ldap_unbind_s(data->ld);
  169. + data->ld = NULL;
  170. + return NULL;
  171. + }
  172. + return LDAP_SUCCESS;
  173. +}
  174. +
  175. /** connect to the ldap host */
  176. static int _ldap_connect(moddata_t data)
  177. {
  178. @@ -151,6 +169,14 @@
  179. snprintf(filter, 1024, "(%s=%s)", data->uidattr, username);
  180. + if (ldap_set_rebind_proc(data->ld, &rebindProc,data) ) {
  181. + log_write(data->ar->c2s->log, LOG_ERR, "ldap: set_rebind_proc failed: %s",
  182. + ldap_err2string(_ldap_get_lderrno(data->ld)));
  183. + ldap_unbind_s(data->ld);
  184. + data->ld = NULL;
  185. + return NULL;
  186. + }
  187. +
  188. if(ldap_search_s(data->ld, basedn, LDAP_SCOPE_SUBTREE, filter, no_attrs, 0, &result))
  189. {
  190. log_write(data->ar->c2s->log, LOG_ERR, "ldap: search %s failed: %s", filter, ldap_err2string(_ldap_get_lderrno(data->ld)));