[Fedora-directory-devel] Commmit: (200988) mod_admserv: use setresuid() in lieu of seteuid() on HP-UX

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=200988
Bug(s) fixed: 200988
Bug Description: mod_admserv: use setresuid() in lieu of seteuid() on HP/ux
Reviewed by: Rich and Ulf
Files: See diff
Branch: HEAD
Fix Description: Per Ulf's suggestion, use SETEUID macro. apxs will
define -DHPUX11 on an HP/ux machine causing this code to be executed. I
also included a generic HPUX and HPUX10 for completeness.
Platforms tested: FC4, HPUX11
Flag Day: no
Doc impact: no
QA impact: no

Index: mod_admserv.c
===================================================================
RCS file: /cvs/dirsec/mod_admserv/mod_admserv.c,v
retrieving revision 1.26
diff -u -r1.26 mod_admserv.c
--- mod_admserv.c	17 Jul 2006 19:01:29 -0000	1.26
+++ mod_admserv.c	8 Aug 2006 19:27:55 -0000
@@ -65,6 +65,12 @@
 
 #include "mod_admserv.h"
 
+#if defined(HPUX) || defined(HPUX10) || defined(HPUX11)
+#define SETEUID(id) setresuid((uid_t) -1, id, (uid_t) -1)
+#else
+#define SETEUID(id) seteuid(id)
+#endif
+
 /*
  * These are keys for items we store in r->notes to pass data from one stage
  * in the request to another.  They must be unique.  If necessary, prefix
@@ -2031,7 +2037,7 @@
 #ifdef CHANGE_EUID
     /* make sure pset creates the cache file owned by the server uid, not root */
     if (geteuid() == 0) {
-        seteuid(unixd_config.user_id);
+        SETEUID(unixd_config.user_id);
         reseteuid = 1;
     }
 #endif /* CHANGE_EUID */
@@ -2044,7 +2050,7 @@
 
 #ifdef CHANGE_EUID
     if (reseteuid) {
-        seteuid(0);
+        SETEUID(0);
     }
 #endif /* CHANGE_EUID */
 

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


[Index of Archives]     [Fedora Directory Announce]     [Fedora Users]     [Older Fedora Users Mail]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Review]     [Fedora Art]     [Fedora Music]     [Fedora Packaging]     [CentOS]     [Fedora SELinux]     [Big List of Linux Books]     [KDE Users]     [Fedora Art]     [Fedora Docs]

  Powered by Linux