--- src/sendfiled.c	2008-03-11 11:52:06.000000000 -0500
+++ src/sendfiled.c	2008-05-09 04:52:55.000000000 -0500
@@ -74,7 +74,7 @@
  *   1997-01-30	Framstag	better SIZE parsing
  *   1997-02-03	Framstag	sprintf() -> snprintf()
  *   1997-02-09	Framstag	new msg2tty interface (msgh,msg)
- *   1997-02-10	Framstag	added setegid-call (security!)
+ *   1997-02-10	Framstag	added setgid-call (security!)
  *   1997-02-12	Framstag	better IRIX and HP-UX support
  *   1997-02-13	Framstag	better OSF/1 support
  *   1997-02-23	Framstag	modified str_* function names
@@ -273,8 +273,8 @@
 #endif
 
 #if defined(HPUX) || defined(BSD)
-  #define seteuid(a) setuid(a)
-  #define setegid(a) setgid(a)
+  #define setuid(a) setuid(a)
+  #define setgid(a) setgid(a)
 #endif
 
 #ifndef _PATH_UTMP
@@ -308,8 +308,8 @@
 int restricted(const char *, const char *, char);
 
 /* missed in <unistd.h> in some systems */
-int seteuid(uid_t);
-int setegid(gid_t);
+int setuid(uid_t);
+int setgid(gid_t);
 
 /* sendfile spool daemon for outgoing files */
 int sfsd(int, int, int, int, float);
@@ -1003,8 +1003,8 @@
 	fclose(inf);
       }
       
-      seteuid(0);
-      setegid(0);
+      setuid(0);
+      setgid(0);
 
       /* user forward? */
       if (forwarding && *forward && *filename && !*rpipe) {
@@ -1379,8 +1379,8 @@
       fprintf(dbf,"chdir: %d\n",chdir(userspool));
       fprintf(dbf,"ruid: %d (%d)\n",ruid,geteuid());
       fprintf(dbf,"rgid: %d (%d)\n",rgid,getegid());
-      fprintf(dbf,"setegid: %d\n",setegid(rgid));
-      fprintf(dbf,"seteuid: %d\n",seteuid(ruid));
+      fprintf(dbf,"setgid: %d\n",setgid(rgid));
+      fprintf(dbf,"setuid: %d\n",setuid(ruid));
 */
       /* convert back to UTF-7 and write to log file */
       if (msglog && check_userspool(recipient,userconfighome)==0 && 
@@ -1396,8 +1396,8 @@
 	  close(lfd);
 	}
       }
-      seteuid(0);
-      setegid(0);
+      setuid(0);
+      setgid(0);
 
       timetick=time(0);
       if (bell) strcat(msg,"\007");
@@ -1410,8 +1410,8 @@
       else {
 	
 	/* log sender address */
-	if (rgid) setegid(rgid);
-	if (ruid) seteuid(ruid);
+	if (rgid) setgid(rgid);
+	if (ruid) setuid(ruid);
 	snprintf(MAXS(tmp),"%s/msg@%s",userconfig,localhost);
 	if ((outf=rfopen(tmp,"w"))) {
 	  strcpy(tmp,sender);
@@ -1419,8 +1419,8 @@
 	  fprintf(outf,"%s\n",tmp);
 	}
 	fclose(outf);
-	seteuid(0);
-	setegid(0);
+	setuid(0);
+	setgid(0);
 	
         reply(200);
       }
@@ -1765,8 +1765,8 @@
       reply(201);
 
       /* reset uid and gid to root */
-      seteuid(0);
-      setegid(0);
+      setuid(0);
+      setgid(0);
 
       /* add entry to global logfile if required */
       /* ### todo: this part needs locking! ### */
@@ -1973,8 +1973,8 @@
       else
 	reply(530);
       
-      seteuid(0);
-      setegid(0);
+      setuid(0);
+      setgid(0);
 	     
       continue;
     }
@@ -2057,8 +2057,8 @@
 	
       }
 
-      seteuid(0);
-      setegid(0);
+      setuid(0);
+      setgid(0);
 	     
       continue;
     }
@@ -2151,8 +2151,8 @@
 	fclose(inf);
 	reply(250);
 	
-	seteuid(0);
-	setegid(0);
+	setuid(0);
+	setgid(0);
 	
 	continue;
       }
@@ -2183,8 +2183,8 @@
 	
 	close(infd);
 	
-	seteuid(0);
-	setegid(0);
+	setuid(0);
+	setgid(0);
 	
 	continue;
       }
@@ -2578,8 +2578,8 @@
     if (utmpfd<0) utmpfd=open("/var/adm/utmp",O_RDONLY);
     if (utmpfd<0) utmpfd=open("/var/run/utmp",O_RDONLY);
     if (utmpfd<0) {
-      seteuid(0);
-      setegid(0);
+      setuid(0);
+      setgid(0);
       return(-1);
     }
 
