activesambaldap 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/NEWS.en CHANGED
@@ -2,7 +2,11 @@
2
2
 
3
3
  = NEWS.en
4
4
 
5
- $Id: NEWS.en 119 2007-09-16 13:14:27Z kou $
5
+ $Id: NEWS.en 132 2007-11-19 11:53:22Z kou $
6
+
7
+ == 0.0.5: 2007-11-19
8
+
9
+ * Supported Ruby/ActiveLdap 0.9.0.
6
10
 
7
11
  == 0.0.4: 2007-09-16
8
12
 
data/NEWS.ja CHANGED
@@ -2,7 +2,11 @@
2
2
 
3
3
  = NEWS.ja
4
4
 
5
- $Id: NEWS.ja 119 2007-09-16 13:14:27Z kou $
5
+ $Id: NEWS.ja 132 2007-11-19 11:53:22Z kou $
6
+
7
+ == 0.0.5: 2007-11-19
8
+
9
+ * Ruby/ActiveLdap 0.9.0対応。
6
10
 
7
11
  == 0.0.4: 2007-09-16
8
12
 
data/README.en CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  = README.en
4
4
 
5
- $Id: README.en 120 2007-09-16 13:17:37Z kou $
5
+ $Id: README.en 132 2007-11-19 11:53:22Z kou $
6
6
 
7
7
  == Name
8
8
 
@@ -37,7 +37,7 @@ asl-devel@rubyforge.org
37
37
 
38
38
  == Dependency libraries
39
39
 
40
- * ActiveLdap >= 0.8.3.1
40
+ * ActiveLdap >= 0.9.0
41
41
 
42
42
  == Usage
43
43
 
@@ -330,3 +330,4 @@ asl-populate, please confirm the following:
330
330
  == Thanks
331
331
 
332
332
  * Henrik Krög: He reported some bugs.
333
+ * Olivier DIRRENBERGER: He reported a bug.
data/README.ja CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  = README.ja
4
4
 
5
- $Id: README.ja 120 2007-09-16 13:17:37Z kou $
5
+ $Id: README.ja 132 2007-11-19 11:53:22Z kou $
6
6
 
7
7
  == 名前
8
8
 
@@ -34,7 +34,7 @@ asl-devel-ja@rubyforge.org
34
34
 
35
35
  == 依存ライブラリ
36
36
 
37
- * ActiveLdap >= 0.8.3.1
37
+ * ActiveLdap >= 0.9.0
38
38
 
39
39
  == 使用法
40
40
 
@@ -325,3 +325,4 @@ LDAP管理ユーザのパスワードを設定しておく必要があります
325
325
  == 感謝
326
326
 
327
327
  * Henrik Krög: バグを報告してくれました。
328
+ * Olivier DIRRENBERGER: バグを報告してくれました。
data/bin/asl-passwd CHANGED
@@ -57,14 +57,8 @@ user = User.find(name)
57
57
  unless Process.uid.zero?
58
58
  prompt = _("Enter your current password: ")
59
59
  old_password = ActiveSambaLdap::Command.read_password(prompt)
60
-
61
- auth_class = Class.new(ActiveSambaLdap::Base)
62
- config = ActiveSambaLdap::Base.configurations["reference"].symbolize_keys
63
60
  begin
64
- auth_class.establish_connection(config.merge(:bind_dn => user.dn,
65
- :password => old_password,
66
- :allow_anonymous => false))
67
- auth_class.remove_connection
61
+ user.bind(old_password)
68
62
  rescue ActiveLdap::AuthenticationError
69
63
  $stderr.puts(_("password doesn't match."))
70
64
  exit 1
@@ -64,18 +64,13 @@ member = member_class.find(name)
64
64
  unless Process.uid.zero?
65
65
  password = ActiveSambaLdap::Command.read_password(_("Enter your password: "))
66
66
 
67
- auth_class = Class.new(ActiveSambaLdap::Base)
68
- config = ActiveSambaLdap::Base.configurations["reference"]
69
67
  begin
70
- auth_class.establish_connection(config.merge(:bind_dn => member.dn,
71
- :password => password,
72
- :allow_anonymous => false))
68
+ member.bind(password)
73
69
  rescue ActiveLdap::AuthenticationError
74
- $stderr.puts(_("password isn't match."))
70
+ $stderr.puts(_("password doesn't match."))
75
71
  exit 1
76
- ensure
77
- auth_class.remove_connection
78
72
  end
