On Thu, Aug 02, 2007 at 05:12:07PM +0300, Timo Sirainen wrote:
> The other rquota patches had authunix_create_default() call. Is this
> needed/useful?

Without this, we get (Solaris 8 client talking to Solaris 10 rquotad):
> IMAP(xxx): quota-fs: permission denied to rquota service

After adding a call to authunix_create_default(), quota reporting works.

I've attached patches (against 1.0.3 with the rquota support applied) to
add auth support and to build the necessary XDR bits with rpcgen; the
latter could probably use some work, since it assumes the availability
of rpcgen and that the rquota.x file is in /usr/include/rpcsvc.

-Steven Luo
diff -urpN dovecot-1.0.3/src/plugins/quota/quota-fs.c dovecot-1.0.3-1/src/plugins/quota/quota-fs.c
--- dovecot-1.0.3/src/plugins/quota/quota-fs.c	2007-08-03 18:59:08.000000000 -0700
+++ dovecot-1.0.3-1/src/plugins/quota/quota-fs.c	2007-08-03 18:58:39.000000000 -0700
@@ -224,6 +224,10 @@ static int do_rquota(struct fs_quota_roo
 		return -1;
 	}
 
+	/* Establish some RPC credentials */
+	auth_destroy(cl->cl_auth);
+	cl->cl_auth = authunix_create_default();
+
 	/* make the rquota call on the remote host */
 	args.gqa_pathp = path;
 	args.gqa_uid = root->uid;
@@ -236,6 +240,7 @@ static int do_rquota(struct fs_quota_roo
 				timeout);
 	
 	/* the result has been deserialized, let the client go */
+	auth_destroy(cl->cl_auth);
 	clnt_destroy(cl);
 
 	if (call_status != RPC_SUCCESS) {
diff -urN dovecot-1.0.3/src/plugins/quota/Makefile.am dovecot-1.0.3-1/src/plugins/quota/Makefile.am
--- dovecot-1.0.3/src/plugins/quota/Makefile.am	2007-07-29 23:15:04.000000000 -0700
+++ dovecot-1.0.3-1/src/plugins/quota/Makefile.am	2007-08-03 14:43:33.000000000 -0700
@@ -27,6 +27,13 @@
         quota-plugin.c \
 	quota-storage.c
 
+if HAVE_RQUOTA
+lib10_quota_plugin_la_SOURCES += rquota_xdr.c
+
+rquota_xdr.c:
+	rpcgen -o rquota_xdr.c -c /usr/include/rpcsvc/rquota.x
+endif
+
 noinst_HEADERS = \
 	quota.h \
 	quota-fs.h \

Attachment: signature.asc
Description: Digital signature

Reply via email to