diff options
author | bouyer <bouyer> | 2013-08-05 23:12:42 +0000 |
---|---|---|
committer | bouyer <bouyer> | 2013-08-05 23:12:42 +0000 |
commit | 2bf9f0752b21aa2611bf0cf3e930cf659e3d55c5 (patch) | |
tree | 89bd85ec5b11151ab8b4256b175ef55179a5d93d /mail/dovecot2 | |
parent | 43416d5cd6d5e63cd77effde0616f908c4a53a92 (diff) | |
download | pkgsrc-2bf9f0752b21aa2611bf0cf3e930cf659e3d55c5.tar.gz |
Fix (again) NetBSD libquota support.
Diffstat (limited to 'mail/dovecot2')
-rw-r--r-- | mail/dovecot2/Makefile | 3 | ||||
-rw-r--r-- | mail/dovecot2/distinfo | 4 | ||||
-rw-r--r-- | mail/dovecot2/patches/patch-src_plugins_quota_quota-fs.c | 56 | ||||
-rw-r--r-- | mail/dovecot2/patches/patch-src_plugins_quota_quota-fs.h | 16 |
4 files changed, 77 insertions, 2 deletions
diff --git a/mail/dovecot2/Makefile b/mail/dovecot2/Makefile index 88ae3ef54a5..57514c131b3 100644 --- a/mail/dovecot2/Makefile +++ b/mail/dovecot2/Makefile @@ -1,9 +1,10 @@ -# $NetBSD: Makefile,v 1.47 2013/07/12 10:44:56 jperkin Exp $ +# $NetBSD: Makefile,v 1.48 2013/08/05 23:12:42 bouyer Exp $ DISTNAME= dovecot-2.2.4 PKGREVISION= 1 CATEGORIES= mail MASTER_SITES= http://www.dovecot.org/releases/2.2/ +PKGREVISION= 1 MAINTAINER= adam@NetBSD.org HOMEPAGE= http://www.dovecot.org/ diff --git a/mail/dovecot2/distinfo b/mail/dovecot2/distinfo index bb367e1c5e9..49c3b52ba21 100644 --- a/mail/dovecot2/distinfo +++ b/mail/dovecot2/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.36 2013/07/02 15:38:19 adam Exp $ +$NetBSD: distinfo,v 1.37 2013/08/05 23:12:42 bouyer Exp $ SHA1 (dovecot-2.2.4.tar.gz) = 7cae7887a9738aee0c8976b83fcec6dca8ea7016 RMD160 (dovecot-2.2.4.tar.gz) = e245a03963db0e60d5a85e65c2a8946d55582a8b @@ -9,3 +9,5 @@ SHA1 (patch-ac) = dc5db4870b14bf2424f0c957f5cf7f1a289fefe6 SHA1 (patch-ae) = 51d8cb998cc2ded8bfc767710e465b752c50e656 SHA1 (patch-af) = c066e94dd6593d16eec3e66f5f4d26f021918498 SHA1 (patch-aj) = 9e7970d29d11c097b9588ad16611f6d0e48235c2 +SHA1 (patch-src_plugins_quota_quota-fs.c) = aa4865214cab4cbde1e04dc578ee394f97103185 +SHA1 (patch-src_plugins_quota_quota-fs.h) = 068b5f418f1354233805e2f7230b95e7a9c407b4 diff --git a/mail/dovecot2/patches/patch-src_plugins_quota_quota-fs.c b/mail/dovecot2/patches/patch-src_plugins_quota_quota-fs.c new file mode 100644 index 00000000000..b0d55317926 --- /dev/null +++ b/mail/dovecot2/patches/patch-src_plugins_quota_quota-fs.c @@ -0,0 +1,56 @@ +$NetBSD: patch-src_plugins_quota_quota-fs.c,v 1.4 2013/08/05 23:12:42 bouyer Exp $ + +fix support for NetBSD's libquota + +--- src/plugins/quota/quota-fs.c.orig 2013-02-26 09:42:04.000000000 +0100 ++++ src/plugins/quota/quota-fs.c 2013-08-06 01:00:32.000000000 +0200 +@@ -672,34 +672,38 @@ + { + struct quotakey qk; + struct quotaval qv; ++ struct quotahandle *qh; ++ int ret; + +- if (root->qh == NULL) { +- if ((root->qh = quota_open(root->mount->mount_path)) == NULL) { +- i_error("cannot open quota for %s: %m", +- root->mount->mount_path); +- fs_quota_root_disable(root, group); +- return 0; +- } +- } ++ if ((qh = quota_open(root->mount->mount_path)) == NULL) { ++ i_error("cannot open quota for %s: %m", ++ root->mount->mount_path); ++ fs_quota_root_disable(root, group); ++ return 0; ++ } + + qk.qk_idtype = group ? QUOTA_IDTYPE_GROUP : QUOTA_IDTYPE_USER; + qk.qk_id = group ? root->gid : root->uid; + qk.qk_objtype = bytes ? QUOTA_OBJTYPE_BLOCKS : QUOTA_OBJTYPE_FILES; + +- if (quota_get(root->qh, &qk, &qv) != 0) { ++ if (quota_get(qh, &qk, &qv) != 0) { + if (errno == ESRCH) { + fs_quota_root_disable(root, group); + return 0; + } + i_error("quotactl(Q_GETQUOTA, %s) failed: %m", + root->mount->mount_path); +- return -1; ++ ret = -1; ++ goto end; + } + + *value_r = qv.qv_usage * DEV_BSIZE; + *limit_r = qv.qv_softlimit * DEV_BSIZE; + +- return 1; ++ ret = 1; ++end: ++ quota_close(qh); ++ return ret; + } + #endif + diff --git a/mail/dovecot2/patches/patch-src_plugins_quota_quota-fs.h b/mail/dovecot2/patches/patch-src_plugins_quota_quota-fs.h new file mode 100644 index 00000000000..ebb21e6dfbb --- /dev/null +++ b/mail/dovecot2/patches/patch-src_plugins_quota_quota-fs.h @@ -0,0 +1,16 @@ +$NetBSD: patch-src_plugins_quota_quota-fs.h,v 1.4 2013/08/05 23:12:42 bouyer Exp $ + +fix support for NetBSD's libquota + +--- src/plugins/quota/quota-fs.h.orig 2013-08-06 00:53:34.000000000 +0200 ++++ src/plugins/quota/quota-fs.h 2013-08-06 00:54:29.000000000 +0200 +@@ -7,7 +7,8 @@ + #endif + + #ifdef HAVE_QUOTA_OPEN +-# include <quota.h> /* NetBSD with libquota */ ++/* absolute path to avoid confusion with ./quota.h */ ++# include "/usr/include/quota.h" /* NetBSD with libquota */ + #endif + + #ifdef HAVE_SYS_QUOTA_H |