ruby-shadow 2.4.1 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY +6 -0
- data/README +18 -15
- data/pwd/shadow.c +2 -0
- data/ruby-shadow.gemspec +1 -1
- data/shadow/shadow.c +21 -12
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1de672d3098aaa075b6e6a56256d320a5b5b98e
|
4
|
+
data.tar.gz: ed35c6a88d87c0633d5e93a6520da7918618d53e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 098561c08e3037f7b08dff37c8af296918e42748bbfc55ff5849121d74c37884f3706276ab32986866a29e55130d92e116094e653244c624fe87d8c2f1e61864
|
7
|
+
data.tar.gz: 76202564ea9ef353e7f7c699a66d6c1c050e7698965db32ffcbae6365e33ad055a7d558f51626397a52ea4c74a6b1894020f728cf0e5e479f6ee75ae4c1876e3
|
data/HISTORY
CHANGED
data/README
CHANGED
@@ -26,20 +26,23 @@ make # use gmake on FreeBSD
|
|
26
26
|
still present, but no promises about earlier versions of Ruby.
|
27
27
|
|
28
28
|
3. Shadow::Passwd module's methods
|
29
|
-
|
30
|
-
Method
|
31
|
-
|
32
|
-
getspent
|
33
|
-
getspnam(name)
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
lock
|
42
|
-
|
29
|
+
________________________________________________________________________
|
30
|
+
Method | Linux | Solaris | OS X | *BSD
|
31
|
+
________________________________________________________________________
|
32
|
+
getspent | * | * | * | *
|
33
|
+
getspnam(name) | * | * | * | *
|
34
|
+
from_user_name(name) (alias of above) | * | * | * | *
|
35
|
+
setspent | * | * | * | *
|
36
|
+
endspent | * | * | * | *
|
37
|
+
fgetspent(file) | * | * | N | N
|
38
|
+
sgetspent(str) | * | N | N | N
|
39
|
+
putspent(entry,file) | * | * | N | N
|
40
|
+
add_password_entry (alias of above ) | * | * | N | N
|
41
|
+
lckpwdf,lock | * | * | N | N
|
42
|
+
ulckpwdf,unlock | * | * | N | N
|
43
|
+
lock? | * | * | N | N
|
44
|
+
|
45
|
+
Check the implementation in use via Shadow::IMPLEMENTATION.
|
43
46
|
|
44
47
|
4. Structure
|
45
48
|
|
@@ -83,7 +86,7 @@ when you exit the iterator block.
|
|
83
86
|
|
84
87
|
* man shadow
|
85
88
|
* /usr/include/shadow.h
|
86
|
-
* Code at https://github.com/
|
89
|
+
* Code at https://github.com/apalmblad/ruby-shadow
|
87
90
|
|
88
91
|
|
89
92
|
Original Author:
|
data/pwd/shadow.c
CHANGED
@@ -115,6 +115,7 @@ Init_shadow()
|
|
115
115
|
"sg_adm","sg_mem",NULL);
|
116
116
|
|
117
117
|
rb_mShadow = rb_define_module("Shadow");
|
118
|
+
rb_define_const( rb_mShadow, "IMPLEMENTATION", rb_str_new_cstr( "PWD" ) );
|
118
119
|
rb_eFileLock = rb_define_class_under(rb_mShadow,"FileLock",rb_eException);
|
119
120
|
rb_mPasswd = rb_define_module_under(rb_mShadow,"Passwd");
|
120
121
|
rb_define_const(rb_mPasswd,"Entry",rb_sPasswdEntry);
|
@@ -125,4 +126,5 @@ Init_shadow()
|
|
125
126
|
rb_define_module_function(rb_mPasswd,"endspent",rb_shadow_endspent,0);
|
126
127
|
rb_define_module_function(rb_mPasswd,"getspent",rb_shadow_getspent,0);
|
127
128
|
rb_define_module_function(rb_mPasswd,"getspnam",rb_shadow_getspnam,1);
|
129
|
+
rb_define_module_function(rb_mPasswd,"from_user_name",rb_shadow_getspnam,1);
|
128
130
|
}
|
data/ruby-shadow.gemspec
CHANGED
data/shadow/shadow.c
CHANGED
@@ -144,21 +144,27 @@ rb_shadow_putspent(VALUE self, VALUE entry, VALUE file)
|
|
144
144
|
|
145
145
|
if( TYPE(file) != T_FILE )
|
146
146
|
rb_raise(rb_eTypeError,"argument must be a File.");
|
147
|
-
|
147
|
+
/*
|
148
148
|
for(i=0; i<NUM_FIELDS; i++)
|
149
|
-
|
149
|
+
{
|
150
|
+
val[i] = rb_ary_entry( entry, i ); //val[i] = RSTRUCT(entry)->ptr[i];
|
151
|
+
i//val[i] = rb_struct_aref( entry, i );
|
152
|
+
}
|
153
|
+
*/
|
150
154
|
cfile = file_ptr( RFILE(file)->fptr );
|
151
155
|
|
152
|
-
|
153
|
-
centry.sp_namp = StringValuePtr(
|
154
|
-
|
155
|
-
centry.
|
156
|
-
centry.
|
157
|
-
centry.
|
158
|
-
centry.
|
159
|
-
centry.
|
160
|
-
centry.
|
161
|
-
|
156
|
+
VALUE x = rb_ary_entry( entry, 0 );
|
157
|
+
centry.sp_namp = StringValuePtr( x );
|
158
|
+
x = rb_ary_entry( entry, 1 );
|
159
|
+
centry.sp_pwdp = StringValuePtr( x );
|
160
|
+
centry.sp_lstchg = FIX2INT( rb_ary_entry( entry, 2) );
|
161
|
+
centry.sp_min = FIX2INT( rb_ary_entry( entry, 3 ) );
|
162
|
+
centry.sp_max = FIX2INT( rb_ary_entry( entry, 4 ) );
|
163
|
+
centry.sp_warn = FIX2INT( rb_ary_entry( entry, 5 ));
|
164
|
+
centry.sp_inact = FIX2INT( rb_ary_entry( entry, 6 ) );
|
165
|
+
// missing 7 I think is put in to deal with beign similar to BSD returns, for the value pw_change.
|
166
|
+
centry.sp_expire = FIX2INT( rb_ary_entry( entry, 8 ) );
|
167
|
+
centry.sp_flag = FIX2INT( rb_ary_entry( entry, 9 ) );
|
162
168
|
|
163
169
|
result = putspent(¢ry,cfile);
|
164
170
|
|
@@ -252,6 +258,7 @@ Init_shadow()
|
|
252
258
|
"sg_adm","sg_mem",NULL);
|
253
259
|
|
254
260
|
rb_mShadow = rb_define_module("Shadow");
|
261
|
+
rb_define_const( rb_mShadow, "IMPLEMENTATION", rb_str_new_cstr( "SHADOW" ) );
|
255
262
|
rb_eFileLock = rb_define_class_under(rb_mShadow,"FileLock",rb_eException);
|
256
263
|
rb_mPasswd = rb_define_module_under(rb_mShadow,"Passwd");
|
257
264
|
rb_define_const(rb_mPasswd,"Entry",rb_sPasswdEntry);
|
@@ -266,7 +273,9 @@ Init_shadow()
|
|
266
273
|
rb_define_module_function(rb_mPasswd,"fgetspent",rb_shadow_fgetspent,1);
|
267
274
|
rb_define_module_function(rb_mPasswd,"getspent",rb_shadow_getspent,0);
|
268
275
|
rb_define_module_function(rb_mPasswd,"getspnam",rb_shadow_getspnam,1);
|
276
|
+
rb_define_module_function(rb_mPasswd,"from_user_name",rb_shadow_getspnam,1);
|
269
277
|
rb_define_module_function(rb_mPasswd,"putspent",rb_shadow_putspent,2);
|
278
|
+
rb_define_module_function(rb_mPasswd,"add_password_entry",rb_shadow_putspent,2);
|
270
279
|
rb_define_module_function(rb_mPasswd,"lckpwdf",rb_shadow_lckpwdf,0);
|
271
280
|
rb_define_module_function(rb_mPasswd,"lock",rb_shadow_lock,0);
|
272
281
|
rb_define_module_function(rb_mPasswd,"ulckpwdf",rb_shadow_ulckpwdf,0);
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-shadow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Palmblad
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date:
|
16
|
+
date: 2015-10-06 00:00:00.000000000 Z
|
17
17
|
dependencies: []
|
18
18
|
description: This module provides access to shadow passwords on Linux, OSX, FreeBSD,
|
19
19
|
OpenBSD, and Solaris
|
@@ -55,7 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
55
55
|
version: '0'
|
56
56
|
requirements: []
|
57
57
|
rubyforge_project:
|
58
|
-
rubygems_version: 2.4.
|
58
|
+
rubygems_version: 2.4.8
|
59
59
|
signing_key:
|
60
60
|
specification_version: 4
|
61
61
|
summary: "*nix Shadow Password Module"
|