ruby-ldap3 0.10.0 → 0.10.1
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.
- checksums.yaml +4 -4
- data/NOTES +5 -1
- data/conn.c +8 -2
- data/entry.c +13 -13
- data/extconf.rb +6 -0
- data/misc.c +3 -3
- data/mod.c +3 -3
- data/rbldap.h +14 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79d254fc29905797d534d704797c9d9d87986ab819707bc38607d103fbb5689b
|
4
|
+
data.tar.gz: f297da03e165f882509ce8c94d22bfd9a653bc85201090d820e2b06994d04d49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 410e587cb975091aa513bdff82785ea2d9f29f9f224f8462e4940dbd8fa57d39625ec3c48bef1674e4c06b21677de7e6186234fe6115278cce93250062a11389
|
7
|
+
data.tar.gz: 3b17a5cdd8b103db034ca4b6cc9a5971162c41ff8e8b4cde0c0044a5bba8c9074b77cb19f5274613e18c7ba45812ffa3e63bb712eb719894b4d9d16286699db9
|
data/NOTES
CHANGED
data/conn.c
CHANGED
@@ -1855,14 +1855,20 @@ Init_ldap_conn ()
|
|
1855
1855
|
{
|
1856
1856
|
rb_ldap_sort_obj = Qnil;
|
1857
1857
|
|
1858
|
+
#if defined(RB_LDAP_RVC) && RB_LDAP_RVC < 30000
|
1858
1859
|
rb_cLDAP_Conn = rb_define_class_under (rb_mLDAP, "Conn", rb_cData);
|
1860
|
+
#endif
|
1861
|
+
#if defined(RB_LDAP_RVC) && RB_LDAP_RVC >= 30000
|
1862
|
+
rb_cLDAP_Conn = rb_define_class_under (rb_mLDAP, "Conn", rb_cObject);
|
1863
|
+
rb_undef_alloc_func(rb_cLDAP_Conn);
|
1864
|
+
#endif
|
1859
1865
|
rb_define_attr (rb_cLDAP_Conn, "referrals", 1, 0);
|
1860
1866
|
rb_define_attr (rb_cLDAP_Conn, "controls", 1, 0);
|
1861
1867
|
rb_define_attr (rb_cLDAP_Conn, "sasl_quiet", 1, 1);
|
1862
|
-
#if
|
1868
|
+
#if defined(RB_LDAP_RVC) && RB_LDAP_RVC < 10700
|
1863
1869
|
rb_define_singleton_method (rb_cLDAP_Conn, "new", rb_ldap_class_new, -1);
|
1864
1870
|
#endif
|
1865
|
-
#if
|
1871
|
+
#if defined(RB_LDAP_RVC) && RB_LDAP_RVC >= 10703
|
1866
1872
|
rb_define_alloc_func (rb_cLDAP_Conn, rb_ldap_conn_s_allocate);
|
1867
1873
|
#else
|
1868
1874
|
rb_define_singleton_method (rb_cLDAP_Conn, "allocate",
|
data/entry.c
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
VALUE rb_cLDAP_Entry;
|
10
10
|
|
11
|
-
#if
|
11
|
+
#if defined(RB_LDAP_RVC) && RB_LDAP_RVC >= 10900
|
12
12
|
static void
|
13
13
|
rb_ldap_entry_mark(RB_LDAPENTRY_DATA *edata)
|
14
14
|
{
|
@@ -88,11 +88,11 @@ rb_ldap_entry_new (LDAP * ldap, LDAPMessage * msg)
|
|
88
88
|
{
|
89
89
|
VALUE val;
|
90
90
|
RB_LDAPENTRY_DATA *edata;
|
91
|
-
#if
|
91
|
+
#if defined(RB_LDAP_RVC) && RB_LDAP_RVC >= 10900
|
92
92
|
char *c_dn;
|
93
93
|
#endif
|
94
94
|
|
95
|
-
#if
|
95
|
+
#if defined(RB_LDAP_RVC) && RB_LDAP_RVC >= 10900
|
96
96
|
val = Data_Make_Struct (rb_cLDAP_Entry, RB_LDAPENTRY_DATA,
|
97
97
|
rb_ldap_entry_mark, rb_ldap_entry_free, edata);
|
98
98
|
#else
|
@@ -102,7 +102,7 @@ rb_ldap_entry_new (LDAP * ldap, LDAPMessage * msg)
|
|
102
102
|
edata->ldap = ldap;
|
103
103
|
edata->msg = msg;
|
104
104
|
|
105
|
-
#if
|
105
|
+
#if defined(RB_LDAP_RVC) && RB_LDAP_RVC >= 10900
|
106
106
|
/* get dn */
|
107
107
|
c_dn = ldap_get_dn(ldap, msg);
|
108
108
|
if (c_dn) {
|
@@ -128,14 +128,14 @@ VALUE
|
|
128
128
|
rb_ldap_entry_get_dn (VALUE self)
|
129
129
|
{
|
130
130
|
RB_LDAPENTRY_DATA *edata;
|
131
|
-
#if
|
131
|
+
#if defined(RB_LDAP_RVC) && RB_LDAP_RVC < 10900
|
132
132
|
char *cdn;
|
133
133
|
VALUE dn;
|
134
134
|
#endif
|
135
135
|
|
136
136
|
GET_LDAPENTRY_DATA (self, edata);
|
137
137
|
|
138
|
-
#if
|
138
|
+
#if defined(RB_LDAP_RVC) && RB_LDAP_RVC < 10900
|
139
139
|
cdn = ldap_get_dn (edata->ldap, edata->msg);
|
140
140
|
if (cdn)
|
141
141
|
{
|
@@ -166,7 +166,7 @@ VALUE
|
|
166
166
|
rb_ldap_entry_get_values (VALUE self, VALUE attr)
|
167
167
|
{
|
168
168
|
RB_LDAPENTRY_DATA *edata;
|
169
|
-
#if
|
169
|
+
#if defined(RB_LDAP_RVC) && RB_LDAP_RVC < 10900
|
170
170
|
char *c_attr;
|
171
171
|
struct berval **c_vals;
|
172
172
|
int i;
|
@@ -175,7 +175,7 @@ rb_ldap_entry_get_values (VALUE self, VALUE attr)
|
|
175
175
|
#endif
|
176
176
|
|
177
177
|
GET_LDAPENTRY_DATA (self, edata);
|
178
|
-
#if
|
178
|
+
#if defined(RB_LDAP_RVC) && RB_LDAP_RVC < 10900
|
179
179
|
c_attr = StringValueCStr (attr);
|
180
180
|
|
181
181
|
c_vals = ldap_get_values_len (edata->ldap, edata->msg, c_attr);
|
@@ -213,7 +213,7 @@ VALUE
|
|
213
213
|
rb_ldap_entry_get_attributes (VALUE self)
|
214
214
|
{
|
215
215
|
RB_LDAPENTRY_DATA *edata;
|
216
|
-
#if
|
216
|
+
#if defined(RB_LDAP_RVC) && RB_LDAP_RVC < 10900
|
217
217
|
VALUE vals;
|
218
218
|
char *attr;
|
219
219
|
BerElement *ber = NULL;
|
@@ -223,7 +223,7 @@ rb_ldap_entry_get_attributes (VALUE self)
|
|
223
223
|
|
224
224
|
GET_LDAPENTRY_DATA (self, edata);
|
225
225
|
|
226
|
-
#if
|
226
|
+
#if defined(RB_LDAP_RVC) && RB_LDAP_RVC < 10900
|
227
227
|
vals = rb_ary_new ();
|
228
228
|
for (attr = ldap_first_attribute (edata->ldap, edata->msg, &ber);
|
229
229
|
attr != NULL;
|
@@ -259,7 +259,7 @@ rb_ldap_entry_get_attributes (VALUE self)
|
|
259
259
|
VALUE
|
260
260
|
rb_ldap_entry_to_hash (VALUE self)
|
261
261
|
{
|
262
|
-
#if
|
262
|
+
#if defined(RB_LDAP_RVC) && RB_LDAP_RVC < 10900
|
263
263
|
VALUE attrs = rb_ldap_entry_get_attributes (self);
|
264
264
|
VALUE hash = rb_hash_new ();
|
265
265
|
VALUE attr, vals;
|
@@ -269,7 +269,7 @@ rb_ldap_entry_to_hash (VALUE self)
|
|
269
269
|
VALUE hash, dn_ary;
|
270
270
|
#endif
|
271
271
|
|
272
|
-
#if
|
272
|
+
#if defined(RB_LDAP_RVC) && RB_LDAP_RVC < 10900
|
273
273
|
Check_Type (attrs, T_ARRAY);
|
274
274
|
rb_hash_aset (hash, rb_tainted_str_new2 ("dn"),
|
275
275
|
rb_ary_new3 (1, rb_ldap_entry_get_dn (self)));
|
@@ -305,7 +305,7 @@ rb_ldap_entry_inspect (VALUE self)
|
|
305
305
|
str = rb_str_new (0, strlen (c) + 10 + 16 + 1); /* 10:tags 16:addr 1:nul */
|
306
306
|
sprintf (RSTRING_PTR (str), "#<%s:0x%lx\n", c, self);
|
307
307
|
|
308
|
-
#if
|
308
|
+
#if defined(RB_LDAP_RVC) && RB_LDAP_RVC < 10900
|
309
309
|
RSTRING(str)->len = strlen (RSTRING_PTR (str));
|
310
310
|
#else
|
311
311
|
rb_str_set_len(str, strlen (RSTRING_PTR (str)));
|
data/extconf.rb
CHANGED
@@ -257,6 +257,12 @@ have_func("ldap_sasl_interactive_bind_s")
|
|
257
257
|
|
258
258
|
$defs << "-DRUBY_VERSION_CODE=#{RUBY_VERSION.gsub(/\D/, '')}"
|
259
259
|
|
260
|
+
def rb_ldap_rb_ver_code
|
261
|
+
( _major, _minor, _teeny ) = RUBY_VERSION.split(/\D/)
|
262
|
+
_rvc = _major.to_i * 10000 + _minor.to_i * 100 + _teeny.to_i
|
263
|
+
end
|
264
|
+
$defs << "-DRB_LDAP_RVC=#{rb_ldap_rb_ver_code}"
|
265
|
+
|
260
266
|
create_makefile("ldap")
|
261
267
|
|
262
268
|
|
data/misc.c
CHANGED
@@ -131,7 +131,7 @@ rb_ldap_control_s_allocate (VALUE klass)
|
|
131
131
|
return Data_Wrap_Struct (klass, 0, rb_ldap_control_free, ctl);
|
132
132
|
}
|
133
133
|
|
134
|
-
#if
|
134
|
+
#if defined(RB_LDAP_RVC) && RB_LDAP_RVC < 10700
|
135
135
|
static VALUE
|
136
136
|
rb_ldap_control_s_new (int argc, VALUE argv[], VALUE klass)
|
137
137
|
{
|
@@ -479,11 +479,11 @@ Init_ldap_misc ()
|
|
479
479
|
|
480
480
|
#ifdef HAVE_LDAPCONTROL
|
481
481
|
rb_cLDAP_Control = rb_define_class_under (rb_mLDAP, "Control", rb_cObject);
|
482
|
-
#if
|
482
|
+
#if defined(RB_LDAP_RVC) && RB_LDAP_RVC < 10700
|
483
483
|
rb_define_singleton_method (rb_cLDAP_Control, "new",
|
484
484
|
rb_ldap_control_s_new, -1);
|
485
485
|
#endif
|
486
|
-
#if
|
486
|
+
#if defined(RB_LDAP_RVC) && RB_LDAP_RVC >= 10703
|
487
487
|
rb_define_alloc_func (rb_cLDAP_Control, rb_ldap_control_s_allocate);
|
488
488
|
#else
|
489
489
|
rb_define_singleton_method (rb_cLDAP_Control, "allocate",
|
data/mod.c
CHANGED
@@ -283,7 +283,7 @@ rb_ldap_mod_inspect (VALUE self)
|
|
283
283
|
str = rb_str_new (0, strlen (c) + 10 + 16 + 1); /* 10:tags 16:addr 1:nul */
|
284
284
|
sprintf (RSTRING_PTR (str), "#<%s:0x%lx ", c, self);
|
285
285
|
|
286
|
-
#if
|
286
|
+
#if defined(RB_LDAP_RVC) && RB_LDAP_RVC < 10900
|
287
287
|
RSTRING(str)->len = strlen (RSTRING_PTR (str));
|
288
288
|
#else
|
289
289
|
rb_str_set_len(str, strlen (RSTRING_PTR (str)));
|
@@ -336,10 +336,10 @@ void
|
|
336
336
|
Init_ldap_mod ()
|
337
337
|
{
|
338
338
|
rb_cLDAP_Mod = rb_define_class_under (rb_mLDAP, "Mod", rb_cObject);
|
339
|
-
#if
|
339
|
+
#if defined(RB_LDAP_RVC) && RB_LDAP_RVC < 10700
|
340
340
|
rb_define_singleton_method (rb_cLDAP_Mod, "new", rb_ldap_class_new, -1);
|
341
341
|
#endif
|
342
|
-
#if
|
342
|
+
#if defined(RB_LDAP_RVC) && RB_LDAP_RVC >= 10703
|
343
343
|
rb_define_alloc_func (rb_cLDAP_Mod, rb_ldap_mod_s_allocate);
|
344
344
|
#else
|
345
345
|
rb_define_singleton_method (rb_cLDAP_Mod, "allocate",
|
data/rbldap.h
CHANGED
@@ -28,7 +28,7 @@
|
|
28
28
|
#define RB_LDAP_MAJOR_VERSION 0
|
29
29
|
#define RB_LDAP_MINOR_VERSION 9
|
30
30
|
#define RB_LDAP_PATCH_VERSION 20
|
31
|
-
#define RB_LDAP_VERSION "0.10.
|
31
|
+
#define RB_LDAP_VERSION "0.10.1"
|
32
32
|
|
33
33
|
#define LDAP_GET_OPT_MAX_BUFFER_SIZE (1024) /* >= sizeof(LDAPAPIInfo) */
|
34
34
|
|
@@ -55,7 +55,7 @@ typedef struct rb_ldapentry_data
|
|
55
55
|
{
|
56
56
|
LDAP *ldap;
|
57
57
|
LDAPMessage *msg;
|
58
|
-
#if
|
58
|
+
#if defined(RB_LDAP_RVC) && RB_LDAP_RVC >= 10900
|
59
59
|
VALUE dn;
|
60
60
|
VALUE attr;
|
61
61
|
#endif
|
@@ -173,7 +173,7 @@ VALUE rb_ldap_mod_vals (VALUE);
|
|
173
173
|
}; \
|
174
174
|
}
|
175
175
|
|
176
|
-
#if
|
176
|
+
#if defined(RB_LDAP_RVC) && RB_LDAP_RVC < 10900
|
177
177
|
#define GET_LDAPENTRY_DATA(obj,ptr) { \
|
178
178
|
Data_Get_Struct(obj, struct rb_ldapentry_data, ptr); \
|
179
179
|
if( ! ptr->msg ){ \
|
@@ -205,3 +205,14 @@ VALUE rb_ldap_mod_vals (VALUE);
|
|
205
205
|
rb_define_method(rb_cLDAP_Mod,method,cfunc,argc)
|
206
206
|
|
207
207
|
#endif
|
208
|
+
|
209
|
+
#if defined(RB_LDAP_RVC) && RB_LDAP_RVC >= 20700
|
210
|
+
# if defined rb_tainted_str_new
|
211
|
+
# undef rb_tainted_str_new
|
212
|
+
# endif
|
213
|
+
# if defined rb_tainted_str_new2
|
214
|
+
# undef rb_tainted_str_new2
|
215
|
+
# endif
|
216
|
+
# define rb_tainted_str_new(p,l) rb_str_new((p),(l))
|
217
|
+
# define rb_tainted_str_new2(p) rb_str_new_cstr((p))
|
218
|
+
#endif
|