73
+ member.remove_connection
79
74
  end
80
75
 
81
76
  if options.gid
data/bin/asl-usermod CHANGED
@@ -175,18 +175,13 @@ member = member_class.find(name)
175
175
  unless Process.uid.zero?
176
176
  password = ActiveSambaLdap::Command.read_password(_("Enter your password: "))
177
177
 
178
- auth_class = Class.new(ActiveSambaLdap::Base)
179
- config = ActiveSambaLdap::Base.configurations["reference"]
180
178
  begin
181
- auth_class.establish_connection(config.merge(:bind_dn => member.dn,
182
- :password => password,
183
- :allow_anonymous => false))
179
+ member.bind(password)
184
180
  rescue ActiveLdap::AuthenticationError
185
- $stderr.puts(_("password isn't match."))
181
+ $stderr.puts(_("password doesn't match."))
186
182
  exit 1
187
- ensure
188
- auth_class.remove_connection
189
183
  end
184
+ member.remove_connection
190
185
  end
191
186
 
192
187
  if options.uid
@@ -144,7 +144,7 @@ module ActiveSambaLdap
144
144
  Dir.glob(File.join(skel, "*")) -
145
145
  [File.join(skel, "."), File.join(skel, "..")],
146
146
  dest)
147
- FileUtils.chown_R(uid_number, gid_number, dest)
147
+ FileUtils.chown_R(uid_number.to_s, gid_number.to_s, dest)
148
148
  end
149
149
 
150
150
  private
@@ -57,10 +57,10 @@ module ActiveSambaLdap
57
57
  end
58
58
  end
59
59
 
60
- def merge_configuration(config)
60
+ def merge_configuration(config, *rest)
61
61
  config = config.symbolize_keys
62
62
  config = (configurations["common"] || {}).symbolize_keys.merge(config)
63
- ValidHash.new.merge(super(Private.new(config).merge))
63
+ ValidHash.new.merge(super(Private.new(config).merge, *rest))
64
64
  end
65
65
 
66
66
  def required_configuration_variables(*names)
@@ -25,7 +25,7 @@ module ActiveSambaLdap
25
25
  end
26
26
 
27
27
  # FAR_FUTURE_TIME = Time.parse("2050/01/01").to_i.to_s
28
- FAR_FUTURE_TIME = Time.parse("2038/01/19").to_i.to_s
28
+ FAR_FUTURE_TIME = Time.parse("2038/01/18").to_i.to_s
29
29
  ACCOUNT_FLAGS_RE = /\A\[([NDHTUMWSLXI ]+)\]\z/
30
30
 
31
31
  module ClassMethods
@@ -1,3 +1,3 @@
1
1
  module ActiveSambaLdap
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -8,8 +8,8 @@ require_gem_if_need = Proc.new do |library_name, gem_name, *options|
8
8
  end
9
9
  end
10
10
 
