sys-admin 1.7.4 → 1.8.1

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
2
  SHA256:
3
- metadata.gz: 3516d935d00221a18c46e91cc08de3886bde14c81c2ba5a39e2c9b7072618695
4
- data.tar.gz: 81996006820e530e449c79f9857031913ce040bed5d9bfea6668cf27338107a0
3
+ metadata.gz: d20b0abf74cb8d4769f69346ac22ade3d1336bd10d3b6f83eeca2865ab9b85fe
4
+ data.tar.gz: 7c56cb4dec18928e3ea4fb1371e9c3f4e660fb5ec94519b0385a1448c07e0d84
5
5
  SHA512:
6
- metadata.gz: e1fe74964b0e0896e31426229a3f79267984b3c73f9e78c551116bb225a075f2f814e9b8d3b06a589250cd4f1b750c11bea2cc3fccdc0c2d0a540d2fd5a8b2e4
7
- data.tar.gz: 4a2593fdff4e15657e88651248e0d26512d4d020f46589cee595615f66c7671f8f91393a621444d6bc3eb032b0a621e262d7334ad3994fd8c349f9c7e87bebc4
6
+ metadata.gz: 55d12a7b5d4999eec9801b60a06d1da16bfb2879a4270b0d5188b7d20a397a170619fb0dc75f9fd394952c02e3228d686ff9c908f15a38750220bea7eb2a2e9d
7
+ data.tar.gz: 3ec5f6ac0690458751f5dd5e2ccaf764b977f1aa46fc6f2acf0c506417c39a4baf704338c712614728fe8d89c289bd76c20dcd62b41f6b28ab5205404ef338e3
checksums.yaml.gz.sig CHANGED
Binary file
@@ -1,39 +1,67 @@
1
- == 1.7.3 - 16-Jan-2020
1
+ ## 1.8.1 - 25-Sep-2021
2
+ * The users and get_user methods on Darwin now take an optional :lastlog key
3
+ that you can set to false in order to significantly speed up those methods
4
+ at the expense of taking away lastlog information.
5
+ * Some internal rspec refactoring.
6
+
7
+ ## 1.8.0 - 26-Aug-2021
8
+ * Switched from test-unit to rspec, with some tests refactored. The Rakefile
9
+ and gemspec files were updated accordingly.
10
+ * The User and Group classes for the Windows implementation are now properly
11
+ scoped under Sys::Admin instead of just Sys.
12
+ * Fixed a bug in the get_user and get_group methods on Windows where the WQL
13
+ it generates internally might not be correct.
14
+
15
+ ## 1.7.6 - 24-Mar-2021
16
+ * Changed the implementation for `Admin.get_login` on Linux since the
17
+ underlying `getlogin` C function is unreliable, especially in certain
18
+ virtualized environments.
19
+ * Added win32-security back to the gemspec as a dependency for Windows.
20
+ I'm not sure why I removed it, and bundler definitely needs it.
21
+ * Fixed some private access modifiers that weren't actually doing anything.
22
+
23
+ ## 1.7.5 - 30-Dec-2020
24
+ * Switched from rdoc to markdown since github isn't rendering rdoc properly.
25
+
26
+ ## 1.7.4 - 19-Mar-2020
27
+ * Properly include a LICENSE file as per the Apache-2.0 license.
28
+
29
+ ## 1.7.3 - 16-Jan-2020
2
30
  * Add explicit .rdoc extension to various rdoc files so that they show up
3
31
  better in github.
4
32
  * Some formatting adjustments to the rdoc files.
5
33
 
6
- == 1.7.2 - 28-Jan-2019
34
+ ## 1.7.2 - 28-Jan-2019
7
35
  * Fixed the license name, was missing a hyphen.
8
36
  * Fixed the homepage in the gemspec.
9
37
 
10
- == 1.7.1 - 19-Mar-2018
38
+ ## 1.7.1 - 19-Mar-2018
11
39
  * Fixed deprecation warnings in tests.
12
40
  * Added gemspec metadata.
13
41
  * Updated cert again, this one should last 10 years.
14
42
 
15
- == 1.7.0 - 21-Feb-2018
43
+ ## 1.7.0 - 21-Feb-2018
16
44
  * Changed the license to Apache 2.0.
17
45
  * VERSION constant is now frozen.
18
46
  * Ignore dependency warnings in gem:create task.
19
47
  * Minor README updates.
