Mercurial > dovecot > core-2.2
changeset 13244:3439fc65838a
lib-storage: Fixed mail_storage_copy_can_use_hardlink() for mode=0600 with different uids.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 15 Aug 2011 01:11:47 +0300 |
parents | cc7cef1f6a21 |
children | 717af808a752 |
files | src/lib-storage/mail-copy.c |
diffstat | 1 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/mail-copy.c Mon Aug 15 01:06:19 2011 +0300 +++ b/src/lib-storage/mail-copy.c Mon Aug 15 01:11:47 2011 +0300 @@ -83,6 +83,13 @@ const struct mailbox_permissions *dest_perm = mailbox_get_permissions(dest); + if (src_perm->file_uid != dest_perm->file_uid) { + /* if we don't have read permissions, we can't hard link + (basically we'll catch 0600 files here) */ + if ((src_perm->file_create_mode & 0022) == 0) + return FALSE; + } + return src_perm->file_create_mode == dest_perm->file_create_mode && src_perm->file_create_gid == dest_perm->file_create_gid && !dest->disable_reflink_copy_to;