summaryrefslogtreecommitdiff
path: root/source3/utils/netlookup.c
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2008-05-09 23:22:12 +0200
committerKai Blin <kai@samba.org>2008-05-10 09:22:27 +0200
commitf5769109447d8da0f09b102d444a816ad97a00dc (patch)
treefe7b470486ace083b3f48a54334a3db0bb9633d2 /source3/utils/netlookup.c
parent378527215e663c0c9d36c565a16723e0a1979ea0 (diff)
downloadsamba-f5769109447d8da0f09b102d444a816ad97a00dc.tar.gz
samba-f5769109447d8da0f09b102d444a816ad97a00dc.tar.bz2
samba-f5769109447d8da0f09b102d444a816ad97a00dc.zip
net: Remove globals
(This used to be commit 1e9319cf88b65a2a8d4f5099a1fe5297e405ed2e)
Diffstat (limited to 'source3/utils/netlookup.c')
-rw-r--r--source3/utils/netlookup.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/source3/utils/netlookup.c b/source3/utils/netlookup.c
index 90f99e4c8b..7d144cf624 100644
--- a/source3/utils/netlookup.c
+++ b/source3/utils/netlookup.c
@@ -53,7 +53,8 @@ static int cs_destructor(struct con_struct *p)
Create the connection to localhost.
********************************************************/
-static struct con_struct *create_cs(TALLOC_CTX *ctx, NTSTATUS *perr)
+static struct con_struct *create_cs(struct net_context *c,
+ TALLOC_CTX *ctx, NTSTATUS *perr)
{
NTSTATUS nt_status;
struct sockaddr_storage loopback_ss;
@@ -97,12 +98,12 @@ static struct con_struct *create_cs(TALLOC_CTX *ctx, NTSTATUS *perr)
&loopback_ss, 0,
"IPC$", "IPC",
#if 0
- opt_user_name,
- opt_workgroup,
- opt_password,
+ c->opt_user_name,
+ c->opt_workgroup,
+ c->opt_password,
#else
"",
- opt_workgroup,
+ c->opt_workgroup,
"",
#endif
0,
@@ -152,7 +153,8 @@ static struct con_struct *create_cs(TALLOC_CTX *ctx, NTSTATUS *perr)
The local smbd will also ask winbindd for us, so we don't have to.
********************************************************/
-NTSTATUS net_lookup_name_from_sid(TALLOC_CTX *ctx,
+NTSTATUS net_lookup_name_from_sid(struct net_context *c,
+ TALLOC_CTX *ctx,
DOM_SID *psid,
const char **ppdomain,
const char **ppname)
@@ -166,7 +168,7 @@ NTSTATUS net_lookup_name_from_sid(TALLOC_CTX *ctx,
*ppdomain = NULL;
*ppname = NULL;
- csp = create_cs(ctx, &nt_status);
+ csp = create_cs(c, ctx, &nt_status);
if (csp == NULL) {
return nt_status;
}
@@ -194,14 +196,15 @@ NTSTATUS net_lookup_name_from_sid(TALLOC_CTX *ctx,
Do a lookup_names call to localhost.
********************************************************/
-NTSTATUS net_lookup_sid_from_name(TALLOC_CTX *ctx, const char *full_name, DOM_SID *pret_sid)
+NTSTATUS net_lookup_sid_from_name(struct net_context *c, TALLOC_CTX *ctx,
+ const char *full_name, DOM_SID *pret_sid)
{
NTSTATUS nt_status;
struct con_struct *csp = NULL;
DOM_SID *sids = NULL;
enum lsa_SidType *types = NULL;
- csp = create_cs(ctx, &nt_status);
+ csp = create_cs(c, ctx, &nt_status);
if (csp == NULL) {
return nt_status;
}