11
- required_active_ldap_version = ">= 0.8.3.1"
12
- require_gem_if_need.call("active_ldap", "ruby-activeldap",
11
+ required_active_ldap_version = ">= 0.9.0"
12
+ require_gem_if_need.call("active_ldap", "activeldap",
13
13
  required_active_ldap_version)
14
14
 
15
15
  if Dependencies.respond_to?(:load_paths)
@@ -6,8 +6,8 @@
6
6
  #, fuzzy
7
7
  msgid ""
8
8
  msgstr ""
9
- "Project-Id-Version: Ruby/ActiveSambaLdap 0.0.4\n"
10
- "POT-Creation-Date: 2007-09-16 22:22+0900\n"
9
+ "Project-Id-Version: Ruby/ActiveSambaLdap 0.0.5\n"
10
+ "POT-Creation-Date: 2007-09-16 22:47+0900\n"
11
11
  "PO-Revision-Date: 2007-09-08 11:51+0900\n"
12
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -196,19 +196,19 @@ msgstr ""
196
196
  msgid "Enter your current password: "
197
197
  msgstr ""
198
198
 
199
- #: bin/asl-passwd:69
199
+ #: bin/asl-passwd:63 bin/asl-samba-usermod:70 bin/asl-usermod:181
200
200
  msgid "password doesn't match."
201
201
  msgstr ""
202
202
 
203
- #: bin/asl-passwd:74
203
+ #: bin/asl-passwd:68
204
204
  msgid "New password: "
205
205
  msgstr ""
206
206
 
207
- #: bin/asl-passwd:75
207
+ #: bin/asl-passwd:69
208
208
  msgid "Retype new password: "
209
209
  msgstr ""
210
210
 
211
- #: bin/asl-passwd:78
211
+ #: bin/asl-passwd:72
212
212
  msgid "New passwords don't match."
213
213
  msgstr ""
214
214
 
@@ -328,7 +328,7 @@ msgstr ""
328
328
  msgid "illegal %s name: %s"
329
329
  msgstr ""
330
330
 
331
- #: bin/asl-useradd:182 bin/asl-usermod:314
331
+ #: bin/asl-useradd:182 bin/asl-usermod:308
332
332
  msgid "%s already exists: %s"
333
333
  msgstr ""
334
334
 
@@ -348,10 +348,6 @@ msgstr ""
348
348
  msgid "Enter your password: "
349
349
  msgstr ""
350
350
 
351
- #: bin/asl-samba-usermod:74 bin/asl-usermod:185
352
- msgid "password isn't match."
353
- msgstr ""
354
-
355
351
  #: bin/asl-populate:30
356
352
  msgid "first uid number to allocate"
357
353
  msgstr ""
@@ -450,7 +446,7 @@ msgstr ""
450
446
  msgid "enable this user"
451
447
  msgstr ""
452
448
 
453
- #: bin/asl-usermod:240 bin/asl-usermod:244
449
+ #: bin/asl-usermod:234 bin/asl-usermod:238
454
450
  msgid "not implemented."
455
451
  msgstr ""
456
452
 
@@ -6,9 +6,9 @@
6
6
  #
7
7
  msgid ""
8
8
  msgstr ""
9
- "Project-Id-Version: Ruby/ActiveSambaLdap 0.0.4\n"
10
- "POT-Creation-Date: 2007-09-16 22:22+0900\n"
11
- "PO-Revision-Date: 2007-09-16 22:21+0900\n"
9
+ "Project-Id-Version: Ruby/ActiveSambaLdap 0.0.5\n"
10
+ "POT-Creation-Date: 2007-09-16 22:47+0900\n"
11
+ "PO-Revision-Date: 2007-09-16 22:47+0900\n"
12
12
  "Last-Translator: Kouhei Sutou <kou@cozmixng.org>\n"
13
13
  "Language-Team: Japanese\n"
14
14
  "MIME-Version: 1.0\n"
@@ -202,19 +202,19 @@ msgstr "何もしません。"
202
202
  msgid "Enter your current password: "
203
203
  msgstr "現在のパスワードを入力してください: "
204
204
 
205
- #: bin/asl-passwd:69
205
+ #: bin/asl-passwd:63 bin/asl-samba-usermod:70 bin/asl-usermod:181
206
206
  msgid "password doesn't match."
207
207
  msgstr "パスワードが合っていません。"
208
208
 
209
- #: bin/asl-passwd:74
209
+ #: bin/asl-passwd:68
210
210
  msgid "New password: "
211
211
  msgstr "新しいパスワード: "
212
212
 
213
- #: bin/asl-passwd:75
213
+ #: bin/asl-passwd:69
214
214
  msgid "Retype new password: "
215
215
  msgstr "新しいパスワードをもう一度入力してください: "
216
216
 
217
- #: bin/asl-passwd:78
217
+ #: bin/asl-passwd:72
218
218
  msgid "New passwords don't match."
219
219
  msgstr "新しいパスワードが合っていません。"
220
220
 
@@ -334,7 +334,7 @@ msgstr "(Sambaのアカウント制御ビット。例: '[NDHTUMWSLXI]')"
334
334
  msgid "illegal %s name: %s"
335
335
  msgstr "不正な%s名: %s"
336
336
 
337
- #: bin/asl-useradd:182 bin/asl-usermod:314
337
+ #: bin/asl-useradd:182 bin/asl-usermod:308
338
338
  msgid "%s already exists: %s"
339
339
  msgstr "すでに存在する%sです: %s"
340
340
 
@@ -354,10 +354,6 @@ msgstr "追加用メンバーと削除用メンバーに重複しているメン
354
354
  msgid "Enter your password: "
355
355
  msgstr "あなたのパスワードを入力してください: "
356
356
 
357
- #: bin/asl-samba-usermod:74 bin/asl-usermod:185
358
- msgid "password isn't match."
359
- msgstr "パスワードが合っていません。"
360
-
361
357
  #: bin/asl-populate:30
362
358
  msgid "first uid number to allocate"
363
359
  msgstr "最初に割り当てるUID番号"
@@ -456,7 +452,7 @@ msgstr "このユーザを無効にする"
456
452
  msgid "enable this user"
457
453
  msgstr "このユーザを有効にする"
458
454
 
459
- #: bin/asl-usermod:240 bin/asl-usermod:244
455
+ #: bin/asl-usermod:234 bin/asl-usermod:238
460
456
  msgid "not implemented."
461
457
  msgstr "実装されていません。"
462
458
 
@@ -114,7 +114,7 @@ module AslTestUtils
114
114
  home_directory = config[:home_directory] || "/tmp/#{name}-#{Process.pid}"
115
115
  ensure_delete_user(name, home_directory) do
116
116
  password = config[:password] || "password"
117
- uid_number = config[:uid_number] || "100000#{@user_index}"
117
+ uid_number = config[:uid_number] || (1000000 + @user_index)
118
118
  default_user_gid = @user_class.configuration[:default_user_gid]
119
119
  gid_number = config[:gid_number] || default_user_gid
120
120
  _wrap_assertion do
@@ -152,7 +152,7 @@ module AslTestUtils
152
152
  home_directory = config[:home_directory] || "/tmp/#{name}-#{Process.pid}"
153
153
  ensure_delete_computer(name, home_directory) do |name, home_directory|
154
154
  password = config[:password]
155
- uid_number = config[:uid_number] || "100000#{@computer_index}"
155
+ uid_number = config[:uid_number] || (1000000 + @computer_index)
156
156
  default_computer_gid =
157
157
  @computer_class.configuration[:default_computer_gid]
158
158
  gid_number = config[:gid_number] || default_computer_gid
@@ -187,7 +187,7 @@ module AslTestUtils
187
187
  @group_index += 1
188
188
  name = config[:name] || "test-group#{@group_index}"
189
189
  ensure_delete_group(name) do
190
- gid_number = config[:gid_number] || "200000#{@group_index}"
190
+ gid_number = config[:gid_number] || (2000000 + @group_index)
191
191
  group_type = config[:group_type] || "domain"
192
192
  _wrap_assertion do
193
193
  assert(!@group_class.exists?(name))
@@ -246,7 +246,7 @@ module AslTestUtils
246
246
  @lib_dir = File.join(@top_dir, "lib")
247
247
  @ruby_args = [
248
248
  "-I", @lib_dir,
249
- # "-I", File.join(@parent_dir, "activeldap", "lib"),
249
+ "-I", File.join(@parent_dir, "activeldap", "lib"),
250
250
  # "-I", File.join(@parent_dir, "ldap", "lib"),
251
251
  # "-I", File.join(@parent_dir, "ldap"),
252
252
  ]
data/test/run-test.rb CHANGED
@@ -7,7 +7,7 @@ require "test/unit"
7
7
  top_dir = File.join(File.dirname(__FILE__), "..")
8
8
  # $LOAD_PATH.unshift(File.join(top_dir, "..", "ldap", "lib"))
9
9
  # $LOAD_PATH.unshift(File.join(top_dir, "..", "ldap"))
10
- # $LOAD_PATH.unshift(File.join(top_dir, "..", "activeldap", "lib"))
10
+ $LOAD_PATH.unshift(File.join(top_dir, "..", "activeldap", "lib"))
11
11
  $LOAD_PATH.unshift(File.join(top_dir, "lib"))
12
12
  $LOAD_PATH.unshift(File.join(top_dir, "test"))
13
13
 
@@ -23,7 +23,9 @@ module Test
23
23
  end
24
24
  end
25
25
 
26
+ alias_method :method_added_without_priority, :method_added
26
27
  def method_added(name)
28
+ method_added_without_priority(name)
27
29
  set_priority(name) if defined?(@priority_initialized)
28
30
  end
29
31
 
@@ -108,10 +110,18 @@ module Test
108
110
  end
109
111
 
110
112
  def result_dir
111
- dir = File.join(File.dirname($0), ".test-result",
112
- self.class.name, escaped_method_name)
113
+ components = [".test-result", self.class.name, @method_name.to_s]
114
+ dir = File.join(File.dirname($0), *components)
113
115
  dir = File.expand_path(dir)
114
- FileUtils.mkdir_p(dir)
116
+ begin
117
+ FileUtils.mkdir_p(dir)
118
+ rescue Errno::EACCES
119
+ retry_dir = File.join(File.dirname(__FILE__), "..", *components)
120
+ retry_dir = File.expand_path(retry_dir)
121
+ raise if retry_dir == dir
122
+ dir = retry_dir
123
+ retry
124
+ end
115
125
  dir
116
126
  end
117
127
 
@@ -163,9 +173,9 @@ module Test
163
173
  end
164
174
 
165
175
  class AutoRunner
166
- alias_method :original_options, :options
176
+ alias_method :options_without_priority, :options
167
177
  def options
168
- opts = original_options
178
+ opts = options_without_priority
169
179
  opts.on("--[no-]priority", "use priority mode") do |bool|
170
180
  TestSuite.priority_mode = bool
171
181
  end
@@ -149,7 +149,7 @@ class AslUserAddTest < Test::Unit::TestCase
149
149
  user = @user_class.find(uid)
150
150
  primary_group = @group_class.find(:first,
151
151
  :attribute => "gidNumber",
152
- :value => user.gid_number)
152
+ :value => user.gid_number.to_s)
153
153
  groups = @group_class.find(:all,
154
154
  :attribute => "memberUid",
155
155
  :value => uid)
