[#8484] strptime fails to properly parse certain inputs — <noreply@...>

Bugs item #5263, was opened at 2006-08-01 23:14

13 messages 2006/08/02
[#8485] Re: [ ruby-Bugs-5263 ] strptime fails to properly parse certain inputs — Yukihiro Matsumoto <matz@...> 2006/08/02

Hi,

[#8538] Re: [ ruby-Bugs-5263 ] strptime fails to properly parse certain inputs — nobu@... 2006/08/06

Hi,

[#8561] sandbox timers & block scopes — why the lucky stiff <ruby-core@...>

Two puzzles I am trying to solve:

28 messages 2006/08/08
[#8624] Re: sandbox timers & block scopes — why the lucky stiff <ruby-core@...> 2006/08/15

raise ThisDecayingInquisition, "anyone? anyone at all?"

[#8627] Re: sandbox timers & block scopes — MenTaLguY <mental@...> 2006/08/15

On Wed, 2006-08-16 at 00:35 +0900, why the lucky stiff wrote:

[#8628] Re: sandbox timers & block scopes — why the lucky stiff <ruby-core@...> 2006/08/15

On Wed, Aug 16, 2006 at 02:46:30AM +0900, MenTaLguY wrote:

[#8629] Re: sandbox timers & block scopes — "Charles O Nutter" <headius@...> 2006/08/15

On 8/15/06, why the lucky stiff <ruby-core@whytheluckystiff.net> wrote:

[#8690] a ruby-core primer — why the lucky stiff <ruby-core@...>

Hello, all. I've been working on the ruby-core page for the new Ruby site.

21 messages 2006/08/22

Re: [ ruby-Bugs-5351 ] Process.gid= fails on OS X

From: nobu@...
Date: 2006-08-11 04:17:06 UTC
List: ruby-core #8590
Hi,

At Fri, 11 Aug 2006 11:06:46 +0900,
Kazuhiro NISHIYAMA wrote in [ruby-core:08589]:
> Mac-mini:~ kazu$ sudo ~/opt/ruby18/bin/ruby -e 'include Process::Sys' -e 'p setregid(502, getegid)'
> -e:2:in `setregid': Operation not permitted (Errno::EPERM)
>         from -e:2
> Mac-mini:~ kazu$

Okay.  Since it feels a show-stopper, I'd like to commit it
before 1.8.5 release as soon as possible.


* process.c (proc_setuid, proc_setgid, proc_seteuid, proc_setegid):
  get rid of bogus implementations on Mac OS X.


Index: process.c
===================================================================
RCS file: /cvs/ruby/src/ruby/process.c,v
retrieving revision 1.92.2.33
diff -p -U 2 -r1.92.2.33 process.c
--- process.c	25 Jul 2006 04:58:15 -0000	1.92.2.33
+++ process.c	11 Aug 2006 02:41:19 -0000
@@ -2153,6 +2153,21 @@ proc_setuid(obj, id)
  */
 
-static int SAVED_USER_ID;
+static int SAVED_USER_ID = -1;
 
+#ifdef BROKEN_SETREUID
+int
+setreuid(ruid, euid)
+    rb_uid_t ruid, euid;
+{
+    if (ruid != -1 && ruid != getuid()) {
+	if (euid == -1) euid = geteuid();
+	if (setuid(ruid) < 0) return -1;
+    }
+    if (euid != -1 && euid != geteuid()) {
+	if (seteuid(euid) < 0) return -1;
+    }
+    return 0;
+}
+#endif
 
 /*
@@ -2498,5 +2513,5 @@ proc_setgid(obj, id)
     if (setregid(gid, -1) < 0) rb_sys_fail(0);
 #elif defined HAVE_SETRGID
-    if (setrgid((GIDTYPE)gid) < 0) rb_sys_fail(0);
+    if (setrgid(gid) < 0) rb_sys_fail(0);
 #elif defined HAVE_SETGID
     {
@@ -2703,6 +2718,21 @@ proc_setmaxgroups(VALUE obj, VALUE val)
  */
 
-static int SAVED_GROUP_ID;
+static int SAVED_GROUP_ID = -1;
 
+#ifdef BROKEN_SETREGID
+int
+setregid(rgid, egid)
+    rb_gid_t rgid, egid;
+{
+    if (rgid != -1 && rgid != getgid()) {
+	if (egid == -1) egid = getegid();
+	if (setgid(rgid) < 0) return -1;
+    }
+    if (egid != -1 && egid != getegid()) {
+	if (setegid(egid) < 0) return -1;
+    }
+    return 0;
+}
+#endif
 
 /*


-- 
Nobu Nakada

In This Thread