ruby-ldap 0.9.11 → 0.9.12

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.
Files changed (46) hide show
  1. data/ChangeLog +18 -0
  2. data/FAQ +5 -9
  3. data/NOTES +29 -0
  4. data/README +22 -18
  5. data/TODO +10 -0
  6. data/clientauth.c +605 -0
  7. data/conn.c +24 -1
  8. data/entry.c +9 -9
  9. data/extconf.rb +70 -29
  10. data/ldap.c +67 -0
  11. data/lib/ldap/control.rb +3 -3
  12. data/lib/ldap/ldif.rb +264 -269
  13. data/lib/ldap/schema.rb +39 -33
  14. data/mod.c +7 -3
  15. data/rbldap.h +8 -6
  16. data/test/cookbooks/apt/metadata.rb +13 -0
  17. data/test/cookbooks/apt/providers/repository.rb +73 -0
  18. data/test/cookbooks/apt/recipes/cacher-client.rb +44 -0
  19. data/test/cookbooks/apt/recipes/cacher.rb +45 -0
  20. data/test/cookbooks/apt/recipes/default.rb +50 -0
  21. data/test/cookbooks/apt/resources/repository.rb +30 -0
  22. data/test/cookbooks/nginx/attributes/default.rb +35 -0
  23. data/test/cookbooks/nginx/definitions/nginx_site.rb +35 -0
  24. data/test/cookbooks/nginx/metadata.rb +86 -0
  25. data/test/cookbooks/nginx/recipes/default.rb +56 -0
  26. data/test/cookbooks/nginx/recipes/source.rb +143 -0
  27. data/test/cookbooks/openldap/attributes/default.rb +61 -0
  28. data/test/cookbooks/openldap/metadata.rb +99 -0
  29. data/test/cookbooks/openldap/recipes/auth.rb +70 -0
  30. data/test/cookbooks/openldap/recipes/client.rb +28 -0
  31. data/test/cookbooks/openldap/recipes/default.rb +18 -0
  32. data/test/cookbooks/openldap/recipes/server.rb +110 -0
  33. data/test/cookbooks/postgresql/attributes/default.rb +68 -0
  34. data/test/cookbooks/postgresql/metadata.rb +15 -0
  35. data/test/cookbooks/postgresql/recipes/client.rb +27 -0
  36. data/test/cookbooks/postgresql/recipes/default.rb +20 -0
  37. data/test/cookbooks/postgresql/recipes/server.rb +36 -0
  38. data/test/cookbooks/postgresql/recipes/server_debian.rb +51 -0
  39. data/test/cookbooks/postgresql/recipes/server_redhat.rb +84 -0
  40. data/test/cookbooks/sqlite/metadata.rb +11 -0
  41. data/test/cookbooks/sqlite/recipes/default.rb +26 -0
  42. data/test/cookbooks/vagrant_main/recipes/default.rb +12 -0
  43. data/test/moz_cert.rb +105 -0
  44. data/test/setup.rb +2 -2
  45. data/win/wldap32.def +257 -0
  46. metadata +78 -55
