1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-10 07:04:03 +00:00

- Update to 1.8.5

A bugs fix release.
This commit is contained in:
Sergey Matveychuk 2006-08-27 09:53:28 +00:00
parent e84761b406
commit 1e52ae8d80
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=171457
10 changed files with 7919 additions and 526 deletions

View File

@ -136,7 +136,7 @@ _RUBY_SITEDIR!= ${_RUBY_CONFIG} 'puts C["sitedir"]'
RUBY?= ${LOCALBASE}/bin/${RUBY_NAME}
.if defined(RUBY_VER) && ${RUBY_VER} == 1.8
RUBY_VERSION?= 1.8.4
RUBY_VERSION?= 1.8.5
#RUBY_DISTVERSION?= ${RUBY_VERSION}
#RUBY_PATCHFILES?= ruby-${RUBY_DISTVERSION}-yyyy.mm.dd.diff.bz2

View File

@ -7,7 +7,6 @@
PORTNAME= ruby
PORTVERSION= ${RUBY_PORTVERSION}
PORTREVISION= 9
PORTEPOCH= 1
CATEGORIES= lang ruby ipv6
MASTER_SITES= ${MASTER_SITE_RUBY}
@ -38,7 +37,8 @@ RUBY_NO_RUN_DEPENDS= yes
GNU_CONFIGURE= yes
WRKSRC= ${RUBY_WRKSRC}
CONFIGURE_ARGS= ${RUBY_CONFIGURE_ARGS} \
--enable-shared --with-openssl-include=${OPENSSLINC}
--enable-shared --with-openssl-include=${OPENSSLINC} \
--mandir=${PREFIX}/man
.if defined(WITH_PTHREADS)
CONFIGURE_ARGS+=--enable-pthread
@ -54,6 +54,7 @@ STRIP= # none
USE_LDCONFIG= yes
MAN1= ${RUBY_NAME}.1
#NOMANCOMPRESS= yes
.include <bsd.port.pre.mk>

View File

@ -1,3 +1,3 @@
MD5 (ruby/ruby-1.8.4.tar.gz) = bd8c2e593e1fa4b01fd98eaf016329bb
SHA256 (ruby/ruby-1.8.4.tar.gz) = 71432841b3965b7ab2d83f0dc7c3049195ea4e9267a8dc2d825a8a0466982930
SIZE (ruby/ruby-1.8.4.tar.gz) = 4312965
MD5 (ruby/ruby-1.8.5.tar.gz) = 3fbb02294a8ca33d4684055adba5ed6f
SHA256 (ruby/ruby-1.8.5.tar.gz) = 19590e972b80333e26a6514c34d976c2037138361481a16f27b75e5d33f33a58
SIZE (ruby/ruby-1.8.5.tar.gz) = 4438603

View File

