[Fedora-directory-devel] Please review: (200988) mod_admserv: use setresuid() in lieu of seteuid() on HP-UX
Ulf Weltman
ulf.weltman at hp.com
Tue Aug 8 19:52:46 UTC 2006
Tested OK on HP-UX B.11.11.
Rob Crittenden wrote:
> 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: ???
> 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. I've only
> tested that it won't break FC, not that it works on HP/ux (but it
> seems obvious that it will). Maybe we can get Ulf's help in testing...
> Platforms tested: FC4
> 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 */
>
>
>
>------------------------------------------------------------------------
>
>--
>Fedora-directory-devel mailing list
>Fedora-directory-devel at redhat.com
>https://www.redhat.com/mailman/listinfo/fedora-directory-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/fedora-directory-devel/attachments/20060808/553fe8a1/attachment.htm>
More information about the Fedora-directory-devel
mailing list