1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-11-11 21:48:50 +01:00

* gpgkeys_ldap.c (send_key): List pgpCertID as one of the deleted

attributes.  This guarantees that if something goes wrong, we won't be
able to complete the transaction, thus leaving any key already existing on
the server intact.
This commit is contained in:
David Shaw 2004-02-26 01:29:26 +00:00
parent a84fe549da
commit 0d7cae4663
2 changed files with 18 additions and 8 deletions

View File

@ -1,3 +1,10 @@
2004-02-25 David Shaw <dshaw@jabberwocky.com>
* gpgkeys_ldap.c (send_key): List pgpCertID as one of the deleted
attributes. This guarantees that if something goes wrong, we
won't be able to complete the transaction, thus leaving any key
already existing on the server intact.
2004-02-23 David Shaw <dshaw@jabberwocky.com>
* gpgkeys_ldap.c (delete_one_attr): Removed.

View File

@ -541,6 +541,9 @@ send_key(int *eof)
make_one_attr(&modlist,0,"pgpSubKeyID",NULL);
make_one_attr(&modlist,0,"pgpKeySize",NULL);
make_one_attr(&modlist,0,"pgpKeyExpireTime",NULL);
make_one_attr(&modlist,0,"pgpCertID",NULL);
/* Note the count of these deleted attributes. They're to be used
later. */
/* Assemble the INFO stuff into LDAP attributes */
@ -672,13 +675,13 @@ send_key(int *eof)
err=ldap_modify_s(ldap,dn,modlist);
if(err==LDAP_NO_SUCH_OBJECT)
{
LDAPMod **addlist=&modlist[10];
/* This [11] is the deleted count from earlier */
LDAPMod **addlist=&modlist[11];
err=ldap_add_s(ldap,dn,addlist);
}
if(err!=LDAP_SUCCESS)
{
printf("err %d\n",err);
fprintf(console,"gpgkeys: error adding key %s to keyserver: %s\n",
keyid,ldap_err2string(err));
ret=ldap_err_to_gpg_err(err);
@ -712,12 +715,12 @@ send_key_keyserver(int *eof)
char keyid[17];
LDAPMod mod, *attrs[2];
memset (&mod, 0, sizeof mod);
mod.mod_op = LDAP_MOD_ADD;
mod.mod_type = pgpkeystr;
mod.mod_values = key;
attrs[0] = &mod;
attrs[1] = NULL;
memset(&mod,0,sizeof(mod));
mod.mod_op=LDAP_MOD_ADD;
mod.mod_type=pgpkeystr;
mod.mod_values=key;
attrs[0]=&mod;
attrs[1]=NULL;
dn=malloc(strlen("pgpCertid=virtual,")+strlen(basekeyspacedn)+1);
if(dn==NULL)