View | Details | Raw Unified | Return to bug 30111
Collapse All | Expand All

(-)src/sendfiled.c (+4 lines)
Lines 10-15 Link Here
10
 * 		Chris Foote (chris@senet.com.au)
10
 * 		Chris Foote (chris@senet.com.au)
11
 * 		Daniel Kobras <kobras@lists.tat.physik.uni-tuebingen.de>
11
 * 		Daniel Kobras <kobras@lists.tat.physik.uni-tuebingen.de>
12
 *		Colin Phipps <cph@cph.demon.co.uk>
12
 *		Colin Phipps <cph@cph.demon.co.uk>
13
 *		Stefan `Sec` Zehl <sec@42.org>
13
 *
14
 *
14
 * History:	
15
 * History:	
15
 *
16
 *
Lines 138-143 Link Here
138
 *   2001-01-17 Framstag	mail2user() now runs in a subprocess
139
 *   2001-01-17 Framstag	mail2user() now runs in a subprocess
139
 *   2001-02-02 Framstag	fixed openlog() bug
140
 *   2001-02-02 Framstag	fixed openlog() bug
140
 *   2001-02-06 Framstag	added timeout on waiting response from client
141
 *   2001-02-06 Framstag	added timeout on waiting response from client
142
 *   2001-08-26 sec		workaround for sete[ug]id on FreeBSD
141
 *
143
 *
142
 *
144
 *
143
 * The sendfile-daemon of the sendfile package.
145
 * The sendfile-daemon of the sendfile package.
Lines 4000-4010 Link Here
4000
 * RETURN: nothing, but terminates program on error
4002
 * RETURN: nothing, but terminates program on error
4001
 */
4003
 */
4002
void setreugid() {
4004
void setreugid() {
4005
  if (rgid != getegid())
4003
  if (rgid && setegid(rgid)<0) {
4006
  if (rgid && setegid(rgid)<0) {
4004
    printf("490 Internal error on setegid(%u): %s\r\n",
4007
    printf("490 Internal error on setegid(%u): %s\r\n",
4005
	   (unsigned int)rgid,strerror(errno));
4008
	   (unsigned int)rgid,strerror(errno));
4006
    exit(1);
4009
    exit(1);
4007
  }
4010
  }
4011
  if (ruid != geteuid())
4008
  if (ruid && seteuid(ruid)<0) {
4012
  if (ruid && seteuid(ruid)<0) {
4009
    printf("490 Internal error on seteuid(%u): %s\r\n",
4013
    printf("490 Internal error on seteuid(%u): %s\r\n",
4010
	   (unsigned int)ruid,strerror(errno));
4014
	   (unsigned int)ruid,strerror(errno));

Return to bug 30111