nfsadmin 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/nfsadmin/tasks.rb +8 -1
- data/lib/nfsadmin/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdd4e0aab0092c50e03824a29c03883fc525b27a
|
4
|
+
data.tar.gz: 398e68c67d18f074d25c66a6d7bceca2422893cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4709b0f54c63d968b695155c5e5fe98264db4e7dd8b1dcf2f13409a92e78be398e0b038967e603242e2935922a2107c4dc978dce9f75ba95d204ec110b331ea
|
7
|
+
data.tar.gz: 26590eaa1a8bf801ea4699f379649c86db56feb95993ffa9b1fa9c0140ff156b65fb00183992c9a96552f97b48d7f301613b41c594ca445f21fcbdec47d7e61c
|
data/Gemfile.lock
CHANGED
data/lib/nfsadmin/tasks.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'json'
|
2
2
|
require 'fileutils'
|
3
|
+
require 'etc'
|
3
4
|
|
4
5
|
module Nfsadmin
|
5
6
|
|
@@ -39,7 +40,11 @@ module Nfsadmin
|
|
39
40
|
acl << entry
|
40
41
|
end
|
41
42
|
end
|
43
|
+
stat = File.stat(location)
|
42
44
|
share[:location] = location
|
45
|
+
share[:owner] = Etc.getpwuid(stat.uid).name
|
46
|
+
share[:group] = Etc.getgrgid(stat.gid).name
|
47
|
+
share[:mode] = stat.mode.to_s(8)[-3,3]
|
43
48
|
share[:acl] = acl
|
44
49
|
shares << share
|
45
50
|
end
|
@@ -74,7 +79,9 @@ module Nfsadmin
|
|
74
79
|
share[:acl].each do |acl|
|
75
80
|
print acl[:address] + '(' + acl[:options] + ')' + ' '
|
76
81
|
end
|
77
|
-
print
|
82
|
+
print(share[:owner]) unless share[:owner].nil?
|
83
|
+
print(':' + share[:group] + ' ') unless share[:group].nil?
|
84
|
+
print(share[:mode] + "\n")
|
78
85
|
end
|
79
86
|
STDOUT.flush
|
80
87
|
elsif output_type.downcase == 'json'
|
data/lib/nfsadmin/version.rb
CHANGED