svn commit: lorikeet r582 - in trunk/heimdal/lib/hdb: .
Andrew Bartlett
abartlet at samba.org
Mon Oct 9 09:17:27 GMT 2006
On Mon, 2006-10-09 at 06:44 +0000, lha at samba.org wrote:
> Author: lha
> Date: 2006-10-09 06:44:00 +0000 (Mon, 09 Oct 2006)
> New Revision: 582
>
> WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=lorikeet&rev=582
>
> Log:
> Merge changes from heimdal 20061008 cvs.
> @@ -44,7 +44,7 @@
>
> /*
> * the format for HDB keytabs is:
> - * HDB:[database:file:mkey]
> + * HDB:[database:mkey]
> */
This was a lorikeet-heimdal specific change.
> static krb5_error_code
> @@ -201,6 +201,8 @@
> const char *dbname = d->dbname;
> const char *mkey = d->mkey;
>
> + memset(&ent, 0, sizeof(ent));
> +
> if (dbname == NULL)
> find_db (context, &dbname, &mkey, principal);
>
> @@ -218,26 +220,18 @@
> (*db->hdb_destroy)(context, db);
> return ret;
> }
> - ret = (*db->hdb_fetch)(context, db, principal, HDB_F_DECRYPT|HDB_F_GET_CLIENT|HDB_F_GET_SERVER, &ent);
> + ret = (*db->hdb_fetch)(context, db, principal, HDB_F_DECRYPT, &ent);
We need this bit, or else we don't find the entry.
> -
> - /* Shutdown the hdb on error */
> if(ret == HDB_ERR_NOENTRY) {
> - (*db->hdb_close)(context, db);
> - (*db->hdb_destroy)(context, db);
> - return KRB5_KT_NOTFOUND;
> - } else if (ret) {
> - (*db->hdb_close)(context, db);
> - (*db->hdb_destroy)(context, db);
> - return ret;
> - }
> + ret = KRB5_KT_NOTFOUND;
> + goto out;
> + }else if(ret)
> + goto out;
> +
> if(kvno && ent.entry.kvno != kvno) {
> - /* The order here matters, we must free these in this order
> - * due to hdb-ldb and Samba4's talloc */
> hdb_free_entry(context, &ent);
> - (*db->hdb_close)(context, db);
> - (*db->hdb_destroy)(context, db);
> - return KRB5_KT_NOTFOUND;
> + ret = KRB5_KT_NOTFOUND;
> + goto out;
> }
> if(enctype == 0)
> if(ent.entry.keys.len > 0)
> @@ -254,9 +248,8 @@
> break;
> }
> }
> - /* The order here matters, we must free these in this order
> - * due to hdb-ldb and Samba4's talloc */
> hdb_free_entry(context, &ent);
> +out:
> (*db->hdb_close)(context, db);
> (*db->hdb_destroy)(context, db);
> return ret;
This part seems reasonable.
Andrew Bartlett
--
Andrew Bartlett http://samba.org/~abartlet/
Authentication Developer, Samba Team http://samba.org
Samba Developer, Red Hat Inc. http://redhat.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.samba.org/archive/samba-technical/attachments/20061009/a6fe40a9/attachment.bin
More information about the samba-technical
mailing list