aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/ChangeLog21
-rw-r--r--addressbook/gui/component/addressbook-config.c2
-rw-r--r--addressbook/gui/component/addressbook-storage.c10
-rw-r--r--addressbook/gui/component/addressbook-storage.h1
4 files changed, 29 insertions, 5 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index f20a90729d..a4cc6a6d70 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,24 @@
+2001-07-16 Chris Toshok <toshok@ximian.com>
+
+ [ Fix bug #4705 - LDAP storage gets saved with corrupted binddn]
+
+ * gui/component/addressbook-config.c (addressbook_dialog_apply):
+ call addressbook_storage_write_sources here after we're done
+ rebuilding them.
+
+ * gui/component/addressbook-storage.c
+ (addressbook_storage_clear_sources): don't write the source file
+ here.
+ (addressbook_storage_add_source): same.
+ (addressbook_storage_remove_source): same.
+ (addressbook_storage_write_sources): new function, write the
+ source file out.
+ (addressbook_source_copy): g_strdup the binddn so we don't end up
+ free'ing it multiple times thanks to copies freeing theirs.
+
+ * gui/component/addressbook-storage.h: add prototype for
+ address_storage_write_sources.
+
2001-07-16 Iain Holmes <iain@ximian.com>
* backend/pas/evolution-vcard-importer.c (ebook_create): Don't just
diff --git a/addressbook/gui/component/addressbook-config.c b/addressbook/gui/component/addressbook-config.c
index d23fb1ced2..77614a89f5 100644
--- a/addressbook/gui/component/addressbook-config.c
+++ b/addressbook/gui/component/addressbook-config.c
@@ -898,6 +898,8 @@ addressbook_dialog_apply (GnomePropertyBox *property_box, gint page_num, Address
AddressbookSource *source = (AddressbookSource*)gtk_clist_get_row_data (GTK_CLIST (dialog->clistSources), i);
addressbook_storage_add_source (addressbook_source_copy (source));
}
+
+ addressbook_storage_write_sources();
}
static void
diff --git a/addressbook/gui/component/addressbook-storage.c b/addressbook/gui/component/addressbook-storage.c
index 1f8e01f464..531051defd 100644
--- a/addressbook/gui/component/addressbook-storage.c
+++ b/addressbook/gui/component/addressbook-storage.c
@@ -413,8 +413,6 @@ addressbook_storage_add_source (AddressbookSource *source)
source->uri, source->description, FALSE);
g_free (path);
-
- save_source_data (storage_path);
}
void
@@ -446,8 +444,6 @@ addressbook_storage_remove_source (const char *name)
evolution_storage_removed_folder (storage, path);
g_free (path);
-
- save_source_data (storage_path);
}
GList *
@@ -506,7 +502,11 @@ addressbook_storage_clear_sources ()
g_list_foreach (sources, (GFunc)addressbook_source_foreach, NULL);
g_list_free (sources);
sources = NULL;
+}
+void
+addressbook_storage_write_sources ()
+{
save_source_data (storage_path);
}
@@ -527,7 +527,7 @@ addressbook_source_copy (const AddressbookSource *source)
copy->ldap.rootdn = g_strdup (source->ldap.rootdn);
copy->ldap.scope = source->ldap.scope;
copy->ldap.auth = source->ldap.auth;
- copy->ldap.binddn = source->ldap.binddn;
+ copy->ldap.binddn = g_strdup (source->ldap.binddn);
copy->ldap.remember_passwd = source->ldap.remember_passwd;
}
else {
diff --git a/addressbook/gui/component/addressbook-storage.h b/addressbook/gui/component/addressbook-storage.h
index fa88405e38..f2a1910e13 100644
--- a/addressbook/gui/component/addressbook-storage.h
+++ b/addressbook/gui/component/addressbook-storage.h
@@ -70,6 +70,7 @@ void addressbook_storage_setup (EvolutionShellComponent *shell_component,
GList *addressbook_storage_get_sources (void);
AddressbookSource *addressbook_storage_get_source_by_uri (const char *uri);
void addressbook_storage_clear_sources (void);
+void addressbook_storage_write_sources (void);
AddressbookSource *addressbook_source_copy (const AddressbookSource *source);
void addressbook_source_free (AddressbookSource *source);
void addressbook_storage_init_source_uri (AddressbookSource *source);