@@ -167,7 +167,7 @@ class AslUserAddTest < Test::Unit::TestCase
167
167
  computer = @computer_class.find(uid)
168
168
  primary_group = @group_class.find(:first,
169
169
  :attribute => "gidNumber",
170
- :value => computer.gid_number)
170
+ :value => computer.gid_number.to_s)
171
171
  groups = @group_class.find(:all,
172
172
  :attribute => "memberUid",
173
173
  :value => uid)
@@ -442,7 +442,7 @@ class AslUserAddTest < Test::Unit::TestCase
442
442
  expire_date = Time.now + 60 * 24
443
443
  assert_asl_useradd_successfully(uid, "--expire-date", expire_date.iso8601)
444
444
  user = @user_class.find(uid)
445
- assert_equal(expire_date.to_i.to_s, user.samba_kickoff_time)
445
+ assert_equal(expire_date.to_i, user.samba_kickoff_time)
446
446
  end
447
447
  end
448
448
 
@@ -351,7 +351,7 @@ class AslUserModTest < Test::Unit::TestCase
351
351
  assert_asl_usermod_successfully(user.uid, password, *args)
352
352
 
353
353
  new_user = @user_class.find(user.uid)
354
- assert_equal(new_expire_date.to_i.to_s, new_user.samba_kickoff_time)
354
+ assert_equal(new_expire_date.to_i, new_user.samba_kickoff_time)
355
355
  end
