masqmail-0.2

changeset 83:085d6cd44462

using is_privileged_user() to check here too
author meillo@marmaro.de
date Sat, 19 Jun 2010 18:07:31 +0200
parents 83a182793503
children ffeff2c33799
files src/masqmail.c
diffstat 1 files changed, 3 insertions(+), 7 deletions(-) [+]
line diff
     1.1 --- a/src/masqmail.c	Sat Jun 19 12:35:08 2010 +0200
     1.2 +++ b/src/masqmail.c	Sat Jun 19 18:07:31 2010 +0200
     1.3 @@ -258,13 +258,9 @@
     1.4  	message *msg = create_message();
     1.5  	gint i;
     1.6  
     1.7 -	if (return_path != NULL) {
     1.8 -		if ((conf.orig_uid != 0)
     1.9 -		    && (conf.orig_uid != conf.mail_uid)
    1.10 -		    && (!is_ingroup(conf.orig_uid, conf.mail_gid))) {
    1.11 -			fprintf(stderr, "must be in root, %s or in group %s for setting return path.\n", DEF_MAIL_USER, DEF_MAIL_GROUP);
    1.12 -			exit(EXIT_FAILURE);
    1.13 -		}
    1.14 +	if (return_path && !is_privileged_user(conf.orig_uid)) {
    1.15 +		fprintf(stderr, "must be in root, %s or in group %s for setting return path.\n", DEF_MAIL_USER, DEF_MAIL_GROUP);
    1.16 +		exit(EXIT_FAILURE);
    1.17  	}
    1.18  
    1.19  	if (!conf.run_as_user) {