odisk 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +6 -0
- data/lib/odisk/crypter.rb +2 -2
- data/lib/odisk/diff.rb +3 -1
- data/lib/odisk/digest.rb +5 -1
- data/lib/odisk/statfixer.rb +20 -4
- data/lib/odisk/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 15f5e70c89940ff3b118ee2af18e325c17ccc295feb29ce9094df1c9b5ca0af8
|
4
|
+
data.tar.gz: 508c5b8aba4dcb6213d74ec571d99cfe3299ed106d30903f55db1aa7bfff9939
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dccde36cc8a7d9d7d4b4f1b9c2a26e77ab2f9c81a2c781ae9e36e5edefb53f30f213abb9c4587980037e0614231f185f8db82eedb700eda60a440f6584133b2b
|
7
|
+
data.tar.gz: 0e30cba180161353aff6905b99440a12cae965e2089898a2562438cf2a270d9e979d61ef449fd2684caf670d88b96a3a3c81ee2c9ea881356af39ef3c50718b1
|
data/README.md
CHANGED
@@ -25,6 +25,12 @@ which utilizes an alternative approach to dealing with multiple threads.
|
|
25
25
|
|
26
26
|
## <a name="release">Release Notes</a>
|
27
27
|
|
28
|
+
### Release 1.0.2
|
29
|
+
|
30
|
+
- Made groups handling more tolerant.
|
31
|
+
|
32
|
+
- Updated gpg command arguments for more modern version.
|
33
|
+
|
28
34
|
### Release 1.0.1
|
29
35
|
|
30
36
|
- Ruby time has changed so a change in time comparisons was made.
|
data/lib/odisk/crypter.rb
CHANGED
@@ -20,7 +20,7 @@ module ODisk
|
|
20
20
|
def encrypt(src, dest, remote)
|
21
21
|
::Opee::Env.info("encrypt \"#{src}\" into \"#{dest}\"")
|
22
22
|
unless $dry_run
|
23
|
-
`gpg -c --batch --yes --force-mdc --
|
23
|
+
`gpg -c --batch --yes --force-mdc --passphrase-file "#{$remote.pass_file}" -o "#{dest}" "#{src}"`
|
24
24
|
@copy_queue.add_method(:upload, dest, remote, true)
|
25
25
|
end
|
26
26
|
@crypt_queue.ask(:ready, self)
|
@@ -29,7 +29,7 @@ module ODisk
|
|
29
29
|
def decrypt(src, dest)
|
30
30
|
::Opee::Env.info("decrypt \"#{src}\" into \"#{dest}\"")
|
31
31
|
unless $dry_run
|
32
|
-
`gpg -d --batch --yes -q --
|
32
|
+
`gpg -d --batch --yes -q --passphrase-file "#{$remote.pass_file}" -o "#{dest}" "#{src}"`
|
33
33
|
::File.delete(src)
|
34
34
|
::Opee::Env.warn("Downloaded and decrypted \"#{dest}\"")
|
35
35
|
end
|
data/lib/odisk/diff.rb
CHANGED
@@ -63,7 +63,9 @@ module ODisk
|
|
63
63
|
end
|
64
64
|
h[k] = [lv, rv] unless lv == rv unless (:mtime == m && !@remote.is_a?(::ODisk::File))
|
65
65
|
end
|
66
|
-
|
66
|
+
unless @local.nil?
|
67
|
+
pre = prefix.nil? ? @local.name : (prefix + '.' + @local.name)
|
68
|
+
end
|
67
69
|
@sub_diffs.each do |name,d|
|
68
70
|
d.fill_hash(pre, h)
|
69
71
|
end
|
data/lib/odisk/digest.rb
CHANGED
@@ -24,7 +24,11 @@ module ODisk
|
|
24
24
|
def self.create_info(path, filename=nil, top=nil)
|
25
25
|
top = $local_top if top.nil?
|
26
26
|
filename = ::File.basename(path) if filename.nil?
|
27
|
-
|
27
|
+
begin
|
28
|
+
stat = ::File.lstat(path)
|
29
|
+
rescue
|
30
|
+
return nil
|
31
|
+
end
|
28
32
|
if stat.directory?
|
29
33
|
c = ::ODisk::Dir.new(filename)
|
30
34
|
elsif stat.symlink?
|
data/lib/odisk/statfixer.rb
CHANGED
@@ -73,6 +73,22 @@ module ODisk
|
|
73
73
|
# TBD tell progress about the completion
|
74
74
|
end
|
75
75
|
|
76
|
+
def get_group(g)
|
77
|
+
begin
|
78
|
+
Etc.getgrnam(g).gid
|
79
|
+
rescue
|
80
|
+
nil
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def get_owner(o)
|
85
|
+
begin
|
86
|
+
Etc.getpwnam(o).uid
|
87
|
+
rescue
|
88
|
+
nil
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
76
92
|
def fix_stats(path, info)
|
77
93
|
e = Digest.create_info(path)
|
78
94
|
diff = Diff.new(e, info)
|
@@ -84,12 +100,12 @@ module ODisk
|
|
84
100
|
when :mtime
|
85
101
|
::File.utime(info.mtime, info.mtime, path) unless info.is_a?(::ODisk::Link)
|
86
102
|
when :owner
|
87
|
-
owner =
|
88
|
-
group =
|
103
|
+
owner = get_owner(info.owner)
|
104
|
+
group = get_group(info.group)
|
89
105
|
::File::lchown(owner, group, path)
|
90
106
|
when :group
|
91
|
-
owner =
|
92
|
-
group =
|
107
|
+
owner = get_owner(info.owner)
|
108
|
+
group = get_group(info.group)
|
93
109
|
begin
|
94
110
|
::File::lchown(owner, group, path)
|
95
111
|
rescue Errno::EPERM
|
data/lib/odisk/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: odisk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Ohler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oterm
|
@@ -137,9 +137,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
137
|
version: '0'
|
138
138
|
requirements: []
|
139
139
|
rubyforge_project: odisk
|
140
|
-
rubygems_version: 2.
|
140
|
+
rubygems_version: 2.7.3
|
141
141
|
signing_key:
|
142
142
|
specification_version: 4
|
143
143
|
summary: Remote Encrypted File Synchronization, oDisk
|
144
144
|
test_files: []
|
145
|
-
has_rdoc: true
|