zookeeper 1.2.3 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ v1.2.4 fix buffer overflow in CZookeeper client_id code
2
+
3
+ * the 'passwd' part of the struct is a char[16], but isn't null terminated.
4
+ use rb_str_new with an explicit length, rather than rb_str_new2 which
5
+ uses strlen().
6
+
1
7
  v1.2.3 ensure that all threads are woken up on shutdown
2
8
 
3
9
  * There was an edge case where a call would be queued up and its thread
data/ext/Rakefile CHANGED
@@ -17,7 +17,7 @@ namespace :zkrb do
17
17
  end
18
18
 
19
19
  task :clobber => :clean do
20
- rm_rf %w[Makefile c lib bin include]
20
+ rm_rf %w[Makefile c lib bin include ._c]
21
21
  end
22
22
  end
23
23
 
data/ext/c_zookeeper.rb CHANGED
@@ -84,6 +84,8 @@ class CZookeeper
84
84
 
85
85
  log_level = ENV['ZKC_DEBUG'] ? ZOO_LOG_LEVEL_DEBUG : ZOO_LOG_LEVEL_ERROR
86
86
 
87
+ logger.info { "initiating connection to #{@host}" }
88
+
87
89
  zkrb_init(@host)#, :zkc_log_level => log_level)
88
90
 
89
91
  start_event_thread
data/ext/extconf.rb CHANGED
@@ -26,7 +26,7 @@ end
26
26
 
27
27
  ZK_DEBUG = (ENV['DEBUG'] or ARGV.any? { |arg| arg == '--debug' })
28
28
  ZK_DEV = ENV['ZK_DEV']
29
- DEBUG_CFLAGS = " -O0 -ggdb3 -DHAVE_DEBUG"
29
+ DEBUG_CFLAGS = " -O0 -ggdb3 -DHAVE_DEBUG -fstack-protector-all"
30
30
 
31
31
  if ZK_DEBUG
32
32
  $stderr.puts "*** Setting debug flags. ***"
@@ -61,6 +61,9 @@ Dir.chdir(HERE) do
61
61
  raise "'#{cmd}' failed" unless system(cmd)
62
62
  end
63
63
 
64
+ # clean up stupid apple rsrc fork bullshit
65
+ FileUtils.rm_f(Dir['**/._*'].select{|p| test(?f, p)})
66
+
64
67
  Dir.chdir(BUNDLE_PATH) do
65
68
  configure = "./configure --prefix=#{HERE} --with-pic --without-cppunit --disable-dependency-tracking #{$EXTRA_CONF} 2>&1"
66
69
  configure = "env CFLAGS='#{DEBUG_CFLAGS}' #{configure}" if ZK_DEBUG
data/ext/zkrb.c CHANGED
@@ -885,15 +885,15 @@ static VALUE method_client_id(VALUE self) {
885
885
  char buf[32];
886
886
  const clientid_t *cid = zoo_client_id(zk->zh);
887
887
 
888
- if (strlen(cid->passwd) != 16) {
889
- zkrb_debug("passwd is not null-terminated");
890
- } else {
891
- hexbufify(buf, cid->passwd, 16);
892
- zkrb_debug("password in hex is: %s", buf);
893
- }
888
+ /* if (strlen(cid->passwd) != 16) { */
889
+ /* zkrb_debug("passwd is not null-terminated");*/
890
+ /* } else {*/
891
+ /* hexbufify(buf, cid->passwd, 16);*/
892
+ /* zkrb_debug("password in hex is: %s", buf);*/
893
+ /* }*/
894
894
 
895
895
  VALUE session_id = LL2NUM(cid->client_id);
896
- VALUE passwd = rb_str_new2(cid->passwd);
896
+ VALUE passwd = rb_str_new(cid->passwd, 16);
897
897
 
898
898
  VALUE client_id_obj = rb_class_new_instance(0, RARRAY_PTR(rb_ary_new()), ZookeeperClientId);
899
899
 
@@ -1,4 +1,4 @@
1
1
  module Zookeeper
2
- VERSION = '1.2.3'
2
+ VERSION = '1.2.4'
3
3
  DRIVER_VERSION = '3.3.5'
4
4
  end
@@ -7,6 +7,10 @@ module Zookeeper
7
7
  !!ENV['TRAVIS']
8
8
  end
9
9
 
10
+ def self.default_cnx_host
11
+ ENV['ZK_DEFAULT_HOST'] || 'localhost'
12
+ end
13
+
10
14
  @test_port ||= spawn_zookeeper? ? 21811 : 2181
11
15
 
12
16
  class << self
@@ -14,7 +18,7 @@ module Zookeeper
14
18
  end
15
19
 
16
20
  def self.default_cnx_str
17
- "localhost:#{test_port}"
21
+ "#{default_cnx_host}:#{test_port}"
18
22
  end
19
23
  end
20
24
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zookeeper
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 3
10
- version: 1.2.3
9
+ - 4
10
+ version: 1.2.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Phillip Pearson
@@ -20,7 +20,7 @@ autorequire:
20
20
  bindir: bin
21
21
  cert_chain: []
22
22
 
23
- date: 2012-05-23 00:00:00 Z
23
+ date: 2012-05-24 00:00:00 Z
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: backports