Front page | perl.perl5.porters |
Postings from October 2003
[PATCH bleadperl] (was Re: Is this brokenness in $< $( $> & $) ?)
Thread Previous
|
Thread Next
From:
Rick Delaney
Date:
October 27, 2003 12:25
Subject:
[PATCH bleadperl] (was Re: Is this brokenness in $< $( $> & $) ?)
Message ID:
20031027152413.G2233@biff.bort.ca
On Mon, Oct 27, 2003 at 04:53:11PM +0000, Alan Burlison wrote:
>
> According to the setreuid/setregid manpages, the first parameter (real
> uid/gid) should be -1 to specify 'no change'.
Does the following patch work for you? Note that lines 1088 and 1123
(the very last changed line) are not related to your issue but were
obviously wrong before (unless I'm totally misreading things).
Also, can someone tell me what I have configured wrong that
print $>;
does not print the euid. I have this problem in blead and 5.8.0 but not
5.6.1 (which is the only one I didn't compile myself). It makes this a
little hard to test.
--
Rick Delaney
rick@bort.ca
--- pp_hot.c.orig Mon Oct 27 14:49:30 2003
+++ pp_hot.c Mon Oct 27 15:12:44 2003
@@ -1066,10 +1066,16 @@
if (PL_delaymagic & ~DM_DELAY) {
if (PL_delaymagic & DM_UID) {
#ifdef HAS_SETRESUID
- (void)setresuid(PL_uid,PL_euid,(Uid_t)-1);
+ (void)setresuid( ((PL_delaymagic & DM_UID) == DM_RUID
+ ? PL_uid : (Uid_t)-1),
+ ((PL_delaymagic & DM_UID) == DM_EUID
+ ? PL_euid : (Uid_t)-1), (Uid_t)-1);
#else
# ifdef HAS_SETREUID
- (void)setreuid(PL_uid,PL_euid);
+ (void)setreuid( ((PL_delaymagic & DM_UID) == DM_RUID
+ ? PL_uid : (Uid_t)-1),
+ ((PL_delaymagic & DM_UID) == DM_EUID
+ ? PL_euid : (Uid_t)-1) );
# else
# ifdef HAS_SETRUID
if ((PL_delaymagic & DM_UID) == DM_RUID) {
@@ -1079,7 +1085,7 @@
# endif /* HAS_SETRUID */
# ifdef HAS_SETEUID
if ((PL_delaymagic & DM_UID) == DM_EUID) {
- (void)seteuid(PL_uid);
+ (void)seteuid(PL_euid);
PL_delaymagic &= ~DM_EUID;
}
# endif /* HAS_SETEUID */
@@ -1095,10 +1101,16 @@
}
if (PL_delaymagic & DM_GID) {
#ifdef HAS_SETRESGID
- (void)setresgid(PL_gid,PL_egid,(Gid_t)-1);
+ (void)setresgid( ((PL_delaymagic & DM_GID) == DM_RGID
+ ? PL_gid : (Gid_t)-1),
+ ((PL_delaymagic & DM_GID) == DM_EGID
+ ? PL_egid : (Gid_t)-1), (Gid_t)-1);
#else
# ifdef HAS_SETREGID
- (void)setregid(PL_gid,PL_egid);
+ (void)setregid( ((PL_delaymagic & DM_GID) == DM_RGID
+ ? PL_gid : (Gid_t)-1),
+ ((PL_delaymagic & DM_GID) == DM_EGID
+ ? PL_egid : (Gid_t)-1) );
# else
# ifdef HAS_SETRGID
if ((PL_delaymagic & DM_GID) == DM_RGID) {
@@ -1108,7 +1120,7 @@
# endif /* HAS_SETRGID */
# ifdef HAS_SETEGID
if ((PL_delaymagic & DM_GID) == DM_EGID) {
- (void)setegid(PL_gid);
+ (void)setegid(PL_egid);
PL_delaymagic &= ~DM_EGID;
}
# endif /* HAS_SETEGID */
Thread Previous
|
Thread Next