1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-18 00:23:50 +03:00

Make libsmbclient work with DFS

Signed-off-by: Derrell Lipman <derrell.lipman@unwireduniverse.com>
This commit is contained in:
Bo Yang
2009-02-20 12:00:46 +08:00
committed by Derrell Lipman
parent 27307be0f7
commit e256d72f0c
7 changed files with 108 additions and 6 deletions

View File

@@ -233,6 +233,7 @@ SMBC_parse_path(TALLOC_CTX *ctx,
char *s;
const char *p;
char *q, *r;
char *workgroup = NULL;
int len;
/* Ensure these returns are at least valid pointers. */
@@ -332,7 +333,6 @@ SMBC_parse_path(TALLOC_CTX *ctx,
u = userinfo;
if (strchr_m(u, ';')) {
char *workgroup;
next_token_no_ltrim_talloc(ctx, &u, &workgroup, ";");
if (!workgroup) {
return -1;
@@ -394,6 +394,19 @@ decoding:
(void) urldecode_talloc(ctx, pp_share, *pp_share);
(void) urldecode_talloc(ctx, pp_user, *pp_user);
(void) urldecode_talloc(ctx, pp_password, *pp_password);
if (!workgroup) {
workgroup = talloc_strdup(ctx, smbc_getWorkgroup(context));
}
if (!workgroup) {
return -1;
}
/* set the credentials to make DFS work */
smbc_set_credentials_with_fallback(context,
workgroup,
*pp_user,
*pp_password);
return 0;
}