Skip to content

Instantly share code, notes, and snippets.

View hsbt's full-sized avatar
🏠
Working from home

Hiroshi SHIBATA hsbt

🏠
Working from home
View GitHub Profile
commit 90c4279d75041a3c0969665ca8d441140b7d4ad3
Author: SHIBATA Hiroshi <[email protected]>
Date: Tue Aug 29 21:40:58 2017 +0900
Update patches description for Ruby 2.4.1
diff --git ja/news/_posts/2017-08-29-multiple-vulnerabilities-in-rubygems.md ja/news/_posts/2017-08-29-multiple-vulnerabilities-in-rubygems.md
index 8d5bb16f..7afc13e9 100644
--- ja/news/_posts/2017-08-29-multiple-vulnerabilities-in-rubygems.md
+++ ja/news/_posts/2017-08-29-multiple-vulnerabilities-in-rubygems.md
@hsbt
hsbt / activated_issue.md
Last active August 28, 2017 06:37
Gem activate issue with default gems.

いくつかの default gem を Bundler を利用してバージョンを固定して使おうとした場合、現在の Rubygems/Bundler/Ruby の仕様ではユーザーが指定したバージョンでは利用できないケースがあります。

例えば

$ ruby -v
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin17]
$ gem list | grep openssl
openssl (2.0.5, 2.0.4, default: 2.0.3)
~/D/g/r/rubygems (master) > env GEMSRC_SKIP=true rake test
/Users/hsbt/.rbenv/versions/2.5.0-dev/bin/ruby -w -Ilib:bin:test:. --disable-gems -e 'require "rubygems"; gem "minitest", "~> 4.0"; $:.unshift "/Users/hsbt/Documents/github.com/rubygems/rubygems/bundler/lib";; require "minitest/autorun"; require "test/rubygems/test_bundled_ca.rb"; require "test/rubygems/test_config.rb"; require "test/rubygems/test_deprecate.rb"; require "test/rubygems/test_gem.rb"; require "test/rubygems/test_gem_available_set.rb"; require "test/rubygems/test_gem_command.rb"; require "test/rubygems/test_gem_command_manager.rb"; require "test/rubygems/test_gem_commands_build_command.rb"; require "test/rubygems/test_gem_commands_cert_command.rb"; require "test/rubygems/test_gem_commands_check_command.rb"; require "test/rubygems/test_gem_commands_cleanup_command.rb"; require "test/rubygems/test_gem_commands_contents_command.rb"; require "test/rubygems/test_gem_commands_dependency_command.rb"; require "test/rubygems/test_gem_commands_e
svn@svn:~$ cat ~svn/.ssh/authorized_keys | awk '{print $5}' | sed 's/--tunnel-user=//' | sed 's/"//' | sort | uniq
aamine
akira
akiyoshi
akr
a_matsuda
arton
ayumin
azav
chad
~/D/g/r/scanf (master) > git filter-branch --prune-empty --index-filter '
git rm --cached -qr --ignore-unmatch . &&
git reset -q $GIT_COMMIT -- ext/stringio test/stringio &&
git rm --cached -qr --ignore-unmatch ext/stringio/depend ext/stringio/.cvsignore
' -- HEAD
cd /tmp; rm -rf ruby; mkdir ruby; cd ruby; svn co http://svn.ruby-lang.org/repos/ruby/trunk/tool; rm -rf ~ftp/pub/ruby/stable-snapshot.*; ~/.rbenv/shims/ruby tool/make-snapshot -archname=stable-snapshot ~ftp/pub/ruby branches/ruby_2_4
~/D/g/r/ruby.build23 > make
CC = clang
LD = ld
LDSHARED = clang -dynamic -bundle
CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -pipe
XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT -fPIE
CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I. -I.ext/include/x86_64-darwin16 -I../ruby/include -I../ruby
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -fstack-protector -Wl,-u,_objc_msgSend -Wl,-pie -framework CoreFoundation
SOLIBS = -lgmp
Apple LLVM version 8.1.0 (clang-802.0.42)
This file has been truncated, but you can view the full file.
+ DUALCASE=1
+ export DUALCASE
+ test -n ''
+ case `(set -o) 2>/dev/null` in
+ :
+ set -o posix
+ as_nl='
'
+ export as_nl
+ as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'

x86

..\ruby\win32\configure.bat --without-ext=+,dbm,gdbm,readline --enable-bundled-libffi --with-zlib-include=C:/opt/zlib-1.2.11 --with-zlib-lib=C:/opt/zlib-1.2.11/x86 --with-openssl-include=C:/opt/libressl-2.5.3-windows/include --with-openssl-lib=C:/opt/libressl-2.5.3-windows/x86

x64

..\ruby\win32\configure.bat --without-ext=+,dbm,gdbm,readline --enable-bundled-libffi --with-zlib-include=C:/opt/zlib-1.2.11 --with-zlib-lib=C:/opt/zlib-1.2.11/x64 --with-openssl-include=C:/opt/libressl-2.5.3-windows/include --with-openssl-lib=C:/opt/libressl-2.5.3-windows/x64

require 'yaml'
r = {}
File.open('dot.zsh-history') do |f|
r = f.each_line.inject([]) do |a, l|
a << { "cmd" => l[15..-1].to_s.scrub.strip, "when" => l[1..11].to_i }
end
end
File.open('fish_history', 'w'){|f| f.write r.to_yaml(options = { line_width: -1 })}