radcli 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 3bc3f6acd5b2d491088f30d7fc6b679767134d23
4
- data.tar.gz: a4a3cd61769cfbd15054d33bb07183fface522c9
2
+ SHA256:
3
+ metadata.gz: 0662c80c5d2c83f379bc165a4aa43c122484e7dd57856d5e754593ab605b1b26
4
+ data.tar.gz: df4d73859a2c1e0b86c12071d2b2eec2f35177cf82fbe8ad0fd1c7b1bc403044
5
5
  SHA512:
6
- metadata.gz: 3c339f77c1dc627b271112c1ba795e38544023ff3b063f84cf49d6b540b2580afc9962b6906517a0497141eee78d84da832a3d4b695a0b753c5f3fa60512cbf1
7
- data.tar.gz: 78586e6958a05a42b38b35efb07af64f5fbf477af3eed0b67a8c9c06b245f9e3e02f2ef48c75b8ba2a1c4fc7ebae8208684473a4eaa30ca165413e85bb2afc3d
6
+ metadata.gz: 8bfd578c6e725d1c4e89e900ccbaab4866aa218ae821ae38af099e2933f8de44120356387fb6e836480f160eb0efe847a7532deb1903344d4cf4855e3747b82c
7
+ data.tar.gz: 9c99f9283ec6d273418d7e24f66cc3bb58eb54f3a12b2346e24f6d57ac8cd46fd79eb3c1d5c582eef2a55f3a3be90c6271c008b1a5acb3fe29d44aa4f00248ca
@@ -0,0 +1,19 @@
1
+ # See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.148.1/containers/ruby/.devcontainer/base.Dockerfile
2
+
3
+ # [Choice] Ruby version: 2, 2.7, 2.6, 2.5
4
+ ARG VARIANT="2"
5
+ FROM mcr.microsoft.com/vscode/devcontainers/ruby:0-${VARIANT}
6
+
7
+ # [Option] Install Node.js
8
+ ARG INSTALL_NODE="true"
9
+ ARG NODE_VERSION="lts/*"
10
+ RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
11
+
12
+ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
13
+ && apt-get -y install --no-install-recommends make gcc automake autoconf xmlto xsltproc libkrb5-dev libldap2-dev libsasl2-dev
14
+
15
+ # [Optional] Uncomment this line to install additional gems.
16
+ RUN gem install rake bundler rake-compiler rspec
17
+
18
+ # [Optional] Uncomment this line to install global node packages.
19
+ # RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "Ruby",
3
+ "build": {
4
+ "dockerfile": "Dockerfile",
5
+ "args": {
6
+ // Update 'VARIANT' to pick a Ruby version: 2, 2.7, 2.6, 2.5
7
+ "VARIANT": "2.7",
8
+ // Options
9
+ "INSTALL_NODE": "false",
10
+ "NODE_VERSION": "lts/*"
11
+ }
12
+ },
13
+
14
+ // Set *default* container specific settings.json values on container create.
15
+ "settings": {
16
+ "terminal.integrated.shell.linux": "/bin/bash"
17
+ },
18
+
19
+ // Add the IDs of extensions you want installed when the container is created.
20
+ "extensions": [
21
+ "rebornix.Ruby"
22
+ ],
23
+
24
+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
25
+ // "forwardPorts": [],
26
+
27
+ // Use 'postCreateCommand' to run commands after the container is created.
28
+ // "postCreateCommand": "ruby --version",
29
+
30
+ // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
31
+ "remoteUser": "vscode"
32
+
33
+ }
data/CHANGES CHANGED
File without changes
data/LICENSE CHANGED
File without changes
data/MANIFEST CHANGED
File without changes
data/README.md CHANGED
@@ -3,30 +3,47 @@ The radcli library provides a Ruby interface for performing actions on a Active
3
3
  (adcli: https://www.freedesktop.org/software/realmd/adcli/devel-building.html)
4
4
 
5
5
  # Installation
6
+ This library is available as a gem.
6
7
 
8
+ ## Ubuntu 16.04
9
+ ```
10
+ sudo apt-get -y install make gcc libkrb5-dev libldap2-dev libsasl2-dev
11
+ sudo gem install radcli
12
+ ```
13
+ ## Redhat Linux 7.4
14
+ ```
15
+ sudo yum -y install make gcc automake autoconf krb5-devel openldap-devel cyrus-sasl-devel cyrus-sasl-gssapi
16
+ sudo gem install radcli
17
+ ```
18
+ # Building
7
19
 
8
- ### Prerequisites (Ubuntu)
20
+ ## Ubuntu 16.04
9
21
  ```
10
22
  sudo apt-get install ruby gem ruby-dev
11
- sudo gem install rake bundler rakecompiler rspec
12
- sudo apt-get install automake autoconf xmlto xsltproc libkrb5-dev libldap2-dev libsasl2-dev
23
+ sudo gem install rake bundler rake-compiler rspec
24
+ sudo apt-get install make gcc automake autoconf xmlto xsltproc libkrb5-dev libldap2-dev libsasl2-dev
13
25
  ```
14
-
15
- ### Prerequisites (Fedora)
16
26
  ```
17
- sudo yum ruby gem ruby-devel
18
- gem install rake bundler rakecompiler rspec
19
- sudo yum install automake autoconf xmlto xsltproc krb5-devel openldap-devel cyrus-sasl-devel
27
+ git clone https://github.com/martencassel/radcli
28
+ cd radcli
29
+ rake build
30
+ gem install pkg/radcli-1.1.0.gem
20
31
  ```
21
32
 
22
- ### Building
33
+ ## Redhat Linux 7.4
34
+ ```
35
+ sudo subscription-manager repos --enable rhel-7-server-optional-rpms
36
+ sudo yum -y install ruby gem ruby-devel
37
+ sudo yum -y install git make gcc automake autoconf krb5-devel openldap-devel cyrus-sasl-devel cyrus-sasl-gssapi
38
+ sudo gem install rake bundler rake-compiler rspec
39
+ ```
23
40
  ```
24
41
  git clone https://github.com/martencassel/radcli
25
42
  cd radcli
26
43
  rake build
27
- gem install pkg/radcli-1.0.0.gem
44
+ gem install pkg/radcli-1.1.0.gem
28
45
  ```
29
-
46
+
30
47
  # Synposis
31
48
 
32
49
  ### Connect using username/password
data/Rakefile CHANGED
File without changes
Binary file
@@ -91,10 +91,15 @@ void adcli_conn_set_domain_controller (adcli_conn *conn,
91
91
 
92
92
  const char * adcli_conn_get_domain_short (adcli_conn *conn);
93
93
 
94
+ const char * adcli_conn_get_domain_sid (adcli_conn *conn);
95
+
94
96
  LDAP * adcli_conn_get_ldap_connection (adcli_conn *conn);
95
97
 
96
98
  krb5_context adcli_conn_get_krb5_context (adcli_conn *conn);
97
99
 
100
+ void adcli_conn_set_krb5_context (adcli_conn *conn,
101
+ krb5_context k5);
102
+
98
103
  const char * adcli_conn_get_computer_name (adcli_conn *conn);
99
104
 
100
105
  void adcli_conn_set_computer_name (adcli_conn *conn,
@@ -144,4 +149,6 @@ void adcli_conn_set_krb5_conf_dir (adcli_conn *conn,
144
149
  int adcli_conn_server_has_capability (adcli_conn *conn,
145
150
  const char *capability);
146
151
 
152
+ bool adcli_conn_is_writeable (adcli_conn *conn);
153
+
147
154
  #endif /* ADCONN_H_ */
@@ -30,6 +30,7 @@ typedef enum {
30
30
  ADCLI_ENROLL_NO_KEYTAB = 1 << 1,
31
31
  ADCLI_ENROLL_ALLOW_OVERWRITE = 1 << 2,
32
32
  ADCLI_ENROLL_PASSWORD_VALID = 1 << 3,
33
+ ADCLI_ENROLL_ADD_SAMBA_DATA = 1 << 4,
33
34
  } adcli_enroll_flags;
34
35
 
35
36
  typedef struct _adcli_enroll adcli_enroll;
@@ -97,6 +98,14 @@ const char ** adcli_enroll_get_service_principals (adcli_enroll *enroll);
97
98
  void adcli_enroll_set_service_principals (adcli_enroll *enroll,
98
99
  const char **value);
99
100
 
101
+ const char ** adcli_enroll_get_service_principals_to_add (adcli_enroll *enroll);
102
+ void adcli_enroll_add_service_principal_to_add (adcli_enroll *enroll,
103
+ const char *value);
104
+
105
+ const char ** adcli_enroll_get_service_principals_to_remove (adcli_enroll *enroll);
106
+ void adcli_enroll_add_service_principal_to_remove (adcli_enroll *enroll,
107
+ const char *value);
108
+
100
109
  const char * adcli_enroll_get_user_principal (adcli_enroll *enroll);
101
110
 
102
111
  void adcli_enroll_set_user_principal (adcli_enroll *enroll,
@@ -108,6 +117,10 @@ unsigned int adcli_enroll_get_computer_password_lifetime (adcli_enroll *en
108
117
  void adcli_enroll_set_computer_password_lifetime (adcli_enroll *enroll,
109
118
  unsigned int lifetime);
110
119
 
120
+ bool adcli_enroll_get_trusted_for_delegation (adcli_enroll *enroll);
121
+ void adcli_enroll_set_trusted_for_delegation (adcli_enroll *enroll,
122
+ bool value);
123
+
111
124
  krb5_kvno adcli_enroll_get_kvno (adcli_enroll *enroll);
112
125
 
113
126
  void adcli_enroll_set_kvno (adcli_enroll *enroll,
@@ -125,6 +138,8 @@ krb5_enctype * adcli_enroll_get_keytab_enctypes (adcli_enroll *enroll);
125
138
  void adcli_enroll_set_keytab_enctypes (adcli_enroll *enroll,
126
139
  krb5_enctype *enctypes);
127
140
 
141
+ krb5_enctype * adcli_enroll_get_permitted_keytab_enctypes (adcli_enroll *enroll);
142
+
128
143
  const char * adcli_enroll_get_os_name (adcli_enroll *enroll);
129
144
 
130
145
  void adcli_enroll_set_os_name (adcli_enroll *enroll,
@@ -140,4 +155,9 @@ const char * adcli_enroll_get_os_service_pack (adcli_enroll *enroll);
140
155
  void adcli_enroll_set_os_service_pack (adcli_enroll *enroll,
141
156
  const char *value);
142
157
 
158
+ void adcli_enroll_set_samba_data_tool (adcli_enroll *enroll,
159
+ const char *value);
160
+
161
+ const char * adcli_enroll_get_samba_data_tool (adcli_enroll *enroll);
162
+
143
163
  #endif /* ADENROLL_H_ */
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -200,6 +200,36 @@ static VALUE radenroll_join (VALUE self) {
200
200
  return self;
201
201
  }
202
202
 
203
+ /*
204
+ * call-seq:
205
+ *
206
+ * adenroll.update
207
+ *
208
+ * Updates a computer object
209
+ *
210
+ */
211
+ static VALUE radenroll_update (VALUE self) {
212
+ RUBY_ADENROLL *ptr_enroll;
213
+ adcli_result result;
214
+ const char* c_computer_password = NULL;
215
+ adcli_enroll_flags flags = ADCLI_ENROLL_NO_KEYTAB;
216
+
217
+ Data_Get_Struct (self, RUBY_ADENROLL, ptr_enroll);
218
+
219
+ c_computer_password = adcli_enroll_get_computer_password (ptr_enroll->enroll);
220
+ if (c_computer_password != NULL) {
221
+ flags |= ADCLI_ENROLL_PASSWORD_VALID;
222
+ }
223
+
224
+ result = adcli_enroll_update (ptr_enroll->enroll, flags);
225
+
226
+ if(result != ADCLI_SUCCESS) {
227
+ rb_raise(rb_eRuntimeError, "%s", adcli_get_last_error());
228
+ }
229
+
230
+ return self;
231
+ }
232
+
203
233
  /*
204
234
  * call-seq
205
235
  *
@@ -270,6 +300,7 @@ void Init_AdEnroll()
270
300
  rb_define_method (c_adenroll, "set_computer_password", radenroll_set_computer_password, 1);
271
301
 
272
302
  rb_define_method (c_adenroll, "join", radenroll_join, 0);
303
+ rb_define_method (c_adenroll, "update", radenroll_update, 0);
273
304
  rb_define_method (c_adenroll, "password", radenroll_password, 0);
274
305
  rb_define_method (c_adenroll, "delete", radenroll_delete, 0);
275
306
 
@@ -0,0 +1,5 @@
1
+ #!/bin/sh
2
+
3
+ sudo apt-get install libkrb5-dev libldap2-dev libsasl2-dev
4
+ sudo gem install radcli
5
+
@@ -2,11 +2,11 @@ require 'rubygems'
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'radcli'
5
- spec.version = '1.0.0'
5
+ spec.version = '1.1.0'
6
6
  spec.authors = ['Mårten Cassel']
7
7
  spec.license = 'Artistic-2.0'
8
8
  spec.email = ['marten.cassel@gmail.com']
9
- spec.homepage = 'http://github.com/martencassel/radcli'
9
+ spec.homepage = 'https://github.com/martencassel/radcli'
10
10
  spec.summary = 'A Ruby interface for the adcli library'
11
11
  spec.test_files = Dir['test/test*']
12
12
  spec.extensions = ['ext/radcli/extconf.rb']
@@ -103,8 +103,5 @@ class TC_Adconn < Test::Unit::TestCase
103
103
  password = @conn.get_user_password()
104
104
  assert_equal(@user_password, password)
105
105
  end
106
-
107
- def teardown
108
- end
109
-
106
+
110
107
  end
@@ -68,7 +68,4 @@ class TC_AdEnroll < Test::Unit::TestCase
68
68
  assert_equal(@computer_password, computer_password)
69
69
  end
70
70
 
71
- def teardown
72
- end
73
-
74
71
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radcli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mårten Cassel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-31 00:00:00.000000000 Z
11
+ date: 2020-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler
@@ -53,6 +53,8 @@ extra_rdoc_files:
53
53
  - ext/radcli/radconn.c
54
54
  - ext/radcli/radenroll.c
55
55
  files:
56
+ - ".devcontainer/Dockerfile"
57
+ - ".devcontainer/devcontainer.json"
56
58
  - CHANGES
57
59
  - LICENSE
58
60
  - MANIFEST
@@ -68,6 +70,7 @@ files:
68
70
  - ext/radcli/radcli.h
69
71
  - ext/radcli/radconn.c
70
72
  - ext/radcli/radenroll.c
73
+ - install.sh
71
74
  - radcli.gemspec
72
75
  - scripts/delete.rb
73
76
  - scripts/fail_adconnect.rb
@@ -75,7 +78,7 @@ files:
75
78
  - scripts/reset.rb
76
79
  - test/test_radconn.rb
77
80
  - test/test_radenroll.rb
78
- homepage: http://github.com/martencassel/radcli
81
+ homepage: https://github.com/martencassel/radcli
79
82
  licenses:
80
83
  - Artistic-2.0
81
84
  metadata: {}
@@ -94,8 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
97
  - !ruby/object:Gem::Version
95
98
  version: '0'
96
99
  requirements: []
97
- rubyforge_project:
98
- rubygems_version: 2.5.1
100
+ rubygems_version: 3.1.4
99
101
  signing_key:
100
102
  specification_version: 4
101
103
  summary: A Ruby interface for the adcli library