From ad3ee0a81c4b2bf2ae67ba461e936f7777584345 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 6 Dec 2004 07:12:38 +0000 Subject: r4073: - added a set of lsa helper routines to make lsa lookups that are related to filesharing. For example, in order to manipulate ACLs properly its important to be able to call LookupSids, and to be able to lookup what privileges a SID has. - added 3 new commands to smbclient "lookupname", "lookupsid" and "privileges" (This used to be commit 8780c40f0539da72652d17455e98fcaee6d197d1) --- source4/libcli/util/clilsa.c | 299 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 299 insertions(+) create mode 100644 source4/libcli/util/clilsa.c (limited to 'source4/libcli/util/clilsa.c') diff --git a/source4/libcli/util/clilsa.c b/source4/libcli/util/clilsa.c new file mode 100644 index 0000000000..c3c7f8cc77 --- /dev/null +++ b/source4/libcli/util/clilsa.c @@ -0,0 +1,299 @@ +/* + Unix SMB/CIFS implementation. + + lsa calls for file sharing connections + + Copyright (C) Andrew Tridgell 2004 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +/* + when dealing with ACLs the file sharing client code needs to + sometimes make LSA RPC calls. This code provides an easy interface + for doing those calls. +*/ + +#include "includes.h" +#include "libcli/raw/libcliraw.h" +#include "librpc/gen_ndr/ndr_lsa.h" + +struct smblsa_state { + struct dcerpc_pipe *pipe; + struct smbcli_tree *ipc_tree; + struct policy_handle handle; +}; + +/* + establish the lsa pipe connection +*/ +static NTSTATUS smblsa_connect(struct smbcli_state *cli) +{ + struct smblsa_state *lsa; + NTSTATUS status; + struct lsa_OpenPolicy r; + uint16_t system_name = '\\'; + union smb_tcon tcon; + struct lsa_ObjectAttribute attr; + struct lsa_QosInfo qos; + + if (cli->lsa != NULL) { + return NT_STATUS_OK; + } + + lsa = talloc_p(cli, struct smblsa_state); + if (lsa == NULL) { + return NT_STATUS_NO_MEMORY; + } + + lsa->ipc_tree = smbcli_tree_init(cli->session); + if (lsa->ipc_tree == NULL) { + return NT_STATUS_NO_MEMORY; + } + + /* connect to IPC$ */ + tcon.generic.level = RAW_TCON_TCONX; + tcon.tconx.in.flags = 0; + tcon.tconx.in.password = data_blob(NULL, 0); + tcon.tconx.in.path = "ipc$"; + tcon.tconx.in.device = "IPC"; + status = smb_tree_connect(lsa->ipc_tree, lsa, &tcon); + if (!NT_STATUS_IS_OK(status)) { + talloc_free(lsa); + return status; + } + lsa->ipc_tree->tid = tcon.tconx.out.cnum; + + /* open the LSA pipe */ + status = dcerpc_pipe_open_smb(&lsa->pipe, lsa->ipc_tree, DCERPC_LSARPC_NAME); + if (!NT_STATUS_IS_OK(status)) { + talloc_free(lsa); + return status; + } + + /* bind to the LSA pipe */ + status = dcerpc_bind_auth_none(lsa->pipe, DCERPC_LSARPC_UUID, DCERPC_LSARPC_VERSION); + if (!NT_STATUS_IS_OK(status)) { + talloc_free(lsa); + return status; + } + + + /* open a lsa policy handle */ + qos.len = 0; + qos.impersonation_level = 2; + qos.context_mode = 1; + qos.effective_only = 0; + + attr.len = 0; + attr.root_dir = NULL; + attr.object_name = NULL; + attr.attributes = 0; + attr.sec_desc = NULL; + attr.sec_qos = &qos; + + r.in.system_name = &system_name; + r.in.attr = &attr; + r.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED; + r.out.handle = &lsa->handle; + + status = dcerpc_lsa_OpenPolicy(lsa->pipe, lsa, &r); + if (!NT_STATUS_IS_OK(status)) { + talloc_free(lsa); + return status; + } + + cli->lsa = lsa; + + return NT_STATUS_OK; +} + + +/* + return the set of privileges for the given sid +*/ +NTSTATUS smblsa_sid_privileges(struct smbcli_state *cli, struct dom_sid *sid, + TALLOC_CTX *mem_ctx, + struct lsa_RightSet *rights) +{ + NTSTATUS status; + struct lsa_EnumAccountRights r; + + status = smblsa_connect(cli); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + r.in.handle = &cli->lsa->handle; + r.in.sid = sid; + r.out.rights = rights; + + return dcerpc_lsa_EnumAccountRights(cli->lsa->pipe, mem_ctx, &r); +} + + +/* + check if a named sid has a particular named privilege +*/ +NTSTATUS smblsa_sid_check_privilege(struct smbcli_state *cli, + const char *sid_str, + const char *privilege) +{ + struct lsa_RightSet rights; + NTSTATUS status; + TALLOC_CTX *mem_ctx = talloc(cli, 0); + struct dom_sid *sid; + unsigned i; + + sid = dom_sid_parse_talloc(mem_ctx, sid_str); + if (sid == NULL) { + talloc_free(mem_ctx); + return NT_STATUS_INVALID_SID; + } + + status = smblsa_sid_privileges(cli, sid, mem_ctx, &rights); + if (!NT_STATUS_IS_OK(status)) { + talloc_free(mem_ctx); + return status; + } + + for (i=0;ilsa->handle; + r.in.sids = &sids; + r.in.names = &names; + r.in.level = 1; + r.in.count = &count; + r.out.count = &count; + r.out.names = &names; + + status = dcerpc_lsa_LookupSids(cli->lsa->pipe, mem_ctx2, &r); + if (!NT_STATUS_IS_OK(status)) { + talloc_free(mem_ctx2); + return status; + } + if (names.count != 1) { + talloc_free(mem_ctx2); + return NT_STATUS_UNSUCCESSFUL; + } + + (*name) = talloc_asprintf(mem_ctx, "%s\\%s", + r.out.domains->domains[0].name.string, + names.names[0].name.string); + + talloc_free(mem_ctx2); + + return NT_STATUS_OK; +} + +/* + lookup a name, returning its sid +*/ +NTSTATUS smblsa_lookup_name(struct smbcli_state *cli, + const char *name, + TALLOC_CTX *mem_ctx, + const char **sid_str) +{ + struct lsa_LookupNames r; + struct lsa_TransSidArray sids; + struct lsa_String names; + uint32_t count = 1; + NTSTATUS status; + struct dom_sid *sid; + TALLOC_CTX *mem_ctx2 = talloc(mem_ctx, 0); + uint32_t rid; + + status = smblsa_connect(cli); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + sids.count = 0; + sids.sids = NULL; + + names.string = name; + + r.in.handle = &cli->lsa->handle; + r.in.num_names = 1; + r.in.names = &names; + r.in.sids = &sids; + r.in.level = 1; + r.in.count = &count; + r.out.count = &count; + r.out.sids = &sids; + + status = dcerpc_lsa_LookupNames(cli->lsa->pipe, mem_ctx2, &r); + if (!NT_STATUS_IS_OK(status)) { + talloc_free(mem_ctx2); + return status; + } + if (sids.count != 1) { + talloc_free(mem_ctx2); + return NT_STATUS_UNSUCCESSFUL; + } + + sid = r.out.domains->domains[0].sid; + rid = sids.sids[0].rid; + + (*sid_str) = talloc_asprintf(mem_ctx, "%s-%u", + dom_sid_string(mem_ctx2, sid), rid); + + talloc_free(mem_ctx2); + + return NT_STATUS_OK; +} -- cgit From 4d545e09c899dd63dfc055d05dd871c7df8638a5 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 14 Dec 2004 06:31:20 +0000 Subject: r4202: added smbclient commands "addprivileges" and "delprivileges" for easily adding/removing privileges from users (This used to be commit 8764909c05c4829d1e4f7eaf8c18e8ef1e53645f) --- source4/libcli/util/clilsa.c | 46 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'source4/libcli/util/clilsa.c') diff --git a/source4/libcli/util/clilsa.c b/source4/libcli/util/clilsa.c index c3c7f8cc77..4204adcc07 100644 --- a/source4/libcli/util/clilsa.c +++ b/source4/libcli/util/clilsa.c @@ -297,3 +297,49 @@ NTSTATUS smblsa_lookup_name(struct smbcli_state *cli, return NT_STATUS_OK; } + + +/* + add a set of privileges to the given sid +*/ +NTSTATUS smblsa_sid_add_privileges(struct smbcli_state *cli, struct dom_sid *sid, + TALLOC_CTX *mem_ctx, + struct lsa_RightSet *rights) +{ + NTSTATUS status; + struct lsa_AddAccountRights r; + + status = smblsa_connect(cli); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + r.in.handle = &cli->lsa->handle; + r.in.sid = sid; + r.in.rights = rights; + + return dcerpc_lsa_AddAccountRights(cli->lsa->pipe, mem_ctx, &r); +} + +/* + remove a set of privileges from the given sid +*/ +NTSTATUS smblsa_sid_del_privileges(struct smbcli_state *cli, struct dom_sid *sid, + TALLOC_CTX *mem_ctx, + struct lsa_RightSet *rights) +{ + NTSTATUS status; + struct lsa_RemoveAccountRights r; + + status = smblsa_connect(cli); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + r.in.handle = &cli->lsa->handle; + r.in.sid = sid; + r.in.unknown = 0; + r.in.rights = rights; + + return dcerpc_lsa_RemoveAccountRights(cli->lsa->pipe, mem_ctx, &r); +} -- cgit From cc55aef7c116d03ba2817625b0ba9edb378525e3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 6 Jan 2005 02:32:43 +0000 Subject: r4547: - added talloc_new(ctx) macro that is a neater form of the common talloc(ctx, 0) call. - cleaned up some talloc usage in various files I'd like to get to the point that we have no calls to talloc(), at which point we will rename talloc_p() to talloc(), to encourage everyone to use the typesafe functions. (This used to be commit e6c81d7c9f8a6938947d3c1c8a971a0d6d50b67a) --- source4/libcli/util/clilsa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/libcli/util/clilsa.c') diff --git a/source4/libcli/util/clilsa.c b/source4/libcli/util/clilsa.c index 4204adcc07..843d45607b 100644 --- a/source4/libcli/util/clilsa.c +++ b/source4/libcli/util/clilsa.c @@ -153,7 +153,7 @@ NTSTATUS smblsa_sid_check_privilege(struct smbcli_state *cli, { struct lsa_RightSet rights; NTSTATUS status; - TALLOC_CTX *mem_ctx = talloc(cli, 0); + TALLOC_CTX *mem_ctx = talloc_new(cli); struct dom_sid *sid; unsigned i; @@ -195,7 +195,7 @@ NTSTATUS smblsa_lookup_sid(struct smbcli_state *cli, uint32_t count = 1; NTSTATUS status; struct dom_sid *sid; - TALLOC_CTX *mem_ctx2 = talloc(mem_ctx, 0); + TALLOC_CTX *mem_ctx2 = talloc_new(mem_ctx); status = smblsa_connect(cli); if (!NT_STATUS_IS_OK(status)) { @@ -255,7 +255,7 @@ NTSTATUS smblsa_lookup_name(struct smbcli_state *cli, uint32_t count = 1; NTSTATUS status; struct dom_sid *sid; - TALLOC_CTX *mem_ctx2 = talloc(mem_ctx, 0); + TALLOC_CTX *mem_ctx2 = talloc_new(mem_ctx); uint32_t rid; status = smblsa_connect(cli); -- cgit From 6836f5d0b167027908da9a08b9b219520997b563 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 9 Jan 2005 08:34:05 +0000 Subject: r4616: the first phase in the addition of proper support for dcerpc_alter_context and multiple context_ids in the dcerpc client library. This stage does the following: - split "struct dcerpc_pipe" into two parts, the main part being "struct dcerpc_connection", which contains all the parts not dependent on the context, and "struct dcerpc_pipe" which has the context dependent part. This is similar to the layering in libcli_*() for SMB - disable the current dcerpc_alter code. I've used a #warning until i get the 2nd phase finished. I don't know how portable #warning is, but it won't be long before I add full alter context support anyway, so it won't last long - cleanup the allocation of dcerpc_pipe structures. The previous code was quite awkward. (This used to be commit 4004c69937be7e5dae56f9567ca607f982d395d3) --- source4/libcli/util/clilsa.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source4/libcli/util/clilsa.c') diff --git a/source4/libcli/util/clilsa.c b/source4/libcli/util/clilsa.c index 843d45607b..c032af0abc 100644 --- a/source4/libcli/util/clilsa.c +++ b/source4/libcli/util/clilsa.c @@ -76,8 +76,14 @@ static NTSTATUS smblsa_connect(struct smbcli_state *cli) } lsa->ipc_tree->tid = tcon.tconx.out.cnum; + lsa->pipe = dcerpc_pipe_init(lsa); + if (lsa->pipe == NULL) { + talloc_free(lsa); + return NT_STATUS_NO_MEMORY; + } + /* open the LSA pipe */ - status = dcerpc_pipe_open_smb(&lsa->pipe, lsa->ipc_tree, DCERPC_LSARPC_NAME); + status = dcerpc_pipe_open_smb(lsa->pipe->conn, lsa->ipc_tree, DCERPC_LSARPC_NAME); if (!NT_STATUS_IS_OK(status)) { talloc_free(lsa); return status; -- cgit From 592fce7fb149ca5e82b14d9c8f13a4da1babe2b7 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 13 Jan 2005 18:49:10 +0000 Subject: r4726: - use the name tcon and tid instead of conn and cnum - make use of talloc destructors metze (This used to be commit 8308da6ce4a95f8c10e22949ef00e9e64f2dbb85) --- source4/libcli/util/clilsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libcli/util/clilsa.c') diff --git a/source4/libcli/util/clilsa.c b/source4/libcli/util/clilsa.c index c032af0abc..eac6984254 100644 --- a/source4/libcli/util/clilsa.c +++ b/source4/libcli/util/clilsa.c @@ -74,7 +74,7 @@ static NTSTATUS smblsa_connect(struct smbcli_state *cli) talloc_free(lsa); return status; } - lsa->ipc_tree->tid = tcon.tconx.out.cnum; + lsa->ipc_tree->tid = tcon.tconx.out.tid; lsa->pipe = dcerpc_pipe_init(lsa); if (lsa->pipe == NULL) { -- cgit From 3e44c4a3ba6acd7d9bc997c012d1863377e9d873 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 24 Jan 2005 00:57:14 +0000 Subject: r4951: some of the code dealing with libcli was getting too complex trying to handle the inverted memory hierarchy that a normal session establishment gave. The inverted hierarchy came from that fact that you first establish a socket, then a transport, then a session and finally a tree. That leads to the socket being at the top of the memory hierarchy and the tree at the bottom, which makes no sense from the users point of view, as they want to be able to free the tree and have everything disappear. The core problem was that the libcli interface didn't distinguish between establishing a primary context and a secondary context. If you establish a 2nd session on a transport then you want the transport to be referenced by the session, whereas if you establish a primary session then you want the transport to be a child of the session. To fix this I have added "parent_ctx" and "primary" arguments to the libcli intialisation functions. This makes using the library much easier, and gives us a memory hierarchy that makes much more sense. I was prompted to do this by a bug in the cifs backend, which was caused by the socket not being properly torn down on a disconnect due to the inverted memory hierarchy. (This used to be commit 5e8fd5f70178992e249805c2e1ddafaf6840739b) --- source4/libcli/util/clilsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libcli/util/clilsa.c') diff --git a/source4/libcli/util/clilsa.c b/source4/libcli/util/clilsa.c index eac6984254..40991a8855 100644 --- a/source4/libcli/util/clilsa.c +++ b/source4/libcli/util/clilsa.c @@ -58,7 +58,7 @@ static NTSTATUS smblsa_connect(struct smbcli_state *cli) return NT_STATUS_NO_MEMORY; } - lsa->ipc_tree = smbcli_tree_init(cli->session); + lsa->ipc_tree = smbcli_tree_init(cli->session, lsa, False); if (lsa->ipc_tree == NULL) { return NT_STATUS_NO_MEMORY; } -- cgit From 759da3b915e2006d4c87b5ace47f399accd9ce91 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 27 Jan 2005 07:08:20 +0000 Subject: r5037: got rid of all of the TALLOC_DEPRECATED stuff. My apologies for the large commit. I thought this was worthwhile to get done for consistency. (This used to be commit ec32b22ed5ec224f6324f5e069d15e92e38e15c0) --- source4/libcli/util/clilsa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/libcli/util/clilsa.c') diff --git a/source4/libcli/util/clilsa.c b/source4/libcli/util/clilsa.c index 40991a8855..0c0c64c0b4 100644 --- a/source4/libcli/util/clilsa.c +++ b/source4/libcli/util/clilsa.c @@ -53,7 +53,7 @@ static NTSTATUS smblsa_connect(struct smbcli_state *cli) return NT_STATUS_OK; } - lsa = talloc_p(cli, struct smblsa_state); + lsa = talloc(cli, struct smblsa_state); if (lsa == NULL) { return NT_STATUS_NO_MEMORY; } @@ -217,7 +217,7 @@ NTSTATUS smblsa_lookup_sid(struct smbcli_state *cli, names.names = NULL; sids.num_sids = 1; - sids.sids = talloc_p(mem_ctx2, struct lsa_SidPtr); + sids.sids = talloc(mem_ctx2, struct lsa_SidPtr); sids.sids[0].sid = sid; r.in.handle = &cli->lsa->handle; -- cgit From af237084ecd4f9928c6c282b9c5c73598d5c73d6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 16 Jun 2005 11:36:09 +0000 Subject: r7633: this patch started as an attempt to make the dcerpc code use a given event_context for the socket_connect() call, so that when things that use dcerpc are running alongside anything else it doesn't block the whole process during a connect. Then of course I needed to change any code that created a dcerpc connection (such as the auth code) to also take an event context, and anything that called that and so on .... thus the size of the patch. There were 3 places where I punted: - abartlet wanted me to add a gensec_set_event_context() call instead of adding it to the gensec init calls. Andrew, my apologies for not doing this. I didn't do it as adding a new parameter allowed me to catch all the callers with the compiler. Now that its done, we could go back and use gensec_set_event_context() - the ejs code calls auth initialisation, which means it should pass in the event context from the web server. I punted on that. Needs fixing. - I used a NULL event context in dcom_get_pipe(). This is equivalent to what we did already, but should be fixed to use a callers event context. Jelmer, can you think of a clean way to do that? I also cleaned up a couple of things: - libnet_context_destroy() makes no sense. I removed it. - removed some unused vars in various places (This used to be commit 3a3025485bdb8f600ab528c0b4b4eef0c65e3fc9) --- source4/libcli/util/clilsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libcli/util/clilsa.c') diff --git a/source4/libcli/util/clilsa.c b/source4/libcli/util/clilsa.c index 0c0c64c0b4..ad2006756b 100644 --- a/source4/libcli/util/clilsa.c +++ b/source4/libcli/util/clilsa.c @@ -76,7 +76,7 @@ static NTSTATUS smblsa_connect(struct smbcli_state *cli) } lsa->ipc_tree->tid = tcon.tconx.out.tid; - lsa->pipe = dcerpc_pipe_init(lsa); + lsa->pipe = dcerpc_pipe_init(lsa, cli->transport->socket->event.ctx); if (lsa->pipe == NULL) { talloc_free(lsa); return NT_STATUS_NO_MEMORY; -- cgit From 2fa50ab671ba4a7e552e001f0dfde3a7cc330f8e Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Tue, 9 Aug 2005 03:09:47 +0000 Subject: r9222: Rename smb_tree_connect() to smb_raw_tcon() to match other raw function names. (This used to be commit 26b191b3c9529b2dae5d004819dab46657064408) --- source4/libcli/util/clilsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libcli/util/clilsa.c') diff --git a/source4/libcli/util/clilsa.c b/source4/libcli/util/clilsa.c index ad2006756b..f5de5014e3 100644 --- a/source4/libcli/util/clilsa.c +++ b/source4/libcli/util/clilsa.c @@ -69,7 +69,7 @@ static NTSTATUS smblsa_connect(struct smbcli_state *cli) tcon.tconx.in.password = data_blob(NULL, 0); tcon.tconx.in.path = "ipc$"; tcon.tconx.in.device = "IPC"; - status = smb_tree_connect(lsa->ipc_tree, lsa, &tcon); + status = smb_raw_tcon(lsa->ipc_tree, lsa, &tcon); if (!NT_STATUS_IS_OK(status)) { talloc_free(lsa); return status; -- cgit From acd6a086b341096fcbea1775ce748587fcc8020a Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 27 Dec 2005 14:28:01 +0000 Subject: r12510: Change the DCE/RPC interfaces to take a pointer to a dcerpc_interface_table struct rather then a tuple of interface name, UUID and version. This removes the requirement for having a global list of DCE/RPC interfaces, except for these parts of the code that use that list explicitly (ndrdump and the scanner torture test). This should also allow us to remove the hack that put the authservice parameter in the dcerpc_binding struct as it can now be read directly from dcerpc_interface_table. I will now modify some of these functions to take a dcerpc_syntax_id structure rather then a full dcerpc_interface_table. (This used to be commit 8aae0f168e54c01d0866ad6e0da141dbd828574f) --- source4/libcli/util/clilsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libcli/util/clilsa.c') diff --git a/source4/libcli/util/clilsa.c b/source4/libcli/util/clilsa.c index f5de5014e3..3c7850b7fd 100644 --- a/source4/libcli/util/clilsa.c +++ b/source4/libcli/util/clilsa.c @@ -90,7 +90,7 @@ static NTSTATUS smblsa_connect(struct smbcli_state *cli) } /* bind to the LSA pipe */ - status = dcerpc_bind_auth_none(lsa->pipe, DCERPC_LSARPC_UUID, DCERPC_LSARPC_VERSION); + status = dcerpc_bind_auth_none(lsa->pipe, &dcerpc_table_lsarpc); if (!NT_STATUS_IS_OK(status)) { talloc_free(lsa); return status; -- cgit From 78c50015bb8bd5a1d831a6e7ec796b3367c73145 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 3 Jan 2006 15:40:05 +0000 Subject: r12694: Move some headers to the directory of the subsystem they belong to. (This used to be commit c722f665c90103f3ed57621c460e32ad33e7a8a3) --- source4/libcli/util/clilsa.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/libcli/util/clilsa.c') diff --git a/source4/libcli/util/clilsa.c b/source4/libcli/util/clilsa.c index 3c7850b7fd..bf5048b02a 100644 --- a/source4/libcli/util/clilsa.c +++ b/source4/libcli/util/clilsa.c @@ -28,6 +28,7 @@ #include "includes.h" #include "libcli/raw/libcliraw.h" +#include "libcli/libcli.h" #include "librpc/gen_ndr/ndr_lsa.h" struct smblsa_state { -- cgit From 4ac2be99588b48b0652a524bf12fb1aa9c3f5fbb Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 7 Mar 2006 11:07:23 +0000 Subject: r13924: Split more prototypes out of include/proto.h + initial work on header file dependencies (This used to be commit 122835876748a3eaf5e8d31ad1abddab9acb8781) --- source4/libcli/util/clilsa.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/libcli/util/clilsa.c') diff --git a/source4/libcli/util/clilsa.c b/source4/libcli/util/clilsa.c index bf5048b02a..97aa7e13ac 100644 --- a/source4/libcli/util/clilsa.c +++ b/source4/libcli/util/clilsa.c @@ -29,6 +29,7 @@ #include "includes.h" #include "libcli/raw/libcliraw.h" #include "libcli/libcli.h" +#include "libcli/security/proto.h" #include "librpc/gen_ndr/ndr_lsa.h" struct smblsa_state { -- cgit From 1060f6b3f621cb70b075a879f129e57f10fdbf8a Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 14 Mar 2006 23:35:30 +0000 Subject: r14402: Generate seperate headers for RPC client functions. (This used to be commit 7054ebf0249930843a2baf4d023ae8f62cedb109) --- source4/libcli/util/clilsa.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/libcli/util/clilsa.c') diff --git a/source4/libcli/util/clilsa.c b/source4/libcli/util/clilsa.c index 97aa7e13ac..7cafef829a 100644 --- a/source4/libcli/util/clilsa.c +++ b/source4/libcli/util/clilsa.c @@ -31,6 +31,7 @@ #include "libcli/libcli.h" #include "libcli/security/proto.h" #include "librpc/gen_ndr/ndr_lsa.h" +#include "librpc/gen_ndr/ndr_lsa_c.h" struct smblsa_state { struct dcerpc_pipe *pipe; -- cgit From 8528016978b084213ef53d66e1b6e831b1a01acc Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 16 Mar 2006 00:23:11 +0000 Subject: r14464: Don't include ndr_BASENAME.h files unless strictly required, instead try to include just the BASENAME.h files (containing only structs) (This used to be commit 3dd477ca5147f28a962b8437e2611a8222d706bd) --- source4/libcli/util/clilsa.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/libcli/util/clilsa.c') diff --git a/source4/libcli/util/clilsa.c b/source4/libcli/util/clilsa.c index 7cafef829a..f1f0f01c1d 100644 --- a/source4/libcli/util/clilsa.c +++ b/source4/libcli/util/clilsa.c @@ -31,6 +31,7 @@ #include "libcli/libcli.h" #include "libcli/security/proto.h" #include "librpc/gen_ndr/ndr_lsa.h" +#include "librpc/gen_ndr/ndr_security.h" #include "librpc/gen_ndr/ndr_lsa_c.h" struct smblsa_state { -- cgit From 4f1c8daa36a7a0372c5fd9eab51f3c16ee81c49d Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 16 Mar 2006 12:43:28 +0000 Subject: r14470: Remove some unnecessary headers. (This used to be commit f7312dab3b9aba2b2b82e8a6e0c483a32a03a63a) --- source4/libcli/util/clilsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libcli/util/clilsa.c') diff --git a/source4/libcli/util/clilsa.c b/source4/libcli/util/clilsa.c index f1f0f01c1d..fab392ac04 100644 --- a/source4/libcli/util/clilsa.c +++ b/source4/libcli/util/clilsa.c @@ -30,8 +30,8 @@ #include "libcli/raw/libcliraw.h" #include "libcli/libcli.h" #include "libcli/security/proto.h" -#include "librpc/gen_ndr/ndr_lsa.h" #include "librpc/gen_ndr/ndr_security.h" +#include "librpc/gen_ndr/ndr_lsa.h" #include "librpc/gen_ndr/ndr_lsa_c.h" struct smblsa_state { -- cgit From 1af925f394b1084779f5b1b5a10c2ec512d7e5be Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 2 Apr 2006 12:02:01 +0000 Subject: r14860: create libcli/security/security.h metze (This used to be commit 9ec706238c173992dc938d537bdf1103bf519dbf) --- source4/libcli/util/clilsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libcli/util/clilsa.c') diff --git a/source4/libcli/util/clilsa.c b/source4/libcli/util/clilsa.c index fab392ac04..f5e49dd577 100644 --- a/source4/libcli/util/clilsa.c +++ b/source4/libcli/util/clilsa.c @@ -29,7 +29,7 @@ #include "includes.h" #include "libcli/raw/libcliraw.h" #include "libcli/libcli.h" -#include "libcli/security/proto.h" +#include "libcli/security/security.h" #include "librpc/gen_ndr/ndr_security.h" #include "librpc/gen_ndr/ndr_lsa.h" #include "librpc/gen_ndr/ndr_lsa_c.h" -- cgit From e002300f238dd0937dd9f768e366c006945e8baa Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 29 Apr 2006 17:34:49 +0000 Subject: r15328: Move some functions around, remove dependencies. Remove some autogenerated headers (which had prototypes now autogenerated by pidl) Remove ndr_security.h from a few places - it's no longer necessary (This used to be commit c19c2b51d3e1ad347120b06a22bda5ec586c22e8) --- source4/libcli/util/clilsa.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source4/libcli/util/clilsa.c') diff --git a/source4/libcli/util/clilsa.c b/source4/libcli/util/clilsa.c index f5e49dd577..e491d1c9ee 100644 --- a/source4/libcli/util/clilsa.c +++ b/source4/libcli/util/clilsa.c @@ -30,7 +30,6 @@ #include "libcli/raw/libcliraw.h" #include "libcli/libcli.h" #include "libcli/security/security.h" -#include "librpc/gen_ndr/ndr_security.h" #include "librpc/gen_ndr/ndr_lsa.h" #include "librpc/gen_ndr/ndr_lsa_c.h" -- cgit From 60fd088c480e474c3db8870f1288462a8452cea3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 26 Feb 2007 05:37:19 +0000 Subject: r21535: - fixed a crash in the RAW-ACLS test. When a dcerpc_pipe is created using the pattern in the clilsa code, it didn't fill in the p->binding structure. This affects nearly all users of dcerpc_pipe_open_smb(), so the simplest fix is to ensure that dcerpc_pipe_open_smb() initialises the binding if its not already there. - re-enable the RAW-ACLS test (This used to be commit d8875c286d2be49c01703d8fd58bbc1842054bd9) --- source4/libcli/util/clilsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libcli/util/clilsa.c') diff --git a/source4/libcli/util/clilsa.c b/source4/libcli/util/clilsa.c index e491d1c9ee..cd9a02deb1 100644 --- a/source4/libcli/util/clilsa.c +++ b/source4/libcli/util/clilsa.c @@ -86,7 +86,7 @@ static NTSTATUS smblsa_connect(struct smbcli_state *cli) } /* open the LSA pipe */ - status = dcerpc_pipe_open_smb(lsa->pipe->conn, lsa->ipc_tree, DCERPC_LSARPC_NAME); + status = dcerpc_pipe_open_smb(lsa->pipe, lsa->ipc_tree, DCERPC_LSARPC_NAME); if (!NT_STATUS_IS_OK(status)) { talloc_free(lsa); return status; -- cgit From 0479a2f1cbae51fcd8dbdc3c148c808421fb4d25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:07:03 +0000 Subject: r23792: convert Samba4 to GPLv3 There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa) --- source4/libcli/util/clilsa.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/libcli/util/clilsa.c') diff --git a/source4/libcli/util/clilsa.c b/source4/libcli/util/clilsa.c index cd9a02deb1..a82f687053 100644 --- a/source4/libcli/util/clilsa.c +++ b/source4/libcli/util/clilsa.c @@ -7,7 +7,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -16,8 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ /* -- cgit From f14bd1a90ab47a418c0ec2492990a417a0bb3bf6 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 19 Aug 2007 21:23:03 +0000 Subject: r24557: rename 'dcerpc_table_' -> 'ndr_table_' metze (This used to be commit 84651aee81aaabbebf52ffc3fbcbabb2eec6eed5) --- source4/libcli/util/clilsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libcli/util/clilsa.c') diff --git a/source4/libcli/util/clilsa.c b/source4/libcli/util/clilsa.c index a82f687053..d51ad5e12d 100644 --- a/source4/libcli/util/clilsa.c +++ b/source4/libcli/util/clilsa.c @@ -92,7 +92,7 @@ static NTSTATUS smblsa_connect(struct smbcli_state *cli) } /* bind to the LSA pipe */ - status = dcerpc_bind_auth_none(lsa->pipe, &dcerpc_table_lsarpc); + status = dcerpc_bind_auth_none(lsa->pipe, &ndr_table_lsarpc); if (!NT_STATUS_IS_OK(status)) { talloc_free(lsa); return status; -- cgit From 0d7d5a6d492253f184ac58fe45ca22af5a3731de Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 19 Aug 2007 22:09:21 +0000 Subject: r24560: rename some DCERPC_ prefixes into NDR_ metze (This used to be commit f874eca5dab74e930d0ec52abeb06295d2d90476) --- source4/libcli/util/clilsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libcli/util/clilsa.c') diff --git a/source4/libcli/util/clilsa.c b/source4/libcli/util/clilsa.c index d51ad5e12d..6fd84bbe74 100644 --- a/source4/libcli/util/clilsa.c +++ b/source4/libcli/util/clilsa.c @@ -85,7 +85,7 @@ static NTSTATUS smblsa_connect(struct smbcli_state *cli) } /* open the LSA pipe */ - status = dcerpc_pipe_open_smb(lsa->pipe, lsa->ipc_tree, DCERPC_LSARPC_NAME); + status = dcerpc_pipe_open_smb(lsa->pipe, lsa->ipc_tree, NDR_LSARPC_NAME); if (!NT_STATUS_IS_OK(status)) { talloc_free(lsa); return status; -- cgit From dccf3f99e45137b6cd18c1de1c79808ad67130d1 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 8 Sep 2007 13:27:14 +0000 Subject: r25027: Fix more warnings. (This used to be commit 5085c53fcfade614e83d21fc2c1a5bc43bb2a729) --- source4/libcli/util/clilsa.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/libcli/util/clilsa.c') diff --git a/source4/libcli/util/clilsa.c b/source4/libcli/util/clilsa.c index 6fd84bbe74..0fdf8a8e3a 100644 --- a/source4/libcli/util/clilsa.c +++ b/source4/libcli/util/clilsa.c @@ -31,6 +31,7 @@ #include "libcli/security/security.h" #include "librpc/gen_ndr/ndr_lsa.h" #include "librpc/gen_ndr/ndr_lsa_c.h" +#include "libcli/util/clilsa.h" struct smblsa_state { struct dcerpc_pipe *pipe; -- cgit From 2151cde58014ea2e822c13d2f8a369b45dc19ca8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 6 Oct 2007 22:28:14 +0000 Subject: r25554: Convert last instances of BOOL, True and False to the standard types. (This used to be commit 566aa14139510788548a874e9213d91317f83ca9) --- source4/libcli/util/clilsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libcli/util/clilsa.c') diff --git a/source4/libcli/util/clilsa.c b/source4/libcli/util/clilsa.c index 0fdf8a8e3a..7c32294648 100644 --- a/source4/libcli/util/clilsa.c +++ b/source4/libcli/util/clilsa.c @@ -61,7 +61,7 @@ static NTSTATUS smblsa_connect(struct smbcli_state *cli) return NT_STATUS_NO_MEMORY; } - lsa->ipc_tree = smbcli_tree_init(cli->session, lsa, False); + lsa->ipc_tree = smbcli_tree_init(cli->session, lsa, false); if (lsa->ipc_tree == NULL) { return NT_STATUS_NO_MEMORY; } -- cgit From 7d5f0e0893d42b56145a3ffa34e3b4b9906cbd91 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 1 Jan 2008 22:05:13 -0600 Subject: r26639: librpc: Pass iconv convenience on from RPC connection to NDR library, so it can be overridden by OpenChange. (This used to be commit 2f29f80e07adef1f020173f2cd6d947d0ef505ce) --- source4/libcli/util/clilsa.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source4/libcli/util/clilsa.c') diff --git a/source4/libcli/util/clilsa.c b/source4/libcli/util/clilsa.c index 7c32294648..1eb2de83d2 100644 --- a/source4/libcli/util/clilsa.c +++ b/source4/libcli/util/clilsa.c @@ -32,6 +32,7 @@ #include "librpc/gen_ndr/ndr_lsa.h" #include "librpc/gen_ndr/ndr_lsa_c.h" #include "libcli/util/clilsa.h" +#include "param/param.h" struct smblsa_state { struct dcerpc_pipe *pipe; @@ -79,7 +80,8 @@ static NTSTATUS smblsa_connect(struct smbcli_state *cli) } lsa->ipc_tree->tid = tcon.tconx.out.tid; - lsa->pipe = dcerpc_pipe_init(lsa, cli->transport->socket->event.ctx); + lsa->pipe = dcerpc_pipe_init(lsa, cli->transport->socket->event.ctx, + lp_iconv_convenience(global_loadparm)); if (lsa->pipe == NULL) { talloc_free(lsa); return NT_STATUS_NO_MEMORY; -- cgit