diff options
author | Andreas Schneider <asn@samba.org> | 2011-03-16 13:42:26 +0100 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2011-03-23 17:19:22 +0100 |
commit | 0d97741b9b825350e3e04b5dc49b4e039bd744dc (patch) | |
tree | 08ef5a1d1f1ff818afb3097df64457f7dda6593f | |
parent | e69d92236744bb06d60faa4f21f3cd748ec5629d (diff) | |
download | samba-0d97741b9b825350e3e04b5dc49b4e039bd744dc.tar.gz samba-0d97741b9b825350e3e04b5dc49b4e039bd744dc.tar.bz2 samba-0d97741b9b825350e3e04b5dc49b4e039bd744dc.zip |
s3-epmapper: Added function to delete endpoint entries.
-rw-r--r-- | source3/include/ntdomain.h | 3 | ||||
-rw-r--r-- | source3/rpc_server/epmapper/srv_epmapper.c | 52 | ||||
-rw-r--r-- | source3/rpc_server/epmapper/srv_epmapper.h | 2 |
3 files changed, 57 insertions, 0 deletions
diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index 2eece8303e..8fb1248919 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -109,6 +109,8 @@ struct pipe_auth_data { DATA_BLOB user_session_key; }; +struct dcesrv_ep_entry_list; + /* * DCE/RPC-specific samba-internal-specific handling of data on * NamedPipes. @@ -126,6 +128,7 @@ struct pipes_struct { struct messaging_context *msg_ctx; struct ndr_syntax_id syntax; + struct dcesrv_ep_entry_list *ep_entries; /* linked list of rpc dispatch tables associated with the open rpc contexts */ diff --git a/source3/rpc_server/epmapper/srv_epmapper.c b/source3/rpc_server/epmapper/srv_epmapper.c index c43e351fdb..da998eb534 100644 --- a/source3/rpc_server/epmapper/srv_epmapper.c +++ b/source3/rpc_server/epmapper/srv_epmapper.c @@ -59,6 +59,13 @@ struct dcesrv_endpoint { struct dcesrv_iface_list *iface_list; }; +struct dcesrv_ep_entry_list { + struct dcesrv_ep_entry_list *next, *prev; + + uint32_t num_ents; + struct epm_entry_t *entries; +}; + struct rpc_eps { struct dcesrv_ep_iface *e; uint32_t count; @@ -220,6 +227,37 @@ static bool is_priviledged_pipe(struct auth_serversupplied_info *info) { return true; } +bool srv_epmapper_delete_endpoints(struct pipes_struct *p) +{ + struct epm_Delete r; + struct dcesrv_ep_entry_list *el; + error_status_t result; + + if (p->ep_entries == NULL) { + return true; + } + + for (el = p->ep_entries; + el != NULL; + el = p->ep_entries) { + r.in.num_ents = el->num_ents; + r.in.entries = el->entries; + + DEBUG(10, ("Delete_endpoints for: %s\n", + el->entries[0].annotation)); + + result = _epm_Delete(p, &r); + if (result != EPMAPPER_STATUS_OK) { + return false; + } + + DLIST_REMOVE(p->ep_entries, el); + TALLOC_FREE(el); + } + + return true; +} + void srv_epmapper_cleanup(void) { struct dcesrv_endpoint *ep; @@ -338,6 +376,20 @@ error_status_t _epm_Insert(struct pipes_struct *p, } } + if (r->in.num_ents > 0) { + struct dcesrv_ep_entry_list *el; + + el = talloc_zero(p->mem_ctx, struct dcesrv_ep_entry_list); + if (el == NULL) { + rc = EPMAPPER_STATUS_NO_MEMORY; + goto done; + } + el->num_ents = r->in.num_ents; + el->entries = talloc_move(el, &r->in.entries); + + DLIST_ADD(p->ep_entries, el); + } + rc = EPMAPPER_STATUS_OK; done: talloc_free(tmp_ctx); diff --git a/source3/rpc_server/epmapper/srv_epmapper.h b/source3/rpc_server/epmapper/srv_epmapper.h index 642117beab..1abc583e20 100644 --- a/source3/rpc_server/epmapper/srv_epmapper.h +++ b/source3/rpc_server/epmapper/srv_epmapper.h @@ -27,6 +27,8 @@ */ void srv_epmapper_cleanup(void); +bool srv_epmapper_delete_endpoints(struct pipes_struct *p); + #endif /*_SRV_EPMAPPER_H_ */ /* vim: set ts=8 sw=8 noet cindent syntax=c.doxygen: */ |