@@ -2616,8 +2616,8 @@
   }
 
   /* reset uid to root */
-  seteuid(0);
-  setegid(0);
+  setuid(0);
+  setgid(0);
 
   if (success>0) return(0); else return(-1);
 }
@@ -2651,8 +2651,8 @@
   /* change user */
   /* note: setuid does not work if euid>0 ! STUPID! */
   chdir(pwe->pw_dir);
-  seteuid(0);
-  setegid(0);
+  setuid(0);
+  setgid(0);
   if (setgid(rgid)<0) exit(1);
   initgroups(pwe->pw_name,pwe->pw_gid);
   if (setuid(ruid)<0) exit(1);
@@ -3765,13 +3765,13 @@
     chown(userspool,pwe->pw_uid,pwe->pw_gid);
 
   /* change uid and get user name */
-  if (setegid(finfo.st_gid)<0) exit(1);
-  if (seteuid(finfo.st_uid)<0) exit(1);
+  if (setgid(finfo.st_gid)<0) exit(1);
+  if (setuid(finfo.st_uid)<0) exit(1);
 
   if (!(inf=rfopen(oshfn,"r")) || chdir(userspool)<0) {
     fclose(inf);
-    seteuid(0);
-    setegid(0);
+    setuid(0);
+    setgid(0);
     chdir(cwd);
     return(-1);
   }
@@ -3781,8 +3781,8 @@
   id=spoolid(MAXLEN);
   if (id<=0 || id>MAXLEN) {
     fclose(inf);
-    seteuid(0);
-    setegid(0);
+    setuid(0);
+    setgid(0);
     chdir(cwd);
     return(-1);
   }
@@ -3793,8 +3793,8 @@
 
   if (!(outf=rfopen(shfn,"w"))) {
     fclose(inf);
-    seteuid(0);
-    setegid(0);
+    setuid(0);
+    setgid(0);
     chdir(cwd);
     return(-1);
   }
@@ -3846,8 +3846,8 @@
   utime(shfn,&utb);
   utime(sdfn,&utb);
 
-  seteuid(0);
-  setegid(0);
+  setuid(0);
+  setgid(0);
   chdir(cwd);
   return(0);
 }
@@ -3978,8 +3978,8 @@
       mkdir(userconfig,S_IRUSR|S_IWUSR|S_IXUSR);
   }
   
-  seteuid(0);
-  setegid(0);
+  setuid(0);
+  setgid(0);
 
   return(0);
 }
@@ -4046,7 +4046,7 @@
  * 
  * RETURN: log file descriptor
  * 
- * Be sure to call this function with correct seteuid/setegid settings!
+ * Be sure to call this function with correct setuid/setgid settings!
  */
 int openuserlog(const char *log) {
   int 
@@ -4056,8 +4056,8 @@
   struct stat finfo;	/* information about a file */
 
   /* security check */
-  if (rgid!=getegid()) { if (setegid(rgid)<0) return(0); }
-  if (ruid!=geteuid()) { if (seteuid(ruid)<0) return(0); }
+  if (rgid!=getegid()) { if (setgid(rgid)<0) return(0); }
+  if (ruid!=geteuid()) { if (setuid(ruid)<0) return(0); }
   
   /* create logfile if not there */
   close(open(log,O_CREAT|O_EXCL,S_IRUSR|S_IWUSR));
@@ -4173,13 +4173,13 @@
  * RETURN: nothing, but terminates program on error
  */
 void setreugid() {
-  if (rgid && setegid(rgid)<0) {
-    printf("490 Internal error on setegid(%u): %s\r\n",
+  if (rgid && setgid(rgid)<0) {
+    printf("490 Internal error on setgid(%u): %s\r\n",
 	   (unsigned int)rgid,strerror(errno));
     exit(1);
   }
-  if (ruid && seteuid(ruid)<0) {
-    printf("490 Internal error on seteuid(%u): %s\r\n",
+  if (ruid && setuid(ruid)<0) {
+    printf("490 Internal error on setuid(%u): %s\r\n",
 	   (unsigned int)ruid,strerror(errno));
     exit(1);
   }
@@ -4215,8 +4215,8 @@
   /* change user */
   /* note: setuid does not work if euid>0 ! STUPID! */
   chdir(pwe->pw_dir);
-  seteuid(0);
-  setegid(0);
+  setuid(0);
+  setgid(0);
   if (setgid(pwe->pw_gid)<0) exit(1);
   initgroups(user,pwe->pw_gid);
   if (setuid(pwe->pw_uid)<0) exit(1);
