sys-admin 1.6.4 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGES +168 -161
- data/MANIFEST +18 -18
- data/README +148 -154
- data/Rakefile +47 -47
- data/certs/djberg96_pub.pem +22 -17
- data/doc/sys-admin-unix.txt +162 -162
- data/doc/sys-admin-windows.txt +346 -346
- data/examples/example_groups.rb +27 -27
- data/examples/example_users.rb +41 -41
- data/lib/bsd/sys/admin.rb +256 -256
- data/lib/darwin/sys/admin.rb +237 -237
- data/lib/linux/sys/admin.rb +273 -273
- data/lib/sunos/sys/admin.rb +261 -261
- data/lib/sys-admin.rb +1 -1
- data/lib/sys/admin.rb +24 -24
- data/lib/sys/admin/common.rb +137 -137
- data/lib/sys/admin/custom.rb +16 -16
- data/lib/unix/sys/admin.rb +163 -163
- data/lib/windows/sys/admin.rb +997 -997
- data/sys-admin.gemspec +31 -31
- data/test/test_sys_admin.rb +19 -19
- data/test/test_sys_admin_unix.rb +260 -260
- data/test/test_sys_admin_windows.rb +337 -337
- metadata +51 -27
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99eafdabb409a5f068337908f24ff54f7ec71c1b
|
4
|
+
data.tar.gz: 4596acd0951f39bdb26a8a9c24319a35a5f52ecc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84af367e19c13a4e1ee0e1f1cc716f6fdb744d2d870207b1848333649d44a2ced3dd302acab2c5939c38343a50c74005cf89fba038326408914d69349d10aaba
|
7
|
+
data.tar.gz: 6a5c585230206ca94a8350a26c12ed0a0bef38e3de96dc2d62fd0873bfe4a8583c7945d1f70e3670324659aa51e0c651e4a5eb5a38be692780de25aa9de37b8e
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGES
CHANGED
@@ -1,161 +1,168 @@
|
|
1
|
-
== 1.
|
2
|
-
*
|
3
|
-
*
|
4
|
-
*
|
5
|
-
*
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
*
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
*
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
* Added
|
24
|
-
|
25
|
-
|
26
|
-
*
|
27
|
-
|
28
|
-
*
|
29
|
-
*
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
*
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
*
|
56
|
-
|
57
|
-
== 1.5.
|
58
|
-
*
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
*
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
* Added
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
*
|
75
|
-
|
76
|
-
|
77
|
-
*
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
*
|
82
|
-
*
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
*
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
== 1.4.
|
94
|
-
*
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
*
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
*
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
*
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
*
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
*
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
*
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
*
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
*
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
*
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
*
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
1
|
+
== 1.7.0 - 21-Feb-2018
|
2
|
+
* Changed the license to Apache 2.0.
|
3
|
+
* VERSION constant is now frozen.
|
4
|
+
* Ignore dependency warnings in gem:create task.
|
5
|
+
* Minor README updates.
|
6
|
+
* Updated cert.
|
7
|
+
|
8
|
+
== 1.6.4 - 6-Sep-2015
|
9
|
+
* Added a sys-admin.rb file for convenience.
|
10
|
+
* Set VERSION in a single place.
|
11
|
+
* Assume Rubygems 2.x for Rakefile tasks.
|
12
|
+
* This gem is now signed.
|
13
|
+
|
14
|
+
== 1.6.3 - 8-Mar-2014
|
15
|
+
* The Admin#get_group method now handles groups with very large numbers
|
16
|
+
of members more robustly.
|
17
|
+
|
18
|
+
== 1.6.2 - 11-Feb-2014
|
19
|
+
* The User#gid method is now supported on MS Windows. It returns the user's
|
20
|
+
primary group ID.
|
21
|
+
|
22
|
+
== 1.6.1 - 24-Jan-2014
|
23
|
+
* Added the Admin.add_group_member and Admin.remove_group member methods. These
|
24
|
+
let you add a user to a specific group. Thanks go to Alexey Kolyanov for the
|
25
|
+
idea and the code.
|
26
|
+
* Modified the Admin.configure_user method so that you don't need to know the
|
27
|
+
old password. Just pass a single string argument for the new password.
|
28
|
+
* Fixed a potential encoding issue for the Admin.get_login method on JRuby.
|
29
|
+
* Updated the gem:create task in the Rakefile.
|
30
|
+
* Added rake as a development dependency.
|
31
|
+
|
32
|
+
== 1.6.0 - 5-Jan-2013
|
33
|
+
* Converted code to use FFI. This mostly only affects the unix flavors.
|
34
|
+
* The Admin.users and Admin.groups methods no longer accept a block.
|
35
|
+
* Some test suite updates.
|
36
|
+
* Because all code is now pure Ruby, there is longer any need for two
|
37
|
+
separate gems. There is now a single, unified gem that works on all
|
38
|
+
supported platforms.
|
39
|
+
|
40
|
+
== 1.5.6 - 30-Jul-2011
|
41
|
+
* Fixed issue for non-gnu platforms where it would use the wrong function
|
42
|
+
prototype because the Ruby core team took it upon themselves to explicitly
|
43
|
+
defined _GNU_SOURCE in config.h in 1.8.7 and later for reasons that baffle me.
|
44
|
+
* Some tests on Windows are now skipped unless run with elevated security.
|
45
|
+
|
46
|
+
== 1.5.5 - 5-Jul-2011
|
47
|
+
* Modified lastlog handling, and ignore getpwent_r and getgrent_r, on AIX.
|
48
|
+
Thanks go to Rick Ohnemus for the spot and patches.
|
49
|
+
* Explicitly set spec.cpu on Windows to 'universal' in the gem creation task.
|
50
|
+
* Fixed a bug in the User.get_login and User.get_group methods where the query
|
51
|
+
being generated was incorrect if no options were passed. Thanks go to
|
52
|
+
Matthew Brown for the spot.
|
53
|
+
|
54
|
+
== 1.5.4 - 7-Oct-2010
|
55
|
+
* Prefer the getlastlogx() function over lastlog() where supported.
|
56
|
+
|
57
|
+
== 1.5.3 - 6-Oct-2010
|
58
|
+
* Refactored the Rakefile. The old installation tasks have been replaced
|
59
|
+
with gem build and install tasks. In addition, the platform handling has
|
60
|
+
been updated for MS Windows.
|
61
|
+
* Portions of the gemspec have been moved into the Rakefile gem tasks.
|
62
|
+
* Deploying the mingw gem by default for MS Windows now.
|
63
|
+
|
64
|
+
== 1.5.2 - 2-Aug-2009
|
65
|
+
* Now compatible with Ruby 1.9.x.
|
66
|
+
* Added test-unit as a development dependency.
|
67
|
+
|
68
|
+
== 1.5.1 - 23-Jul-2009
|
69
|
+
* Added the User#dir attribute. This attribute contains a user's home
|
70
|
+
directory if set, or nil if it isn't.
|
71
|
+
* User objects returned by the Admin.users method now include the uid.
|
72
|
+
Previously only the Admin.get_user method set it.
|
73
|
+
* Added win32-security as a dependency.
|
74
|
+
* Changed license to Artistic 2.0.
|
75
|
+
|
76
|
+
== 1.5.0 - 29-Mar-2009
|
77
|
+
* INTERFACE CHANGE (WINDOWS ONLY): The interface for MS Windows has undergone
|
78
|
+
a radical change. Most methods now accept a hash of options that are
|
79
|
+
passed directly to the underlying WMI class. Please see the documentation
|
80
|
+
for details.
|
81
|
+
* Now works on various BSD flavors.
|
82
|
+
* Added the User#groups method. This returns an array of groups that the
|
83
|
+
user belongs to. Suggestion inspired by Gonzalo Garramuno.
|
84
|
+
* Added the Group#members method. The returns an array of users that the
|
85
|
+
group contains.
|
86
|
+
* Changed User#class to User#access_class for UNIX flavors to avoid
|
87
|
+
conflicts with the Ruby core Object method.
|
88
|
+
* Added more tests and renamed the test files.
|
89
|
+
* Removed an unnecessary function call where a platform might try to
|
90
|
+
get lastlog information even if the lastlog.h or utmp.h headers couldn't
|
91
|
+
be found.
|
92
|
+
|
93
|
+
== 1.4.4 - 19-Nov-2008
|
94
|
+
* Added the User#uid method for MS Windows (which is just the user's relative
|
95
|
+
identifier).
|
96
|
+
* Now requires test-unit 2.x.
|
97
|
+
* Some updates to the test suite to take advantage of test-unit 2.x features.
|
98
|
+
* Some minor gemspec tweaks.
|
99
|
+
|
100
|
+
== 1.4.3 - 2-Mar-2008
|
101
|
+
* The block form of Admin.users now properly ensures that endpwent() is
|
102
|
+
called. Likewise, the block form of Admin.groups now properly ensures
|
103
|
+
that endgrent() is called. This would only have been an issue if you
|
104
|
+
broke out of the block before it terminated.
|
105
|
+
* The AdminError class is now Admin::Error.
|
106
|
+
* Some internal directory layout changes.
|
107
|
+
|
108
|
+
== 1.4.2 - 26-Jun-2007
|
109
|
+
* Fixed a bug in the Admin.get_login method where it would return junk
|
110
|
+
if the underlying getlogin() function failed (Unix). Thanks go to Gonzalo
|
111
|
+
Garramuno for the spot. This bug also resulted in some refactoring of the
|
112
|
+
underlying C code.
|
113
|
+
* Removed the install.rb file. The logic in that file has been moved directly
|
114
|
+
into the Rakefile.
|
115
|
+
|
116
|
+
== 1.4.1 - 21-Mar-2007
|
117
|
+
* Bug fix for OS X. Thanks go to an anonymous user for the spot.
|
118
|
+
* Added a Rakefile. Building, testing and installing should now use the
|
119
|
+
Rake tasks (for non-gem installs).
|
120
|
+
* Much more inline documentation, especially for User and Group attributes.
|
121
|
+
|
122
|
+
== 1.4.0 - 20-Jan-2007
|
123
|
+
* Added the following methods: add_local_user, config_local_user,
|
124
|
+
delete_local_user, add_global_group, config_global_group, and
|
125
|
+
delete_global_group. MS Windows only at the moment.
|
126
|
+
* Added corresponding tests.
|
127
|
+
* Added much more inline documentation.
|
128
|
+
* Major refactoring of the get_lastlog_info helper function in admin.h. This
|
129
|
+
fixed a major bug in some flavors of Linux where the Admin.users method
|
130
|
+
could go into an infinite loop. It also fixed some minor bugs where console
|
131
|
+
and host values were sometimes filled with junk characters.
|
132
|
+
* Added the User#change attribute, and a check for the pw_change struct member
|
133
|
+
in the extconf.rb file.
|
134
|
+
* The User#expire attribute is now handled as a Time object instead of an
|
135
|
+
integer.
|
136
|
+
* Renamed tc_win32.rb to tc_windows.rb
|
137
|
+
|
138
|
+
== 1.3.1 - 29-Jun-2005
|
139
|
+
* Fixed a bug where the inability to read the lastlog file caused an error.
|
140
|
+
From now on that error is ignored, and the lastlog attributes of the User
|
141
|
+
object are set to nil.
|
142
|
+
* Added a beta version of Admin.delete_user (Windows only).
|
143
|
+
|
144
|
+
== 1.3.0 - 3-Jun-2005
|
145
|
+
* Bug fixes for Linux.
|
146
|
+
* Removed the version.h file - no longer needed since the Win32 version is
|
147
|
+
pure Ruby.
|
148
|
+
|
149
|
+
== 1.2.0 - 30-Apr-2005
|
150
|
+
* Replaced the Win32 version with a pure Ruby version that uses Win32API and
|
151
|
+
win32ole + WMI.
|
152
|
+
* The LocalGroup class no longer exists in the Win32 version. Instead, it is
|
153
|
+
now an attribute of a Group object. The issue was forced by WMI.
|
154
|
+
* The default for users and groups on Win32 systems is now local rather than
|
155
|
+
global. See the documentation for why you probably don't want to iterate
|
156
|
+
over global accounts.
|
157
|
+
* Corresponding doc changes and test suite changes.
|
158
|
+
|
159
|
+
== 1.1.0 - 1-Apr-2005
|
160
|
+
* Fixed bug where a segfault could occur when trying to retrieve a user or
|
161
|
+
group by an ID that didn't exist (Unix).
|
162
|
+
* Added tests for intentional failures.
|
163
|
+
* Added lastlog information tothe User class (Unix).
|
164
|
+
* Modified the way User objects are created internally (Unix).
|
165
|
+
* Fixed a bug in the User#shell attribute (Unix).
|
166
|
+
|
167
|
+
== 1.0.0 - 25-Mar-2005
|
168
|
+
* Initial release
|
data/MANIFEST
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
* sys-admin.gemspec
|
2
|
-
* CHANGES
|
3
|
-
* MANIFEST
|
4
|
-
* Rakefile
|
5
|
-
* README
|
6
|
-
* certs/djberg96_pub.pem
|
7
|
-
* examples/groups.rb
|
8
|
-
* examples/users.rb
|
9
|
-
* lib/sys/admin.rb
|
10
|
-
* lib/darwin/sys/admin.rb
|
11
|
-
* lib/linux/sys/admin.rb
|
12
|
-
* lib/bsd/sys/admin.rb
|
13
|
-
* lib/sunos/sys/admin.rb
|
14
|
-
* lib/sys/admin/common.rb
|
15
|
-
* lib/sys/admin/custom.rb
|
16
|
-
* test/test_sys_admin.rb
|
17
|
-
* test/test_sys_admin_unix.rb
|
18
|
-
* test/test_sys_admin_windows.rb
|
1
|
+
* sys-admin.gemspec
|
2
|
+
* CHANGES
|
3
|
+
* MANIFEST
|
4
|
+
* Rakefile
|
5
|
+
* README
|
6
|
+
* certs/djberg96_pub.pem
|
7
|
+
* examples/groups.rb
|
8
|
+
* examples/users.rb
|
9
|
+
* lib/sys/admin.rb
|
10
|
+
* lib/darwin/sys/admin.rb
|
11
|
+
* lib/linux/sys/admin.rb
|
12
|
+
* lib/bsd/sys/admin.rb
|
13
|
+
* lib/sunos/sys/admin.rb
|
14
|
+
* lib/sys/admin/common.rb
|
15
|
+
* lib/sys/admin/custom.rb
|
16
|
+
* test/test_sys_admin.rb
|
17
|
+
* test/test_sys_admin_unix.rb
|
18
|
+
* test/test_sys_admin_windows.rb
|
data/README
CHANGED
@@ -1,154 +1,148 @@
|
|
1
|
-
== Description
|
2
|
-
The sys-admin library is a unified, cross platform replacement for the Etc module.
|
3
|
-
|
4
|
-
== Installation
|
5
|
-
gem install sys-admin
|
6
|
-
|
7
|
-
== Synopsis
|
8
|
-
require 'sys/admin'
|
9
|
-
include Sys
|
10
|
-
|
11
|
-
# Returns an Array of User objects
|
12
|
-
a = Admin.users
|
13
|
-
|
14
|
-
# Returns an Array of Group objects
|
15
|
-
g = Admin.groups
|
16
|
-
|
17
|
-
# Get information about a particular user
|
18
|
-
p Admin.get_user("nobody")
|
19
|
-
p Admin.get_user("nobody", :localaccount => true)
|
20
|
-
|
21
|
-
# Get information about a particular group
|
22
|
-
p Admin.get_group("adm")
|
23
|
-
p Admin.get_group("adm", :localaccount => true)
|
24
|
-
|
25
|
-
== Admin
|
26
|
-
Admin.get_login
|
27
|
-
Returns the user name (only) of the current login.
|
28
|
-
|
29
|
-
Admin.get_user(name, options = {})
|
30
|
-
Admin.get_user(uid, options = {})
|
31
|
-
Returns a User object based on +name+ or +uid+. The +options+ hash is
|
32
|
-
for MS Windows only, and allows you to restrict the search based on the
|
33
|
-
options you provide, e.g. 'domain' or 'localaccount'.
|
34
|
-
|
35
|
-
Admin.get_group(name, options = {})
|
36
|
-
Admin.get_group(gid, options = {})
|
37
|
-
Returns a Group object based on +name+ or +uid+. The +options+ hash is
|
38
|
-
for MS Windows only, and allows you to restrict the search based on the
|
39
|
-
options you provide, e.g. 'domain' or 'localaccount'.
|
40
|
-
|
41
|
-
Admin.groups(options = {})
|
42
|
-
Returns an Array of Group objects.
|
43
|
-
|
44
|
-
The +options+ hash is for MS Windows only, and allows you to restrict the
|
45
|
-
search based on the options you provide, e.g. 'domain' or 'localaccount'.
|
46
|
-
|
47
|
-
Admin.users(options = {})
|
48
|
-
Returns an Array of User objects.
|
49
|
-
|
50
|
-
The +options+ hash is for MS Windows only, and allows you to restrict the
|
51
|
-
search based on the options you provide, e.g. 'domain' or 'localaccount'.
|
52
|
-
|
53
|
-
== User class
|
54
|
-
=== User (Windows)
|
55
|
-
The User class has the following attributes on MS Windows systems:
|
56
|
-
|
57
|
-
* account_type
|
58
|
-
* caption
|
59
|
-
* description
|
60
|
-
* domain
|
61
|
-
* password
|
62
|
-
* full_name
|
63
|
-
* gid
|
64
|
-
* install_date
|
65
|
-
* name
|
66
|
-
* sid
|
67
|
-
* status
|
68
|
-
* disabled?
|
69
|
-
* local?
|
70
|
-
* lockout?
|
71
|
-
* password_changeable?
|
72
|
-
* password_expires?
|
73
|
-
* password_required?
|
74
|
-
* uid
|
75
|
-
|
76
|
-
=== User (Unix)
|
77
|
-
The User class has the following attributes on Unix systems:
|
78
|
-
|
79
|
-
* name
|
80
|
-
* passwd
|
81
|
-
* uid
|
82
|
-
* gid
|
83
|
-
* dir
|
84
|
-
* shell
|
85
|
-
* gecos
|
86
|
-
* quota
|
87
|
-
* age
|
88
|
-
* class
|
89
|
-
* comment
|
90
|
-
* change
|
91
|
-
* expire
|
92
|
-
|
93
|
-
== Group Classes
|
94
|
-
=== Group (Windows)
|
95
|
-
The Group class has the following attributes on MS Windows systems:
|
96
|
-
|
97
|
-
* caption
|
98
|
-
* description
|
99
|
-
* domain
|
100
|
-
* install_date
|
101
|
-
* name
|
102
|
-
* sid
|
103
|
-
* status
|
104
|
-
* gid
|
105
|
-
* local?
|
106
|
-
|
107
|
-
=== Group (Unix)
|
108
|
-
The Group class has the following attributes on Unix systems:
|
109
|
-
|
110
|
-
* name
|
111
|
-
* gid
|
112
|
-
* members
|
113
|
-
* passwd
|
114
|
-
|
115
|
-
== Error Classes
|
116
|
-
Admin::Error < StandardError
|
117
|
-
Raised if anything goes wrong with any of the above methods.
|
118
|
-
|
119
|
-
== Developer's Notes
|
120
|
-
=== MS Windows
|
121
|
-
The Windows version now uses a win32ole + WMI approach to getting
|
122
|
-
information. This means that the WMI service must be running on the
|
123
|
-
target machine in order to work (which it is, by default).
|
124
|
-
|
125
|
-
=== UNIX
|
126
|
-
The underlying implementation is similar to core Ruby's Etc implementation.
|
127
|
-
But, in addition to the different interface, I use the re-entrant version
|
128
|
-
of the appropriate functions when available.
|
129
|
-
|
130
|
-
== Future Plans
|
131
|
-
Make the User and Group objects comparable.
|
132
|
-
Add ability to add, configure and delete users on Unix platforms.
|
133
|
-
|
134
|
-
== Known Bugs
|
135
|
-
None that I'm aware of. If you find any, please log them on the project
|
136
|
-
page at:
|
137
|
-
|
138
|
-
https://github.com/djberg96/sys-admin
|
139
|
-
|
140
|
-
==
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
== Copyright
|
150
|
-
(C) 2005-2015, Daniel J. Berger
|
151
|
-
All Rights Reserved
|
152
|
-
|
153
|
-
== Author
|
154
|
-
Daniel J. Berger
|
1
|
+
== Description
|
2
|
+
The sys-admin library is a unified, cross platform replacement for the Etc module.
|
3
|
+
|
4
|
+
== Installation
|
5
|
+
gem install sys-admin
|
6
|
+
|
7
|
+
== Synopsis
|
8
|
+
require 'sys/admin' # or sys-admin
|
9
|
+
include Sys
|
10
|
+
|
11
|
+
# Returns an Array of User objects
|
12
|
+
a = Admin.users
|
13
|
+
|
14
|
+
# Returns an Array of Group objects
|
15
|
+
g = Admin.groups
|
16
|
+
|
17
|
+
# Get information about a particular user
|
18
|
+
p Admin.get_user("nobody")
|
19
|
+
p Admin.get_user("nobody", :localaccount => true)
|
20
|
+
|
21
|
+
# Get information about a particular group
|
22
|
+
p Admin.get_group("adm")
|
23
|
+
p Admin.get_group("adm", :localaccount => true)
|
24
|
+
|
25
|
+
== Admin
|
26
|
+
Admin.get_login
|
27
|
+
Returns the user name (only) of the current login.
|
28
|
+
|
29
|
+
Admin.get_user(name, options = {})
|
30
|
+
Admin.get_user(uid, options = {})
|
31
|
+
Returns a User object based on +name+ or +uid+. The +options+ hash is
|
32
|
+
for MS Windows only, and allows you to restrict the search based on the
|
33
|
+
options you provide, e.g. 'domain' or 'localaccount'.
|
34
|
+
|
35
|
+
Admin.get_group(name, options = {})
|
36
|
+
Admin.get_group(gid, options = {})
|
37
|
+
Returns a Group object based on +name+ or +uid+. The +options+ hash is
|
38
|
+
for MS Windows only, and allows you to restrict the search based on the
|
39
|
+
options you provide, e.g. 'domain' or 'localaccount'.
|
40
|
+
|
41
|
+
Admin.groups(options = {})
|
42
|
+
Returns an Array of Group objects.
|
43
|
+
|
44
|
+
The +options+ hash is for MS Windows only, and allows you to restrict the
|
45
|
+
search based on the options you provide, e.g. 'domain' or 'localaccount'.
|
46
|
+
|
47
|
+
Admin.users(options = {})
|
48
|
+
Returns an Array of User objects.
|
49
|
+
|
50
|
+
The +options+ hash is for MS Windows only, and allows you to restrict the
|
51
|
+
search based on the options you provide, e.g. 'domain' or 'localaccount'.
|
52
|
+
|
53
|
+
== User class
|
54
|
+
=== User (Windows)
|
55
|
+
The User class has the following attributes on MS Windows systems:
|
56
|
+
|
57
|
+
* account_type
|
58
|
+
* caption
|
59
|
+
* description
|
60
|
+
* domain
|
61
|
+
* password
|
62
|
+
* full_name
|
63
|
+
* gid
|
64
|
+
* install_date
|
65
|
+
* name
|
66
|
+
* sid
|
67
|
+
* status
|
68
|
+
* disabled?
|
69
|
+
* local?
|
70
|
+
* lockout?
|
71
|
+
* password_changeable?
|
72
|
+
* password_expires?
|
73
|
+
* password_required?
|
74
|
+
* uid
|
75
|
+
|
76
|
+
=== User (Unix)
|
77
|
+
The User class has the following attributes on Unix systems:
|
78
|
+
|
79
|
+
* name
|
80
|
+
* passwd
|
81
|
+
* uid
|
82
|
+
* gid
|
83
|
+
* dir
|
84
|
+
* shell
|
85
|
+
* gecos
|
86
|
+
* quota
|
87
|
+
* age
|
88
|
+
* class
|
89
|
+
* comment
|
90
|
+
* change
|
91
|
+
* expire
|
92
|
+
|
93
|
+
== Group Classes
|
94
|
+
=== Group (Windows)
|
95
|
+
The Group class has the following attributes on MS Windows systems:
|
96
|
+
|
97
|
+
* caption
|
98
|
+
* description
|
99
|
+
* domain
|
100
|
+
* install_date
|
101
|
+
* name
|
102
|
+
* sid
|
103
|
+
* status
|
104
|
+
* gid
|
105
|
+
* local?
|
106
|
+
|
107
|
+
=== Group (Unix)
|
108
|
+
The Group class has the following attributes on Unix systems:
|
109
|
+
|
110
|
+
* name
|
111
|
+
* gid
|
112
|
+
* members
|
113
|
+
* passwd
|
114
|
+
|
115
|
+
== Error Classes
|
116
|
+
Admin::Error < StandardError
|
117
|
+
Raised if anything goes wrong with any of the above methods.
|
118
|
+
|
119
|
+
== Developer's Notes
|
120
|
+
=== MS Windows
|
121
|
+
The Windows version now uses a win32ole + WMI approach to getting
|
122
|
+
information. This means that the WMI service must be running on the
|
123
|
+
target machine in order to work (which it is, by default).
|
124
|
+
|
125
|
+
=== UNIX
|
126
|
+
The underlying implementation is similar to core Ruby's Etc implementation.
|
127
|
+
But, in addition to the different interface, I use the re-entrant version
|
128
|
+
of the appropriate functions when available.
|
129
|
+
|
130
|
+
== Future Plans
|
131
|
+
Make the User and Group objects comparable.
|
132
|
+
Add ability to add, configure and delete users on Unix platforms.
|
133
|
+
|
134
|
+
== Known Bugs
|
135
|
+
None that I'm aware of. If you find any, please log them on the project
|
136
|
+
page at:
|
137
|
+
|
138
|
+
https://github.com/djberg96/sys-admin
|
139
|
+
|
140
|
+
== License
|
141
|
+
Apache 2.0
|
142
|
+
|
143
|
+
== Copyright
|
144
|
+
(C) 2005-2018, Daniel J. Berger
|
145
|
+
All Rights Reserved
|
146
|
+
|
147
|
+
== Author
|
148
|
+
Daniel J. Berger
|