dovecot-1.1: fs quota: Don't crash if some mail storages are out...
dovecot at dovecot.org
dovecot at dovecot.org
Sun Jul 20 21:47:13 EEST 2008
details: http://hg.dovecot.org/dovecot-1.1/rev/5659ce2398e4
changeset: 7776:5659ce2398e4
user: Timo Sirainen <tss at iki.fi>
date: Sun Jul 20 21:47:07 2008 +0300
description:
fs quota: Don't crash if some mail storages are outside known mountpoints.
diffstat:
1 file changed, 15 insertions(+), 12 deletions(-)
src/plugins/quota/quota-fs.c | 27 +++++++++++++++------------
diffs (44 lines):
diff -r 3f903dfa8650 -r 5659ce2398e4 src/plugins/quota/quota-fs.c
--- a/src/plugins/quota/quota-fs.c Sun Jul 20 21:38:34 2008 +0300
+++ b/src/plugins/quota/quota-fs.c Sun Jul 20 21:47:07 2008 +0300
@@ -232,7 +232,8 @@ static void fs_quota_add_missing_mounts(
continue;
mount = fs_quota_mountpoint_get(root->storage_mount_path);
- fs_quota_mount_init(root, mount);
+ if (mount != NULL)
+ fs_quota_mount_init(root, mount);
}
}
@@ -246,17 +247,19 @@ static void fs_quota_storage_added(struc
dir = mail_storage_get_mailbox_path(storage, "", &is_file);
mount = fs_quota_mountpoint_get(dir);
- if (getenv("DEBUG") != NULL) {
- i_info("fs quota add storage dir = %s", dir);
- i_info("fs quota block device = %s", mount->device_path);
- i_info("fs quota mount point = %s", mount->mount_path);
- }
-
- root = fs_quota_root_find_mountpoint(quota, mount);
- if (root != NULL && root->mount == NULL)
- fs_quota_mount_init(root, mount);
- else
- fs_quota_mountpoint_free(mount);
+ if (mount != NULL) {
+ if (getenv("DEBUG") != NULL) {
+ i_info("fs quota add storage dir = %s", dir);
+ i_info("fs quota block device = %s", mount->device_path);
+ i_info("fs quota mount point = %s", mount->mount_path);
+ }
+
+ root = fs_quota_root_find_mountpoint(quota, mount);
+ if (root != NULL && root->mount == NULL)
+ fs_quota_mount_init(root, mount);
+ else
+ fs_quota_mountpoint_free(mount);
+ }
/* we would actually want to do this only once after all quota roots
are created, but there's no way to do this right now */
More information about the dovecot-cvs
mailing list