sudow 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -2
- data/exe/sudow +17 -3
- data/lib/sudow/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e7f817c33593a78e80c364f071948d9114e4b3549d33a30a222e637098e403f
|
4
|
+
data.tar.gz: b99a72109cdb49da7039464441c54505da80053d8463d7c787d5de9aed139d59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e8e31dfaa754237ce4f4a9eed6661e3dc8ef2b0d04083c68e9007b54d39bfa926aac724f99f691c80b2c4d9167639d0f074d30c0b51df0693135c77e77a50be
|
7
|
+
data.tar.gz: 24123a62cbd819477b43eaffae23d527a4c156dcff2db16302ceab9b8e4d568f706422970af301e1f323197f2d84e454b7a125cddf3494893d94617fe6c5ba05
|
data/README.md
CHANGED
data/exe/sudow
CHANGED
@@ -9,7 +9,9 @@ if ARGV == []
|
|
9
9
|
puts
|
10
10
|
puts 'sudow - sudo wrapper to avoid secure_path.'
|
11
11
|
puts
|
12
|
-
puts 'Usage: sudow command args...'
|
12
|
+
puts 'Usage: sudow [-E] command args...'
|
13
|
+
puts
|
14
|
+
puts '-E preserve existing environment variables'
|
13
15
|
puts
|
14
16
|
puts '$ which gem'
|
15
17
|
puts '/usr/local/ruby2.5.1/bin/gem'
|
@@ -18,7 +20,12 @@ if ARGV == []
|
|
18
20
|
puts 'sudo: gem: command not found'
|
19
21
|
puts
|
20
22
|
puts '$ sudow gem install ...'
|
21
|
-
puts 'sudo
|
23
|
+
puts 'sudo /usr/local/ruby2.5.1/bin/gem install ...'
|
24
|
+
puts 'Fetching: ...'
|
25
|
+
puts
|
26
|
+
puts '$ export http_proxy=http://proxy.example.com:8080/'
|
27
|
+
puts '$ sudow -E gem install ...'
|
28
|
+
puts 'sudo -E /usr/local/ruby2.5.1/bin/gem install ...'
|
22
29
|
puts 'Fetching: ...'
|
23
30
|
puts
|
24
31
|
puts '*This command bypass the security mechanism called secure_path.*'
|
@@ -27,13 +34,20 @@ if ARGV == []
|
|
27
34
|
exit 1
|
28
35
|
end
|
29
36
|
|
37
|
+
if ARGV[0] == '-E'
|
38
|
+
flag = '-E'
|
39
|
+
ARGV.shift
|
40
|
+
else
|
41
|
+
flag = ''
|
42
|
+
end
|
43
|
+
|
30
44
|
cmd = ARGV.shift
|
31
45
|
fullpath = `which #{cmd}`.strip
|
32
46
|
if fullpath == ''
|
33
47
|
puts "#{cmd} not found."
|
34
48
|
exit 1
|
35
49
|
end
|
36
|
-
sudo_cmd = "sudo #{fullpath} #{ARGV.join(' ')}"
|
50
|
+
sudo_cmd = "sudo #{flag} #{fullpath} #{ARGV.join(' ')}"
|
37
51
|
|
38
52
|
puts sudo_cmd
|
39
53
|
exec sudo_cmd
|
data/lib/sudow/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sudow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- s3fxn
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|