356
356
  end
357
357
 
@@ -520,6 +520,14 @@ class AslUserModTest < Test::Unit::TestCase
520
520
  end
521
521
  end
522
522
 
523
+ def test_wrong_password
524
+ make_dummy_user do |user, password|
525
+ assert_asl_usermod_failed(user.uid,
526
+ "wrong-#{password}",
527
+ _("password doesn't match.") + "\n")
528
+ end
529
+ end
530
+
523
531
  private
524
532
  def assert_asl_usermod_successfully(name, password, *args)
525
533
  args << name
data/test/test_entry.rb CHANGED
@@ -15,7 +15,7 @@ class EntryTest < Test::Unit::TestCase
15
15
  params = params.stringify_keys if stringify
16
16
  user = @user_class.create(params)
17
17
  assert(@user_class.exists?(name))
18
- assert_equal(ActiveSambaLdap::Group::DOMAIN_USERS_RID.to_s,
18
+ assert_equal(ActiveSambaLdap::Group::DOMAIN_USERS_RID,
19
19
  user.primary_group.gid_number)
20
20
  end
21
21
  end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: activesambaldap
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.4
7
- date: 2007-09-16 00:00:00 +09:00
6
+ version: 0.0.5
7
+ date: 2007-11-19 00:00:00 +09:00
8
8
  summary: ActiveSambaLdap is a library and a management tool for Samba + LDAP environment.
9
9
  require_paths:
10
10
  - lib
@@ -175,7 +175,7 @@ dependencies:
175
175
  requirements:
176
176
  - - ">="
177
177
  - !ruby/object:Gem::Version
178
- version: 0.8.3.1
178
+ version: 0.9.0
179
179
  version:
180
180
  - !ruby/object:Gem::Dependency
181
181
  name: hoe