diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2009-03-01 16:39:35 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2009-03-01 16:39:35 +0100 |
commit | 09ac816b36e45fd537af2f7fe7c57a11f5c744f5 (patch) | |
tree | 4d5d44c27a2395a39efc62359f6e4b6976f2ba2e /source3/libsmb/libsmb_server.c | |
parent | 235244f4cc707130dd130afce88bde49606bd501 (diff) | |
parent | 54bc27e9374742d37b1ed9012d1cfe8f5ace6d40 (diff) | |
download | samba-09ac816b36e45fd537af2f7fe7c57a11f5c744f5.tar.gz samba-09ac816b36e45fd537af2f7fe7c57a11f5c744f5.tar.bz2 samba-09ac816b36e45fd537af2f7fe7c57a11f5c744f5.zip |
Merge branch 'master' of git://git.samba.org/samba into teventfix
Conflicts:
lib/tevent/pytevent.c
Diffstat (limited to 'source3/libsmb/libsmb_server.c')
-rw-r--r-- | source3/libsmb/libsmb_server.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/source3/libsmb/libsmb_server.c b/source3/libsmb/libsmb_server.c index 6d7a86241a..eda37f2187 100644 --- a/source3/libsmb/libsmb_server.c +++ b/source3/libsmb/libsmb_server.c @@ -238,6 +238,7 @@ SMBC_server(TALLOC_CTX *ctx, char **pp_password) { SMBCSRV *srv=NULL; + char *workgroup = NULL; struct cli_state *c; struct nmb_name called, calling; const char *server_n = server; @@ -359,7 +360,7 @@ SMBC_server(TALLOC_CTX *ctx, if (srv) { /* ... then we're done here. Give 'em what they came for. */ - return srv; + goto done; } /* If we're not asked to connect when a connection doesn't exist... */ @@ -601,6 +602,22 @@ again: server, share, srv)); DLIST_ADD(context->internal->servers, srv); +done: + if (!pp_workgroup || !*pp_workgroup || !**pp_workgroup) { + workgroup = talloc_strdup(ctx, smbc_getWorkgroup(context)); + } else { + workgroup = *pp_workgroup; + } + if(!workgroup) { + return NULL; + } + + /* set the credentials to make DFS work */ + smbc_set_credentials_with_fallback(context, + workgroup, + *pp_username, + *pp_password); + return srv; failed: |