20
48
  * Updated cert.
21
49
 
22
- == 1.6.4 - 6-Sep-2015
50
+ ## 1.6.4 - 6-Sep-2015
23
51
  * Added a sys-admin.rb file for convenience.
24
52
  * Set VERSION in a single place.
25
53
  * Assume Rubygems 2.x for Rakefile tasks.
26
54
  * This gem is now signed.
27
55
 
28
- == 1.6.3 - 8-Mar-2014
56
+ ## 1.6.3 - 8-Mar-2014
29
57
  * The Admin#get_group method now handles groups with very large numbers
30
58
  of members more robustly.
31
59
 
32
- == 1.6.2 - 11-Feb-2014
60
+ ## 1.6.2 - 11-Feb-2014
33
61
  * The User#gid method is now supported on MS Windows. It returns the user's
34
62
  primary group ID.
35
63
 
36
- == 1.6.1 - 24-Jan-2014
64
+ ## 1.6.1 - 24-Jan-2014
37
65
  * Added the Admin.add_group_member and Admin.remove_group member methods. These
38
66
  let you add a user to a specific group. Thanks go to Alexey Kolyanov for the
39
67
  idea and the code.
@@ -43,7 +71,7 @@
43
71
  * Updated the gem:create task in the Rakefile.
44
72
  * Added rake as a development dependency.
45
73
 
46
- == 1.6.0 - 5-Jan-2013
74
+ ## 1.6.0 - 5-Jan-2013
47
75
  * Converted code to use FFI. This mostly only affects the unix flavors.
48
76
  * The Admin.users and Admin.groups methods no longer accept a block.
49
77
  * Some test suite updates.
@@ -51,13 +79,13 @@
51
79
  separate gems. There is now a single, unified gem that works on all
52
80
  supported platforms.
53
81
 
54
- == 1.5.6 - 30-Jul-2011
82
+ ## 1.5.6 - 30-Jul-2011
55
83
  * Fixed issue for non-gnu platforms where it would use the wrong function
56
84
  prototype because the Ruby core team took it upon themselves to explicitly
57
85
  defined _GNU_SOURCE in config.h in 1.8.7 and later for reasons that baffle me.
58
86
  * Some tests on Windows are now skipped unless run with elevated security.
59
87
 
60
- == 1.5.5 - 5-Jul-2011
88
+ ## 1.5.5 - 5-Jul-2011
61
89
  * Modified lastlog handling, and ignore getpwent_r and getgrent_r, on AIX.
62
90
  Thanks go to Rick Ohnemus for the spot and patches.
63
91
  * Explicitly set spec.cpu on Windows to 'universal' in the gem creation task.
@@ -65,21 +93,21 @@
65
93
  being generated was incorrect if no options were passed. Thanks go to
66
94
  Matthew Brown for the spot.
67
95
 
68
- == 1.5.4 - 7-Oct-2010
96
+ ## 1.5.4 - 7-Oct-2010
69
97
  * Prefer the getlastlogx() function over lastlog() where supported.
70
98
 
71
- == 1.5.3 - 6-Oct-2010
99
+ ## 1.5.3 - 6-Oct-2010
72
100
  * Refactored the Rakefile. The old installation tasks have been replaced
73
101
  with gem build and install tasks. In addition, the platform handling has
74
102
  been updated for MS Windows.
75
103
  * Portions of the gemspec have been moved into the Rakefile gem tasks.
76
104
  * Deploying the mingw gem by default for MS Windows now.
77
105
 
78
- == 1.5.2 - 2-Aug-2009
106
+ ## 1.5.2 - 2-Aug-2009
79
107
  * Now compatible with Ruby 1.9.x.
80
108
  * Added test-unit as a development dependency.
81
109
 
82
- == 1.5.1 - 23-Jul-2009
110
+ ## 1.5.1 - 23-Jul-2009
83
111
  * Added the User#dir attribute. This attribute contains a user's home
84
112
  directory if set, or nil if it isn't.
85
113
  * User objects returned by the Admin.users method now include the uid.
@@ -87,7 +115,7 @@
87
115
  * Added win32-security as a dependency.
88
116
  * Changed license to Artistic 2.0.
89
117
 
90
- == 1.5.0 - 29-Mar-2009
118
+ ## 1.5.0 - 29-Mar-2009
91
119
  * INTERFACE CHANGE (WINDOWS ONLY): The interface for MS Windows has undergone
