Changeset 988 for vendor/current/source4/cldap_server
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- Location:
- vendor/current/source4/cldap_server
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source4/cldap_server/cldap_server.c
r740 r988 35 35 #include "param/param.h" 36 36 #include "../lib/tsocket/tsocket.h" 37 #include "libds/common/roles.h" 38 39 NTSTATUS server_service_cldapd_init(void); 37 40 38 41 /* … … 46 49 struct cldapd_server); 47 50 struct ldap_SearchRequest *search; 51 52 if (in->ldap_msg->type == LDAP_TAG_AbandonRequest) { 53 DEBUG(10,("Got (and ignoring) CLDAP AbandonRequest from %s.", 54 tsocket_address_string(in->src, in))); 55 talloc_free(in); 56 return; 57 } 48 58 49 59 if (in->ldap_msg->type != LDAP_TAG_SearchRequest) { … … 79 89 } 80 90 81 if (search->num_attributes == 1 &&82 strcasecmp(search->attributes[0], "netlogon") == 0) {83 cldapd_netlogon_request(cldap,84 cldapd,85 in,86 in->ldap_msg->messageid,87 search->tree,88 in->src);89 talloc_free(in);90 return;91 }92 93 91 cldapd_rootdse_request(cldap, cldapd, in, 94 92 in->ldap_msg->messageid, … … 115 113 &socket_address); 116 114 if (ret != 0) { 117 status = map_nt_error_from_unix (errno);115 status = map_nt_error_from_unix_common(errno); 118 116 DEBUG(0,("invalid address %s:%d - %s:%s\n", 119 117 address, lpcfg_cldap_port(lp_ctx), … … 124 122 /* listen for unicasts on the CLDAP port (389) */ 125 123 status = cldap_socket_init(cldapd, 126 cldapd->task->event_ctx,127 124 socket_address, 128 125 NULL, … … 137 134 talloc_free(socket_address); 138 135 139 cldap_set_incoming_handler(cldapsock, cldapd_request_handler, cldapd); 136 cldap_set_incoming_handler(cldapsock, cldapd->task->event_ctx, 137 cldapd_request_handler, cldapd); 140 138 141 139 return NT_STATUS_OK; … … 152 150 NTSTATUS status; 153 151 154 num_interfaces = iface_ count(ifaces);152 num_interfaces = iface_list_count(ifaces); 155 153 156 154 /* if we are allowing incoming packets from any address, then 157 155 we need to bind to the wildcard address */ 158 156 if (!lpcfg_bind_interfaces_only(lp_ctx)) { 159 status = cldapd_add_socket(cldapd, lp_ctx, "0.0.0.0"); 160 NT_STATUS_NOT_OK_RETURN(status); 157 int num_binds = 0; 158 char **wcard = iface_list_wildcard(cldapd); 159 NT_STATUS_HAVE_NO_MEMORY(wcard); 160 for (i=0; wcard[i]; i++) { 161 status = cldapd_add_socket(cldapd, lp_ctx, wcard[i]); 162 if (NT_STATUS_IS_OK(status)) { 163 num_binds++; 164 } 165 } 166 talloc_free(wcard); 167 if (num_binds == 0) { 168 return NT_STATUS_INVALID_PARAMETER_MIX; 169 } 161 170 } 162 171 … … 164 173 so that replies always come from the right IP */ 165 174 for (i=0; i<num_interfaces; i++) { 166 const char *address = talloc_strdup(tmp_ctx, iface_ n_ip(ifaces, i));175 const char *address = talloc_strdup(tmp_ctx, iface_list_n_ip(ifaces, i)); 167 176 status = cldapd_add_socket(cldapd, lp_ctx, address); 168 177 NT_STATUS_NOT_OK_RETURN(status); … … 183 192 struct interface *ifaces; 184 193 185 load_interface s(task, lpcfg_interfaces(task->lp_ctx), &ifaces);186 187 if (iface_ count(ifaces) == 0) {194 load_interface_list(task, task->lp_ctx, &ifaces); 195 196 if (iface_list_count(ifaces) == 0) { 188 197 task_server_terminate(task, "cldapd: no network interfaces configured", false); 189 198 return; … … 199 208 false); 200 209 return; 201 case ROLE_ DOMAIN_CONTROLLER:210 case ROLE_ACTIVE_DIRECTORY_DC: 202 211 /* Yes, we want an CLDAP server */ 203 212 break; -
vendor/current/source4/cldap_server/cldap_server.h
r740 r988 33 33 struct ldap_SearchRequest; 34 34 35 /* used by netlogon DCE/RPC server */36 NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx,37 TALLOC_CTX *mem_ctx,38 const char *domain,39 const char *netbios_domain,40 struct dom_sid *domain_sid,41 const char *domain_guid,42 const char *user,43 uint32_t acct_control,44 const char *src_address,45 uint32_t version,46 struct loadparm_context *lp_ctx,47 struct netlogon_samlogon_response *netlogon,48 bool fill_on_blank_request);49 50 35 #include "cldap_server/proto.h" -
vendor/current/source4/cldap_server/rootdse.c
r740 r988 159 159 reply.result = &result; 160 160 161 /* Note: The remoteAddress should rather be set on a ldb request. 162 * We can set this savely on the context here, 163 * since cldapd_rootdse_fill operates synchronously. */ 164 ldb_set_opaque(cldapd->samctx, "remoteAddress", src); 165 161 166 cldapd_rootdse_fill(cldapd, tmp_ctx, search, &reply.response, 162 167 reply.result); -
vendor/current/source4/cldap_server/wscript_build
r740 r988 11 11 12 12 bld.SAMBA_SUBSYSTEM('CLDAPD', 13 source=' netlogon.crootdse.c',13 source='rootdse.c', 14 14 autoproto='proto.h', 15 deps=' LIBCLI_CLDAPldbsamba'15 deps='cli_cldap ldbsamba' 16 16 ) 17 17
Note:
See TracChangeset
for help on using the changeset viewer.