libwbclient: fix returned LogonInfo in wbc_LogonUser().
authorGünther Deschner <gd@samba.org>
Thu, 18 Jun 2009 14:17:26 +0000 (16:17 +0200)
committerGünther Deschner <gd@samba.org>
Thu, 18 Jun 2009 14:37:45 +0000 (16:37 +0200)
That function could return emtpy blobs for username and ccache for e.g. cached
logins.

Guenther

nsswitch/libwbclient/wbc_pam.c

index a245d8a04440521fed72a8f89d59765f5d399810..d3bf6168ed370bb7f7822a3cd177079378b3bf52 100644 (file)
@@ -268,7 +268,8 @@ static wbcErr wbc_create_logon_info(TALLOC_CTX *mem_ctx,
        wbc_status = wbc_create_auth_info(i, resp, &i->info);
        BAIL_ON_WBC_ERROR(wbc_status);
 
-       if (resp->data.auth.krb5ccname) {
+       if (resp->data.auth.krb5ccname &&
+           strlen(resp->data.auth.krb5ccname)) {
                wbc_status = wbcAddNamedBlob(&i->num_blobs,
                                             &i->blobs,
                                             "krb5ccname",
@@ -278,7 +279,8 @@ static wbcErr wbc_create_logon_info(TALLOC_CTX *mem_ctx,
                BAIL_ON_WBC_ERROR(wbc_status);
        }
 
-       if (resp->data.auth.unix_username) {
+       if (resp->data.auth.unix_username &&
+           strlen(resp->data.auth.unix_username)) {
                wbc_status = wbcAddNamedBlob(&i->num_blobs,
                                             &i->blobs,
                                             "unix_username",