Skip to content

Commit fc38427

Browse files
committed
fixed issue with not passing username when set and password not set in sspi.
1 parent 484733c commit fc38427

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

internal/auth/gssapi/sspi.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,13 @@ func (sc *SaslClient) Start() (string, []byte, error) {
8989

9090
var cusername *C.char
9191
var cpassword *C.char
92-
if sc.passwordSet {
92+
if sc.username != "" {
9393
cusername = C.CString(sc.username)
9494
defer C.free(unsafe.Pointer(cusername))
95-
cpassword = C.CString(sc.password)
96-
defer C.free(unsafe.Pointer(cpassword))
95+
if sc.passwordSet {
96+
cpassword = C.CString(sc.password)
97+
defer C.free(unsafe.Pointer(cpassword))
98+
}
9799
}
98100
status := C.sspi_client_init(&sc.state, cusername, cpassword)
99101

0 commit comments

Comments
 (0)