@ -1,30 +0,0 @@
--- dir.c.orig Thu Jul 13 01:48:12 2006
+++ dir.c Thu Jul 13 01:49:53 2006
@@ -325,7 +325,17 @@
rb_raise(rb_eIOError, "closed directory");
}
+static void
+dir_check(dir)
+ VALUE dir;
+{
+ if (!OBJ_TAINTED(dir) && rb_safe_level() >= 4)
+ rb_raise(rb_eSecurityError, "Insecure: operation on untainted Dir");
+ rb_check_frozen(dir);
+}
+
#define GetDIR(obj, dirp) do {\
+ dir_check(dir);\
Data_Get_Struct(obj, struct dir_data, dirp);\
if (dirp->dir == NULL) dir_closed();\
} while (0)
@@ -535,6 +545,9 @@
{
struct dir_data *dirp;
+ if (rb_safe_level() >= 4 && !OBJ_TAINTED(dir)) {
+ rb_raise(rb_eSecurityError, "Insecure: can't close");
+ }
GetDIR(dir, dirp);
closedir(dirp->dir);
dirp->dir = NULL;

View File

@ -1,129 +0,0 @@
Index: eval.c
diff -u -p eval.c.orig eval.c
--- eval.c.orig Tue Dec 20 22:41:47 2005
+++ eval.c Mon Jan 23 10:01:51 2006
@@ -108,7 +108,7 @@ rb_jump_context(env, val)
abort(); /* ensure noreturn */
}
/*
- * FUNCTION_CALL_MAY_RETURN_TWICE is a magic for getcontext, gcc,
+ * PRE_GETCONTEXT and POST_GETCONTEXT is a magic for getcontext, gcc,
* IA64 register stack and SPARC register window combination problem.
*
* Assume following code sequence.
@@ -129,42 +129,88 @@ rb_jump_context(env, val)
* But it has not the problem because gcc knows setjmp may return twice.
* gcc detects setjmp and generates setjmp safe code.
*
- * So setjmp call before getcontext call makes the code somewhat safe.
+ * So setjmp calls before and after the getcontext call makes the code
+ * somewhat safe.
* It fix the problem on IA64.
* It is not required that setjmp is called at run time, since the problem is
* register usage.
*
* Since the magic setjmp is not enough for SPARC,
* inline asm is used to prohibit registers in register windows.
- */
-#if defined (__GNUC__) && (defined(sparc) || defined(__sparc__))
-#define FUNCTION_CALL_MAY_RETURN_TWICE \
- ({ __asm__ volatile ("" : : : \
- "%o0", "%o1", "%o2", "%o3", "%o4", "%o5", "%o7", \
- "%l0", "%l1", "%l2", "%l3", "%l4", "%l5", "%l6", "%l7", \
- "%i0", "%i1", "%i2", "%i3", "%i4", "%i5", "%i7"); })
-#else
+ *
+ * Since the problem is fixed at gcc 4.0.3, the magic is applied only for
+ * prior versions of gcc.
+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21957
+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22127
+ */
+# define GCC_VERSION_BEFORE(major, minor, patchlevel) \
+ (defined(__GNUC__) && !defined(__INTEL_COMPILER) && \
+ ((__GNUC__ < (major)) || \
+ (__GNUC__ == (major) && __GNUC_MINOR__ < (minor)) || \
+ (__GNUC__ == (major) && __GNUC_MINOR__ == (minor) && __GNUC_PATCHLEVEL__ < (patchlevel))))
+# if GCC_VERSION_BEFORE(4,0,3) && (defined(sparc) || defined(__sparc__))
+# ifdef __pic__
+/*
+ * %l7 is excluded for PIC because it is PIC register.
+ * http://lists.freebsd.org/pipermail/freebsd-sparc64/2006-January/003739.html
+ */
+# define PRE_GETCONTEXT \
+ ({ __asm__ volatile ("" : : : \
+ "%o0", "%o1", "%o2", "%o3", "%o4", "%o5", "%o7", \
+ "%l0", "%l1", "%l2", "%l3", "%l4", "%l5", "%l6", \
+ "%i0", "%i1", "%i2", "%i3", "%i4", "%i5", "%i7"); })
+# else
+# define PRE_GETCONTEXT \
+ ({ __asm__ volatile ("" : : : \
+ "%o0", "%o1", "%o2", "%o3", "%o4", "%o5", "%o7", \
+ "%l0", "%l1", "%l2", "%l3", "%l4", "%l5", "%l6", "%l7", \
+ "%i0", "%i1", "%i2", "%i3", "%i4", "%i5", "%i7"); })
+# endif
+# define POST_GETCONTEXT PRE_GETCONTEXT
+# elif GCC_VERSION_BEFORE(4,0,3) && defined(__ia64)
static jmp_buf function_call_may_return_twice_jmp_buf;
-int function_call_may_return_twice_false = 0;
-#define FUNCTION_CALL_MAY_RETURN_TWICE \
- (function_call_may_return_twice_false ? \
- setjmp(function_call_may_return_twice_jmp_buf) : \
- 0)
-#endif
-#define ruby_longjmp(env, val) rb_jump_context(env, val)
-#define ruby_setjmp(j) ((j)->status = 0, \
- FUNCTION_CALL_MAY_RETURN_TWICE, \
- getcontext(&(j)->context), \
- (j)->status)
+int function_call_may_return_twice_false_1 = 0;
+int function_call_may_return_twice_false_2 = 0;
+# define PRE_GETCONTEXT \
+ (function_call_may_return_twice_false_1 ? \
+ setjmp(function_call_may_return_twice_jmp_buf) : \
+ 0)
+# define POST_GETCONTEXT \
+ (function_call_may_return_twice_false_2 ? \
+ setjmp(function_call_may_return_twice_jmp_buf) : \
+ 0)
+# elif defined(__FreeBSD__)
+/*
+ * workaround for FreeBSD/i386 getcontext/setcontext bug.
+ * clear the carry flag by (0 ? ... : ...).
+ * FreeBSD PR 92110 http://www.freebsd.org/cgi/query-pr.cgi?pr=92110
+ * [ruby-dev:28263]
+ */
+static int volatile freebsd_clear_carry_flag = 0;
+# define PRE_GETCONTEXT \
+ (freebsd_clear_carry_flag ? (freebsd_clear_carry_flag = 0) : 0)
+# endif
+# ifndef PRE_GETCONTEXT
+# define PRE_GETCONTEXT 0
+# endif
+# ifndef POST_GETCONTEXT
+# define POST_GETCONTEXT 0
+# endif
+# define ruby_longjmp(env, val) rb_jump_context(env, val)
+# define ruby_setjmp(j) ((j)->status = 0, \
+ PRE_GETCONTEXT, \
+ getcontext(&(j)->context), \
+ POST_GETCONTEXT, \
+ (j)->status)
#else
typedef jmp_buf rb_jmpbuf_t;
-#if !defined(setjmp) && defined(HAVE__SETJMP)
-#define ruby_setjmp(env) _setjmp(env)
-#define ruby_longjmp(env,val) _longjmp(env,val)
-#else
-#define ruby_setjmp(env) setjmp(env)
-#define ruby_longjmp(env,val) longjmp(env,val)
-#endif
+# if !defined(setjmp) && defined(HAVE__SETJMP)
+# define ruby_setjmp(env) _setjmp(env)
+# define ruby_longjmp(env,val) _longjmp(env,val)
+# else
+# define ruby_setjmp(env) setjmp(env)
+# define ruby_longjmp(env,val) longjmp(env,val)
+# endif
#endif
#include <sys/types.h>