@@ -0,0 +1,70 @@
1
+ #
2
+ # Cookbook Name:: openldap
3
+ # Recipe:: auth
4
+ #
5
+ # Copyright 2008-2009, Opscode, Inc.
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+
20
+ include_recipe "openldap::client"
21
+ include_recipe "openssh"
22
+ include_recipe "nscd"
23
+
24
+ package "libnss-ldap" do
25
+ action :upgrade
26
+ end
27
+
28
+ package "libpam-ldap" do
29
+ action :upgrade
30
+ end
31
+
32
+ template "/etc/ldap.conf" do
33
+ source "ldap.conf.erb"
34
+ mode 0644
35
+ owner "root"
36
+ group "root"
37
+ end
38
+
39
+ template "/etc/ldap/ldap.conf" do
40
+ source "ldap-ldap.conf.erb"
41
+ mode 0644
42
+ owner "root"
43
+ group "root"
44
+ end
45
+
46
+ cookbook_file "/etc/nsswitch.conf" do
47
+ source "nsswitch.conf"
48
+ mode 0644
49
+ owner "root"
50
+ group "root"
51
+ notifies :restart, resources(:service => "nscd"), :immediately
52
+ notifies :run, resources(:execute => [ "nscd-clear-passwd", "nscd-clear-group" ]), :immediately
53
+ end
54
+
55
+ %w{ account auth password session }.each do |pam|
56
+ cookbook_file "/etc/pam.d/common-#{pam}" do
57
+ source "common-#{pam}"
58
+ mode 0644
59
+ owner "root"
60
+ group "root"
61
+ notifies :restart, resources(:service => "ssh"), :delayed
62
+ end
63
+ end
64
+
65
+ template "/etc/security/login_access.conf" do
66
+ source "login_access.conf.erb"
67
+ mode 0644
68
+ owner "root"
69
+ group "root"
70
+ end
@@ -0,0 +1,28 @@
1
+ #
2
+ # Cookbook Name:: openldap
3
+ # Recipe:: client
4
+ #
5
+ # Copyright 2008-2009, Opscode, Inc.
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+
20
+ package "ldap-utils" do
21
+ action :upgrade
22
+ end
23
+
24
+ directory node[:openldap][:ssl_dir] do
25
+ mode 0755
26
+ owner "root"
27
+ group "root"
28
+ end
@@ -0,0 +1,18 @@
1
+ #
2
+ # Cookbook Name:: openldap
3
+ # Recipe:: default
4
+ #
5
+ # Copyright 2008-2009, Opscode, Inc.
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
@@ -0,0 +1,110 @@
1
+ #
2
+ # Cookbook Name:: openldap
3
+ # Recipe:: server
4
+ #
5
+ # Copyright 2008-2009, Opscode, Inc.
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+ include_recipe "openldap::client"
20
+
21
+ case node[:platform]
22
+ when "ubuntu"
23
+ if (node[:platform_version].to_f >= 10.04)
24
+ package "db4.8-util" do
25
+ action :upgrade
26
+ end
27
+ else
28
+ package "db4.2-util" do
29
+ action :upgrade
30
+ end
31
+ end
32
+ cookbook_file "/var/cache/local/preseeding/slapd.seed" do
33
+ source "slapd.seed"
34
+ mode 0600
35
+ owner "root"
36
+ group "root"
37
+ end
38
+ package "slapd" do
39
+ response_file "slapd.seed"
40
+ action :upgrade
41
+ end
42
+ else
43
+ package "db4.2-util" do
44
+ action :upgrade
45
+ end
46
+ package "slapd" do
47
+ action :upgrade
48
+ end
49
+ end
50
+
51
+ cookbook_file "#{node[:openldap][:ssl_dir]}/#{node[:openldap][:server]}.pem" do
52
+ source "ssl/#{node[:openldap][:server]}.pem"
53
+ mode 0644
54
+ owner "root"
55
+ group "root"
56
+ end
57
+
58
+ service "slapd" do
59
+ action [:enable, :start]
60
+ end
61
+
62
+ if (node[:platform] == "ubuntu") and (node[:platform_version].to_f >= 8.10)
63
+ template "/etc/default/slapd" do
64
+ source "default_slapd.erb"
65
+ owner "root"
66
+ group "root"
67
+ mode 0644
68
+ end
69
+
70
+ directory "#{node[:openldap][:dir]}/slapd.d" do
71
+ recursive true
72
+ owner "openldap"
73
+ group "openldap"
74
+ action :create
75
+ end
76
+
77
+ execute "slapd-config-convert" do
78
+ command "slaptest -f #{node[:openldap][:dir]}/slapd.conf -F #{node[:openldap][:dir]}/slapd.d/"
79
+ user "openldap"
80
+ action :nothing
81
+ notifies :start, resources(:service => "slapd"), :immediately
82
+ end
83
+
84
+ template "#{node[:openldap][:dir]}/slapd.conf" do
85
+ source "slapd.conf.erb"
86
+ mode 0640
87
+ owner "openldap"
88
+ group "openldap"
89
+ notifies :stop, resources(:service => "slapd"), :immediately
90
+ notifies :run, resources(:execute => "slapd-config-convert")
91
+ end
92
+ else
93
+ case node[:platform]
94
+ when "debian","ubuntu"
95
+ template "/etc/default/slapd" do
96
+ source "default_slapd.erb"
97
+ owner "root"
98
+ group "root"
99
+ mode 0644
100
+ end
101
+ end
102
+
103
+ template "#{node[:openldap][:dir]}/slapd.conf" do
104
+ source "slapd.conf.erb"
105
+ mode 0640
106
+ owner "openldap"
107
+ group "openldap"
108
+ notifies :restart, resources(:service => "slapd")
109
+ end
110
+ end
@@ -0,0 +1,68 @@
1
+ #
2
+ # Cookbook Name:: postgresql
3
+ # Attributes:: postgresql
4
+ #
5
+ # Copyright 2008-2009, Opscode, Inc.
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+ case platform
20
+ when "debian"
21
+
22
+ if platform_version.to_f == 5.0
23
+ default[:postgresql][:version] = "8.3"
24
+ elsif platform_version =~ /.*sid/
25
+ default[:postgresql][:version] = "8.4"
26
+ end
27
+
28
+ set[:postgresql][:dir] = "/etc/postgresql/#{node[:postgresql][:version]}/main"
29
+
30
+ when "ubuntu"
31
+
32
+ if platform_version.to_f <= 9.04
33
+ default[:postgresql][:version] = "8.3"
34
+ else
35
+ default[:postgresql][:version] = "8.4"
36
+ end
37
+
38
+ set[:postgresql][:dir] = "/etc/postgresql/#{node[:postgresql][:version]}/main"
39
+
40
+ when "fedora"
41
+
42
+ if platform_version.to_f <= 12
43
+ default[:postgresql][:version] = "8.3"
44
+ else
45
+ default[:postgresql][:version] = "8.4"
46
+ end
47
+
48
+ set[:postgresql][:dir] = "/var/lib/pgsql/data"
49
+
50
+ when "redhat","centos"
51
+
52
+ default[:postgresql][:version] = "8.4"
53
+ set[:postgresql][:dir] = "/var/lib/pgsql/data"
54
+
55
+ when "suse"
56
+
57
+ if platform_version.to_f <= 11.1
58
+ default[:postgresql][:version] = "8.3"
59
+ else
60
+ default[:postgresql][:version] = "8.4"
61
+ end
62
+
63
+ set[:postgresql][:dir] = "/var/lib/pgsql/data"
64
+
65
+ else
66
+ default[:postgresql][:version] = "8.4"
67
+ set[:postgresql][:dir] = "/etc/postgresql/#{node[:postgresql][:version]}/main"
68
+ end
@@ -0,0 +1,15 @@
1
+ maintainer "Opscode, Inc."
2
+ maintainer_email "cookbooks@opscode.com"
3
+ license "Apache 2.0"
4
+ description "Installs and configures postgresql for clients or servers"
5
+ long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
6
+ version "0.11.1"
7
+ recipe "postgresql", "Empty, use one of the other recipes"
8
+ recipe "postgresql::client", "Installs postgresql client package(s)"
9
+ recipe "postgresql::server", "Installs postgresql server packages, templates"
10
+ recipe "postgresql::redhat", "Installs postgresql server packages, redhat family style"
11
+ recipe "postgresql::server", "Installs postgresql server packages, debian family style"
12
+
13
+ %w{rhel centos fedora ubuntu debian suse}.each do |os|
14
+ supports os
15
+ end
@@ -0,0 +1,27 @@
1
+ #
2
+ # Cookbook Name:: postgresql
3
+ # Recipe:: client
4
+ #
5
+ # Copyright 2009, Opscode, Inc.
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+
20
+ case node.platform
21
+ when "ubuntu","debian"
22
+ package "postgresql-client"
23
+ when "fedora","suse"
24
+ package "postgresql-devel"
25
+ when "redhat","centos"
26
+ package "postgresql#{node.postgresql.version.split('.').join}-devel"
27
+ end
@@ -0,0 +1,20 @@
1
+ #
2
+ # Cookbook Name:: postgresql
3
+ # Recipe:: default
4
+ #
5
+ # Copyright 2009, Opscode, Inc.
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+
20
+ include_recipe "postgresql::client"
@@ -0,0 +1,36 @@
1
+ #/postgresql.conf.
2
+ # Cookbook Name:: postgresql
3
+ # Recipe:: server
4
+ #
5
+ # Copyright 2009-2010, Opscode, Inc.
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+
20
+ include_recipe "postgresql::client"
21
+
22
+ case node[:postgresql][:version]
23
+ when "8.3"
24
+ node.default[:postgresql][:ssl] = "off"
25
+ when "8.4"
26
+ node.default[:postgresql][:ssl] = "true"
27
+ end
28
+
29
+ # Include the right "family" recipe for installing the server
30
+ # since they do things slightly differently.
31
+ case node.platform
32
+ when "redhat", "centos", "fedora", "suse"
33
+ include_recipe "postgresql::server_redhat"
34
+ when "debian", "ubuntu"
35
+ include_recipe "postgresql::server_debian"
36
+ end
@@ -0,0 +1,51 @@
1
+ #/postgresql.conf.
2
+ # Cookbook Name:: postgresql
3
+ # Recipe:: server
4
+ #
5
+ # Copyright 2009-2010, Opscode, Inc.
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+
20
+ include_recipe "postgresql::client"
21
+
22
+ case node[:postgresql][:version]
23
+ when "8.3"
24
+ node.default[:postgresql][:ssl] = "off"
25
+ when "8.4"
26
+ node.default[:postgresql][:ssl] = "true"
27
+ end
28
+
29
+ package "postgresql"
30
+
31
+ service "postgresql" do
32
+ service_name "postgresql-#{node.postgresql.version}"
33
+ supports :restart => true, :status => true, :reload => true
34
+ action :nothing
35
+ end
36
+
37
+ template "#{node[:postgresql][:dir]}/pg_hba.conf" do
38
+ source "debian.pg_hba.conf.erb"
39
+ owner "postgres"
40
+ group "postgres"
41
+ mode 0600
42
+ notifies :reload, resources(:service => "postgresql")
43
+ end
44
+
45
+ template "#{node[:postgresql][:dir]}/postgresql.conf" do
46
+ source "debian.postgresql.conf.erb"
47
+ owner "postgres"
48
+ group "postgres"
49
+ mode 0600
50
+ notifies :restart, resources(:service => "postgresql")
51
+ end