[dovecot-cvs] dovecot/src/deliver deliver.c,1.20.2.7,1.20.2.8

cras at dovecot.org cras at dovecot.org
Fri Aug 11 00:48:34 EEST 2006


Update of /var/lib/cvs/dovecot/src/deliver
In directory talvi:/tmp/cvs-serv10663

Modified Files:
      Tag: branch_1_0
	deliver.c 
Log Message:
Set umask from dovecot.conf, or default to 0077.



Index: deliver.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/deliver/deliver.c,v
retrieving revision 1.20.2.7
retrieving revision 1.20.2.8
diff -u -d -r1.20.2.7 -r1.20.2.8
--- deliver.c	7 Aug 2006 12:42:18 -0000	1.20.2.7
+++ deliver.c	10 Aug 2006 21:48:31 -0000	1.20.2.8
@@ -347,7 +347,7 @@
 	const char *config_path = DEFAULT_CONFIG_FILE;
 	const char *mailbox = "INBOX";
 	const char *auth_socket, *env_tz;
-	const char *home, *destination, *user, *mail_env;
+	const char *home, *destination, *user, *mail_env, *value;
         const struct var_expand_table *table;
         enum mail_storage_flags flags;
         enum mail_storage_lock_method lock_method;
@@ -455,6 +455,11 @@
 		destination = user;
 	}
 
+	value = getenv("UMASK");
+	if (value == NULL || sscanf(value, "%i", &i) != 1 || i < 0)
+		i = 0077;
+	(void)umask(i);
+
 	deliver_set = i_new(struct deliver_settings, 1);
 	deliver_set->hostname = getenv("HOSTNAME");
 	if (deliver_set->hostname == NULL)



More information about the dovecot-cvs mailing list