diff options
author | bs135383 <none@none> | 2008-03-26 15:05:27 -0700 |
---|---|---|
committer | bs135383 <none@none> | 2008-03-26 15:05:27 -0700 |
commit | 1b34bc4aa5ecbd590d45845d21c8478049df6dcf (patch) | |
tree | 1a61a5f7f16b2dacf8744e4f1df896a73706b73d /usr/src/lib | |
parent | 44faeccf479dbc70538c261f148f9ad6a8b5ed31 (diff) | |
download | illumos-joyent-1b34bc4aa5ecbd590d45845d21c8478049df6dcf.tar.gz |
6637108 It still prompt for a password if the session is not expired when using Kerberos authentication.
Diffstat (limited to 'usr/src/lib')
-rw-r--r-- | usr/src/lib/libsmbfs/netsmb/smb_lib.h | 1 | ||||
-rw-r--r-- | usr/src/lib/libsmbfs/smb/ctx.c | 26 |
2 files changed, 27 insertions, 0 deletions
diff --git a/usr/src/lib/libsmbfs/netsmb/smb_lib.h b/usr/src/lib/libsmbfs/netsmb/smb_lib.h index 90bfda6313..7756ce2638 100644 --- a/usr/src/lib/libsmbfs/netsmb/smb_lib.h +++ b/usr/src/lib/libsmbfs/netsmb/smb_lib.h @@ -256,6 +256,7 @@ int smb_ctx_setworkgroup(struct smb_ctx *, const char *, int); int smb_ctx_setpassword(struct smb_ctx *, const char *, int); int smb_ctx_setsrvaddr(struct smb_ctx *, const char *); int smb_ctx_opt(struct smb_ctx *, int, const char *); +int smb_ctx_findvc(struct smb_ctx *, int, int); int smb_ctx_negotiate(struct smb_ctx *, int, int, char *); int smb_ctx_tdis(struct smb_ctx *ctx); int smb_ctx_lookup(struct smb_ctx *, int, int); diff --git a/usr/src/lib/libsmbfs/smb/ctx.c b/usr/src/lib/libsmbfs/smb/ctx.c index 51896bf128..ae79686869 100644 --- a/usr/src/lib/libsmbfs/smb/ctx.c +++ b/usr/src/lib/libsmbfs/smb/ctx.c @@ -1049,6 +1049,14 @@ smb_ctx_resolve(struct smb_ctx *ctx) bcopy(salocal, &ssn->ioc_local.nb, sizeof (struct sockaddr_nb)); + error = smb_ctx_findvc(ctx, SMBL_VC, 0); + if (error == 0) { + /* re-use and existing VC */ + ctx->ct_flags |= SMBCF_RESOLVED | SMBCF_SSNACTIVE; + return (0); + } + + /* Make a new connection via smb_ctx_negotiate()... */ error = smb_ctx_negotiate(ctx, SMBL_SHARE, SMBLK_CREATE, ssn->ioc_workgroup); if (error) @@ -1251,6 +1259,24 @@ out: return (rc); } +int +smb_ctx_findvc(struct smb_ctx *ctx, int level, int flags) +{ + struct smbioc_lookup rq; + int error = 0; + + if ((error = smb_ctx_gethandle(ctx))) + return (error); + + bzero(&rq, sizeof (rq)); + bcopy(&ctx->ct_ssn, &rq.ioc_ssn, sizeof (struct smbioc_ossn)); + bcopy(&ctx->ct_sh, &rq.ioc_sh, sizeof (struct smbioc_oshare)); + + rq.ioc_flags = flags; + rq.ioc_level = level; + + return (smb_ctx_ioctl(ctx, SMBIOC_FINDVC, &rq)); +} /* * adds a GSSAPI wrapper |