View File

@ -1,35 +0,0 @@
--- eval.c.orig Thu Jul 13 01:48:12 2006
+++ eval.c Thu Jul 13 01:49:37 2006
@@ -2050,7 +2050,8 @@
}
}
st_insert(RCLASS(klass)->m_tbl, name,
- (st_data_t)NEW_METHOD(NEW_FBODY(body, def, origin), orig->nd_noex));
+ (st_data_t)NEW_METHOD(NEW_FBODY(body, def, origin),
+ NOEX_WITH_SAFE(orig->nd_noex)));
if (singleton) {
rb_funcall(singleton, singleton_added, 1, ID2SYM(name));
}
@@ -5561,6 +5562,11 @@
TMP_PROTECT;
volatile int safe = -1;
+ if (NOEX_SAFE(flags) > ruby_safe_level &&
+ !(flags&NOEX_TAINTED) && ruby_safe_level == 0 && NOEX_SAFE(flags) > 2) {
+ rb_raise(rb_eSecurityError, "calling insecure method: %s",
+ rb_id2name(id));
+ }
switch (ruby_iter->iter) {
case ITER_PRE:
itr = ITER_CUR;
@@ -5664,10 +5670,6 @@
b2 = body = body->nd_next;
if (NOEX_SAFE(flags) > ruby_safe_level) {
- if (!(flags&NOEX_TAINTED) && ruby_safe_level == 0 && NOEX_SAFE(flags) > 2) {
- rb_raise(rb_eSecurityError, "calling insecure method: %s",
- rb_id2name(id));
- }
safe = ruby_safe_level;
ruby_safe_level = NOEX_SAFE(flags);
}

View File

@ -0,0 +1,11 @@
--- ext/dbm/extconf.rb.orig Sat Aug 26 20:04:57 2006
+++ ext/dbm/extconf.rb Sat Aug 26 21:48:20 2006
@@ -55,7 +55,7 @@
have_header("cdefs.h")
have_header("sys/cdefs.h")
-if /DBM_HDR/ =~ $CFLAGS and have_func(db_prefix("dbm_open"))
+if $defs.each { |d| /DBM_HDR/ =~ d } and have_func(db_prefix("dbm_open"))
have_func(db_prefix("dbm_clearerr")) unless $dbm_conf_have_gdbm
create_makefile("dbm")
end

View File

@ -1,10 +0,0 @@
--- lib/fileutils.rb.orig Sun Nov 20 02:23:41 2005
+++ lib/fileutils.rb Mon Jan 16 02:08:47 2006
@@ -501,6 +501,7 @@
File.rename s, d
rescue Errno::EXDEV
copy_entry s, d, true
+ File.unlink s
end
rescue SystemCallError
raise unless options[:force]

View File

@ -1,11 +0,0 @@
--- re.c.orig Thu Jul 13 01:48:12 2006
+++ re.c Thu Jul 13 01:49:45 2006
@@ -1330,6 +1330,8 @@
{
struct RRegexp *re = RREGEXP(obj);
+ if (!OBJ_TAINTED(obj) && rb_safe_level() >= 4)
+ rb_raise(rb_eSecurityError, "Insecure: can't modify regexp");
if (re->ptr) re_free_pattern(re->ptr);
if (re->str) free(re->str);
re->ptr = 0;

File diff suppressed because it is too large Load Diff