92
120
  a radical change. Most methods now accept a hash of options that are
93
121
  passed directly to the underlying WMI class. Please see the documentation
@@ -104,14 +132,14 @@
104
132
  get lastlog information even if the lastlog.h or utmp.h headers couldn't
105
133
  be found.
106
134
 
107
- == 1.4.4 - 19-Nov-2008
135
+ ## 1.4.4 - 19-Nov-2008
108
136
  * Added the User#uid method for MS Windows (which is just the user's relative
109
137
  identifier).
110
138
  * Now requires test-unit 2.x.
111
139
  * Some updates to the test suite to take advantage of test-unit 2.x features.
112
140
  * Some minor gemspec tweaks.
113
141
 
114
- == 1.4.3 - 2-Mar-2008
142
+ ## 1.4.3 - 2-Mar-2008
115
143
  * The block form of Admin.users now properly ensures that endpwent() is
116
144
  called. Likewise, the block form of Admin.groups now properly ensures
117
145
  that endgrent() is called. This would only have been an issue if you
@@ -119,7 +147,7 @@
119
147
  * The AdminError class is now Admin::Error.
120
148
  * Some internal directory layout changes.
121
149
 
122
- == 1.4.2 - 26-Jun-2007
150
+ ## 1.4.2 - 26-Jun-2007
123
151
  * Fixed a bug in the Admin.get_login method where it would return junk
124
152
  if the underlying getlogin() function failed (Unix). Thanks go to Gonzalo
125
153
  Garramuno for the spot. This bug also resulted in some refactoring of the
@@ -127,13 +155,13 @@
127
155
  * Removed the install.rb file. The logic in that file has been moved directly
128
156
  into the Rakefile.
129
157
 
130
- == 1.4.1 - 21-Mar-2007
158
+ ## 1.4.1 - 21-Mar-2007
131
159
  * Bug fix for OS X. Thanks go to an anonymous user for the spot.
132
160
  * Added a Rakefile. Building, testing and installing should now use the
133
161
  Rake tasks (for non-gem installs).
134
162
  * Much more inline documentation, especially for User and Group attributes.
135
163
 
136
- == 1.4.0 - 20-Jan-2007
164
+ ## 1.4.0 - 20-Jan-2007
137
165
  * Added the following methods: add_local_user, config_local_user,
138
166
  delete_local_user, add_global_group, config_global_group, and
139
167
  delete_global_group. MS Windows only at the moment.
@@ -149,18 +177,18 @@
149
177
  integer.
150
178
  * Renamed tc_win32.rb to tc_windows.rb
151
179
 
152
- == 1.3.1 - 29-Jun-2005
180
+ ## 1.3.1 - 29-Jun-2005
153
181
  * Fixed a bug where the inability to read the lastlog file caused an error.
154
182
  From now on that error is ignored, and the lastlog attributes of the User
155
183
  object are set to nil.
156
184
  * Added a beta version of Admin.delete_user (Windows only).
157
185
 
158
- == 1.3.0 - 3-Jun-2005
186
+ ## 1.3.0 - 3-Jun-2005
159
187
  * Bug fixes for Linux.
160
188
  * Removed the version.h file - no longer needed since the Win32 version is
161
189
  pure Ruby.
162
190
 
163
- == 1.2.0 - 30-Apr-2005
191
+ ## 1.2.0 - 30-Apr-2005
164
192
  * Replaced the Win32 version with a pure Ruby version that uses Win32API and
165
193
  win32ole + WMI.
166
194
  * The LocalGroup class no longer exists in the Win32 version. Instead, it is
@@ -170,7 +198,7 @@
170
198
  over global accounts.
171
199
  * Corresponding doc changes and test suite changes.
172
200
 
173
- == 1.1.0 - 1-Apr-2005
201
+ ## 1.1.0 - 1-Apr-2005
174
202
  * Fixed bug where a segfault could occur when trying to retrieve a user or
175
203
  group by an ID that didn't exist (Unix).
176
204
  * Added tests for intentional failures.
@@ -178,5 +206,5 @@
178
206
  * Modified the way User objects are created internally (Unix).
179
207
  * Fixed a bug in the User#shell attribute (Unix).
180
208
 
181
- == 1.0.0 - 25-Mar-2005
209
+ ## 1.0.0 - 25-Mar-2005
182
210
  * Initial release
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
@@ -1,9 +1,10 @@
1
1
  * sys-admin.gemspec
