[dovecot-cvs] dovecot/src/deliver deliver.c,1.25,1.26

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


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

Modified Files:
	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.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- deliver.c	7 Aug 2006 12:42:37 -0000	1.25
+++ deliver.c	10 Aug 2006 21:48:33 -0000	1.26
@@ -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