aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorPeter Williams <peterw@ximian.com>2001-07-14 01:35:51 +0800
committerPeter Williams <peterw@src.gnome.org>2001-07-14 01:35:51 +0800
commit54e037a91cf1de9d82f87675e1bf857d90763f4d (patch)
tree65a5f80979106de683a0ae5b712060eae5c4d1ec /camel
parentfd982262e8f6b1ce2002641bce8e46e324e60296 (diff)
downloadgsoc2013-evolution-54e037a91cf1de9d82f87675e1bf857d90763f4d.tar.gz
gsoc2013-evolution-54e037a91cf1de9d82f87675e1bf857d90763f4d.tar.zst
gsoc2013-evolution-54e037a91cf1de9d82f87675e1bf857d90763f4d.zip
Let people install as non-root, but give them a bigass warning so they're
2001-07-13 Peter Williams <peterw@ximian.com> * Makefile.am (install-exec-local): Let people install as non-root, but give them a bigass warning so they're not allowed to complain when it doesn't work right. * camel-remote-store.c (sync_remote_folder): New function: hash table callback. (remote_disconnect): If cleanly disconnecting, sync our folders. Fixes deadlocks on exit (folders syncing after store disconnects) and also makes sense. svn path=/trunk/; revision=11090
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog12
-rw-r--r--camel/Makefile.am26
-rw-r--r--camel/camel-remote-store.c14
3 files changed, 48 insertions, 4 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index d5760cc10e..d1abaa0b19 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,15 @@
+2001-07-13 Peter Williams <peterw@ximian.com>
+
+ * Makefile.am (install-exec-local): Let people install as non-root,
+ but give them a bigass warning so they're not allowed to complain when
+ it doesn't work right.
+
+ * camel-remote-store.c (sync_remote_folder): New function:
+ hash table callback.
+ (remote_disconnect): If cleanly disconnecting, sync our folders. Fixes
+ deadlocks on exit (folders syncing after store disconnects) and also makes
+ sense.
+
2001-07-13 Jeffrey Stedfast <fejj@ximian.com>
* camel-uid-cache.c (camel_uid_cache_new): We now use a structure
diff --git a/camel/Makefile.am b/camel/Makefile.am
index 408a0e33d0..7dafb8bf83 100644
--- a/camel/Makefile.am
+++ b/camel/Makefile.am
@@ -204,13 +204,31 @@ camel-lock-helper: camel-lock-helper.o camel-lock.o
if CAMEL_LOCK_HELPER_SETUID
install-exec-local:
- chown $(CAMEL_LOCK_HELPER_USER) $(DESTDIR)$(sbindir)/camel-lock-helper
- chmod u+s $(DESTDIR)$(sbindir)/camel-lock-helper
+ @if test `whoami` = root ; then \
+ chown $(CAMEL_LOCK_HELPER_USER) $(DESTDIR)$(sbindir)/camel-lock-helper ; \
+ chmod u+s $(DESTDIR)$(sbindir)/camel-lock-helper ; \
+ else \
+ echo '*** WARNING ***' ; \
+ echo "Camel will not be able to open mbox files until you perform the following steps:" ; \
+ echo " 1. Become root" ; \
+ echo " 2. chown $(CAMEL_LOCK_HELPER_USER) $(DESTDIR)$(sbindir)/camel-lock-helper" ; \
+ echo " 3. chmod u+s $(DESTDIR)$(sbindir)/camel-lock-helper" ; \
+ echo '*** WARNING ***' ; \
+ fi
endif
if CAMEL_LOCK_HELPER_SETGID
install-exec-local:
- chgrp $(CAMEL_LOCK_HELPER_GROUP) $(DESTDIR)$(sbindir)/camel-lock-helper
- chmod g+s $(DESTDIR)$(sbindir)/camel-lock-helper
+ @if test `whoami` = root ; then \
+ chgrp $(CAMEL_LOCK_HELPER_GROUP) $(DESTDIR)$(sbindir)/camel-lock-helper ; \
+ chmod g+s $(DESTDIR)$(sbindir)/camel-lock-helper ; \
+ else \
+ echo '*** WARNING ***' ; \
+ echo "Camel will not be able to open mbox files until you perform the following steps:" ; \
+ echo " 1. Become root" ; \
+ echo " 2. chgrp $(CAMEL_LOCK_HELPER_GROUP) $(DESTDIR)$(sbindir)/camel-lock-helper" ; \
+ echo " 3. chmod g+s $(DESTDIR)$(sbindir)/camel-lock-helper" ; \
+ echo '*** WARNING ***' ; \
+ fi
endif
diff --git a/camel/camel-remote-store.c b/camel/camel-remote-store.c
index 65445189fd..823a4673f4 100644
--- a/camel/camel-remote-store.c
+++ b/camel/camel-remote-store.c
@@ -281,6 +281,16 @@ remote_connect (CamelService *service, CamelException *ex)
return TRUE;
}
+
+static void
+sync_remote_folder (gpointer key, gpointer value, gpointer data)
+{
+ CamelFolder *folder = CAMEL_FOLDER (value);
+
+ if (!camel_exception_is_set ((CamelException *) data))
+ camel_folder_sync (folder, FALSE, (CamelException *) data);
+}
+
static gboolean
remote_disconnect (CamelService *service, gboolean clean, CamelException *ex)
{
@@ -292,6 +302,10 @@ remote_disconnect (CamelService *service, gboolean clean, CamelException *ex)
store->timeout_id = 0;
}
+ if (clean)
+ /* sync all folders */
+ g_hash_table_foreach (CAMEL_STORE (store)->folders, sync_remote_folder, ex);
+
if (!CAMEL_SERVICE_CLASS (store_class)->disconnect (service, clean, ex))
return FALSE;