2
- * CHANGES.rdoc
2
+ * CHANGES.md
3
3
  * LICENSE
4
- * MANIFEST.rdoc
4
+ * MANIFEST.md
5
+ * README.md
6
+ * Gemfile
5
7
  * Rakefile
6
- * README.rdoc
7
8
  * certs/djberg96_pub.pem
8
9
  * examples/groups.rb
9
10
  * examples/users.rb
@@ -1,62 +1,73 @@
1
- == Description
1
+ [![Ruby](https://github.com/djberg96/sys-admin/actions/workflows/ruby.yml/badge.svg)](https://github.com/djberg96/sys-admin/actions/workflows/ruby.yml)
2
+
3
+ ## Description
2
4
  The sys-admin library is a unified, cross platform replacement for the Etc module.
3
5
 
4
- == Installation
5
- gem install sys-admin
6
+ ## Installation
7
+ `gem install sys-admin`
8
+
9
+ ## Adding the trusted cert
10
+ `gem cert --add <(curl -Ls https://raw.githubusercontent.com/djberg96/sys-admin/main/certs/djberg96_pub.pem)`
6
11
 
7
- == Synopsis
8
- require 'sys/admin' # or sys-admin
9
- include Sys
12
+ ## Synopsis
13
+ ```ruby
14
+ require 'sys/admin' # or sys-admin
15
+ include Sys
10
16
 
11
- # Returns an Array of User objects
12
- a = Admin.users
17
+ # Returns an Array of User objects
18
+ a = Admin.users
13
19
 
14
- # Returns an Array of Group objects
15
- g = Admin.groups
20
+ # Returns an Array of Group objects
21
+ g = Admin.groups
16
22
 
17
- # Get information about a particular user
18
- p Admin.get_user("nobody")
19
- p Admin.get_user("nobody", :localaccount => true)
23
+ # Get information about a particular user
24
+ p Admin.get_user("nobody")
25
+ p Admin.get_user("nobody", :localaccount => true)
20
26
 
21
- # Get information about a particular group
22
- p Admin.get_group("adm")
23
- p Admin.get_group("adm", :localaccount => true)
27
+ # Get information about a particular group
28
+ p Admin.get_group("adm")
29
+ p Admin.get_group("adm", :localaccount => true)
30
+ ```
24
31
 
25
- == Admin
26
- Admin.get_login
32
+ ## Admin
33
+ `Admin.get_login`
27
34
 
28
35
  Returns the user name (only) of the current login.
29
36
 
30
- Admin.get_user(name, options = {})
31
- Admin.get_user(uid, options = {})
37
+ ```
38
+ Admin.get_user(name, options = {})
39
+ Admin.get_user(uid, options = {})
40
+ ```
32
41
 
33
- Returns a User object based on +name+ or +uid+. The +options+ hash is
42
+ Returns a User object based on `name` or `uid`. The `options` hash is
34
43
  for MS Windows only, and allows you to restrict the search based on the
35
44
  options you provide, e.g. 'domain' or 'localaccount'.
36
45
 
37
- Admin.get_group(name, options = {})
38
- Admin.get_group(gid, options = {})
46
+ ```
47
+ Admin.get_group(name, options = {})
48
+ Admin.get_group(gid, options = {})
49
+ ```
39
50
 
40
- Returns a Group object based on +name+ or +uid+. The +options+ hash is
51
+ Returns a Group object based on `name` or `uid`. The `options` hash is
41
52
  for MS Windows only, and allows you to restrict the search based on the
42
53
  options you provide, e.g. 'domain' or 'localaccount'.
43
54
 
44
- Admin.groups(options = {})
55
+ `Admin.groups(options = {})`
45
56
 
46
57
  Returns an Array of Group objects.
47
58
 
48
- The +options+ hash is for MS Windows only, and allows you to restrict the
59
+ The `options` hash is for MS Windows only, and allows you to restrict the
49
60
  search based on the options you provide, e.g. 'domain' or 'localaccount'.
50
61
 
51
- Admin.users(options = {})
62
+ `Admin.users(options = {})`
52
63
 
53
64
  Returns an Array of User objects.
54
65
 
55
- The +options+ hash is for MS Windows only, and allows you to restrict the
66
+ The `options` hash is for MS Windows only, and allows you to restrict the
56
67
  search based on the options you provide, e.g. 'domain' or 'localaccount'.
57
68
 
58
- == User class
59
- === User (Windows)
69
+ ## User class
70
+ ### User (Windows)
60
71
  The User class has the following attributes on MS Windows systems:
61
72
 
62
73
  * account_type
@@ -78,7 +89,7 @@ The User class has the following attributes on MS Windows systems:
78
89
  * password_required?
79
90
  * uid
80
91
 
81
- === User (Unix)
92
+ ### User (Unix)
82
93
  The User class has the following attributes on Unix systems:
83
94
 
84
95
  * name
@@ -95,8 +106,8 @@ The User class has the following attributes on Unix systems:
95
106
  * change
96
107
  * expire
97
108
 
98
- == Group Classes
99
- === Group (Windows)
109
+ ## Group Classes
110
+ ### Group (Windows)
100
111
  The Group class has the following attributes on MS Windows systems:
101
112
 
102
113
  * caption
@@ -109,7 +120,7 @@ The Group class has the following attributes on MS Windows systems:
109
120
  * gid
110
121
  * local?
111
122
 
112
- === Group (Unix)
123
+ ### Group (Unix)
113
124
  The Group class has the following attributes on Unix systems:
114
125
 
115
126
  * name
@@ -117,37 +128,37 @@ The Group class has the following attributes on Unix systems:
117
128
  * members
118
129
  * passwd
119
130
 
120
- == Error Classes
121
- Admin::Error < StandardError
131
+ ## Error Classes
132
+ `Admin::Error < StandardError`
122
133
 
123
134
  Raised if anything goes wrong with any of the above methods.
124
135
 
125
- == Developer's Notes
126
- === MS Windows
136
+ ## Developer's Notes
137
+ ### MS Windows
127
138
  The Windows version now uses a win32ole + WMI approach to getting
128
139
  information. This means that the WMI service must be running on the
129
140
  target machine in order to work (which it is, by default).
130
141
 
131
- === UNIX
142
+ ### UNIX
132
143
  The underlying implementation is similar to core Ruby's Etc implementation.
133
144
  But, in addition to the different interface, I use the re-entrant version
134
145
  of the appropriate functions when available.
135
146
 
136
- == Future Plans
147
+ ## Future Plans
137
148
  * Make the User and Group objects comparable.
138
149
  * Add ability to add, configure and delete users on Unix platforms.
139
150
 
140
- == Known Bugs
151
+ ## Known Bugs
141
152
  None that I'm aware of. If you find any, please log them on the project page at:
142
153
 
143
154
  https://github.com/djberg96/sys-admin
144
155
 
145
- == License
156
+ ## License
146
157
  Apache-2.0
147
158
 
148
- == Copyright
159
+ ## Copyright
149
160
  (C) 2005-2020, Daniel J. Berger
150
161
  All Rights Reserved
151
162
 
152
- == Author
163
+ ## Author
153
164
  Daniel J. Berger
data/Rakefile CHANGED
@@ -1,17 +1,17 @@
1
1
  require 'rake'
2
2
  require 'rake/clean'
3
- require 'rake/testtask'
3
+ require 'rspec/core/rake_task'
4
4
  require 'rbconfig'
5
5
 
6
- CLEAN.include("**/*.gem", "**/*.rbx", "**/*.rbc", "ruby.core")
6
+ CLEAN.include("**/*.gem", "**/*.rbx", "**/*.rbc", "ruby.core", "**/*.lock")
7
7
 
8
8
  namespace :gem do
9
9
  desc "Create the sys-uname gem"
10
10
  task :create => [:clean] do
11
11
  require 'rubygems/package'
12
- spec = eval(IO.read('sys-admin.gemspec'))
12
+ spec = Gem::Specification.load('sys-admin.gemspec')
13
13
  spec.signing_key = File.join(Dir.home, '.ssh', 'gem-private_key.pem')
14
- Gem::Package.build(spec, true)
14
+ Gem::Package.build(spec)
15
15
  end
16
16
 
17
17
  desc "Install the sys-uname gem"
@@ -21,27 +21,22 @@ namespace :gem do
21
21
  end
22
22
  end
23
23
 
24
- Rake::TestTask.new('test') do |t|
24
+ desc "Run the specs for the sys-admin library"
25
+ RSpec::Core::RakeTask.new(:spec) do |t|
25
26
  case RbConfig::CONFIG['host_os']
26
27
  when /darwin|osx/i
27
- t.libs << 'lib/darwin'
28
+ t.rspec_opts = '-Ilib/darwin'
28
29
  when /linux/i
29
- t.libs << 'lib/linux'
30
+ t.rspec_opts = '-Ilib/linux'
30
31
  when /sunos|solaris/i
31
- t.libs << 'lib/sunos'
32
+ t.rspec_opts = '-Ilib/sunos'
32
33
  when /bsd/i
33
- t.libs << 'lib/bsd'
34
+ t.rspec_opts = '-Ilib/bsd'
34
35
  when /windows|win32|mingw|cygwin|dos/i
35
- t.libs << 'lib/windows'
36
+ t.rspec_opts = '-Ilib/windows'
36
37
  else
37
- t.libs << 'lib/unix'
38
+ t.rspec_opts = '-Ilib/unix'
38
39
  end
39
-
40
- t.warning = true
41
- t.verbose = true
42
-
43
- t.libs << 'test'
44
- t.test_files = FileList['test/test_sys_admin.rb']
45
40
  end
46
41
 
47
- task :default => :test
42
+ task :default => :spec
data/lib/bsd/sys/admin.rb CHANGED
@@ -6,10 +6,9 @@ require 'rbconfig'
6
6
 
7
7
  module Sys
8
8
  class Admin
9
- private
10
-
11
9
  # :no-doc:
12
10
  BUF_MAX = 65536 # Max buffer for retry
11
+ private_constant :BUF_MAX
13
12
 
14
13
  # I'm making some aliases here to prevent potential conflicts
15
14
  attach_function :open_c, :open, [:string, :int], :int
@@ -22,8 +21,7 @@ module Sys
22
21
  attach_function :getgrnam_r, [:string, :pointer, :pointer, :size_t, :pointer], :int
23
22
  attach_function :getgrgid_r, [:long, :pointer, :pointer, :size_t, :pointer], :int
24
23
 
25
- private_class_method :getlogin_r, :getpwnam_r, :getpwuid_r, :getgrnam_r
26
- private_class_method :getgrgid_r
24
+ private_class_method :getlogin_r, :getpwnam_r, :getpwuid_r, :getgrnam_r, :getgrgid_r
27
25
  private_class_method :open_c, :pread_c, :close_c
28
26
 
29
27
  # struct passwd from /usr/include/pwd.h
@@ -48,6 +46,8 @@ module Sys
48
46
  layout(*fields)
49
47
  end
50
48
 
49
+ private_constant :PasswdStruct
50
+
51
51
  # struct group from /usr/include/grp.h
52
52
  class GroupStruct < FFI::Struct
53
53
  layout(
@@ -58,6 +58,8 @@ module Sys
58
58
  )
59
59
  end
60
60
 
61
+ private_constant :GroupStruct
62
+
61
63
  # I'm blending the timeval struct in directly here
62
64
  class LastlogStruct < FFI::Struct
63
65
  layout(
@@ -67,7 +69,7 @@ module Sys
67
69
  )
68
70
  end
69
71
 
70
- public
72
+ private_constant :LastlogStruct
71
73
 
72
74
  # Returns the login for the current process.
73
75
  #
@@ -192,8 +194,6 @@ module Sys
192
194
  groups
193
195
  end
194
196
 
195
- private
196
-
197
197
  # Takes a GroupStruct and converts it to a Group object.
198
198
  def self.get_group_from_struct(grp)
199
199
  Group.new do |g|
@@ -204,6 +204,8 @@ module Sys
204
204
  end
205
205
  end
206
206
 
207
+ private_class_method :get_group_from_struct
208
+
207
209
  # Takes a UserStruct and converts it to a User object.
208
210
  def self.get_user_from_struct(pwd)
209
211
  user = User.new do |u|
@@ -230,6 +232,8 @@ module Sys
230
232
  user
231
233
  end
232
234
 
235
+ private_class_method :get_user_from_struct
236
+
233
237
  # Get lastlog information for the given user.
234
238
  def self.get_lastlog_info(uid)
235
239
  logfile = '/var/log/lastlog'
@@ -252,5 +256,7 @@ module Sys
252
256
 
253
257
  lastlog
254
258
  end
259
+
260
+ private_class_method :get_lastlog_info
255
261
  end
256
262
  end