dovecot-2.2: master: Ignore service {} blocks with empty executa...

dovecot at dovecot.org dovecot at dovecot.org
Mon Oct 29 18:32:45 EET 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/f423090a363a
changeset: 15340:f423090a363a
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Oct 29 18:32:40 2012 +0200
description:
master: Ignore service {} blocks with empty executable settings.

diffstat:

 src/master/master-settings.c |  8 ++------
 src/master/service.c         |  9 ++++++++-
 2 files changed, 10 insertions(+), 7 deletions(-)

diffs (51 lines):

diff -r e1fd0d04a8eb -r f423090a363a src/master/master-settings.c
--- a/src/master/master-settings.c	Mon Oct 29 18:29:07 2012 +0200
+++ b/src/master/master-settings.c	Mon Oct 29 18:32:40 2012 +0200
@@ -505,12 +505,8 @@
 			continue;
 		}
 
-		if (*service->executable == '\0') {
-			*error_r = t_strdup_printf("service(%s): "
-				"executable is empty", service->name);
-			return FALSE;
-		}
-		if (*service->executable != '/') {
+		if (*service->executable != '/' &&
+		    *service->executable != '\0') {
 			service->executable =
 				p_strconcat(pool, set->libexec_dir, "/",
 					    service->executable, NULL);
diff -r e1fd0d04a8eb -r f423090a363a src/master/service.c
--- a/src/master/service.c	Mon Oct 29 18:29:07 2012 +0200
+++ b/src/master/service.c	Mon Oct 29 18:32:40 2012 +0200
@@ -231,7 +231,6 @@
 	service->idle_kill = set->idle_kill != 0 ? set->idle_kill :
 		set->master_set->default_idle_kill;
 	service->type = service->set->parsed_type;
-	service->executable = set->executable;
 
 	if (set->process_limit == 0) {
 		/* use default */
@@ -357,6 +356,7 @@
 			return NULL;
 	}
 
+	service->executable = set->executable;
 	if (access(t_strcut(service->executable, ' '), X_OK) < 0) {
 		*error_r = t_strdup_printf("access(%s) failed: %m",
 					   t_strcut(service->executable, ' '));
@@ -397,6 +397,13 @@
 {
 	char *const *proto;
 
+	if (*set->executable == '\0') {
+		/* silently allow service {} blocks for disabled extensions
+		   (e.g. service managesieve {} block without pigeonhole
+		   installed) */
+		return FALSE;
+	}
+
 	if (*set->protocol == '\0')
 		return TRUE;
 


More information about the dovecot-cvs mailing list