masqmail

diff src/listen.c @ 332:63efd381e27b

refactoring, partly also related to set_euidgid()
author markus schnalke <meillo@marmaro.de>
date Sat, 27 Aug 2011 16:21:17 +0200
parents fc1c6425c024
children 41958685480d
line diff
     1.1 --- a/src/listen.c	Sat Aug 27 16:19:07 2011 +0200
     1.2 +++ b/src/listen.c	Sat Aug 27 16:21:17 2011 +0200
     1.3 @@ -131,14 +131,7 @@
     1.4  
     1.5  	/* now that we have our socket(s), we can give up root privileges */
     1.6  	if (!conf.run_as_user) {
     1.7 -		if (setegid(conf.mail_gid) != 0) {
     1.8 -			logwrite(LOG_ALERT, "could not change gid to %d: %s\n", conf.mail_gid, strerror(errno));
     1.9 -			exit(1);
    1.10 -		}
    1.11 -		if (seteuid(conf.mail_uid) != 0) {
    1.12 -			logwrite(LOG_ALERT, "could not change uid to %d: %s\n", conf.mail_uid, strerror(errno));
    1.13 -			exit(1);
    1.14 -		}
    1.15 +		set_euidgid(conf.mail_uid, conf.mail_gid, NULL, NULL);
    1.16  	}
    1.17  
    1.18  	/*  sel_ret = 0; */