smart_proxy_remote_execution_ssh 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 737be07967da1d6f4b36efbfccf19bbe0030cd6fb3e46bb482ddf355a2f0f73f
4
- data.tar.gz: 5c8190efffae12022d6a828710fc661f91339c0145b68679e8afb4870902e2e4
3
+ metadata.gz: 3c52e262769802ba7236ffa5735318502636db7b6e3b1aa95777c6538631987e
4
+ data.tar.gz: ac198f44a8933215b0e4e552d8fa19c5ea9fa441aaf92613e541912dc56abaed
5
5
  SHA512:
6
- metadata.gz: 042cd0a22659eb8e677424b3160e5501971ee112fed54f72448f068dcfb4231291341511e2bdab65dc91366426d6b90517a219f7a1083f9ee3b8b6b6df1d3ddc
7
- data.tar.gz: 86e0575e799a777e3d5cee82f62d6e7044694071f12009c7d46bb9d131c6f2ab416ac3e396789aada1f13cf61d8dad4236c8a8499fd55827bb07c14679283d5f
6
+ metadata.gz: 04eccbae6f9bef0cb192432d68e788fad4c8a08b27ae917434bd9941a24857d0adc412e28161edba835526ee5fca2254572a03ec955d09103f955f58e73d765b
7
+ data.tar.gz: e9227de7f8ad2b7419184eac5c03c8710d0243aefea9a83e267fa07671bdacec5e03ee5162e65a48a93b3de21e123495e40e5f475781aa66e5f2e751ef818876
@@ -420,8 +420,13 @@ module Proxy::RemoteExecution::Ssh::Runners
420
420
  end
421
421
 
422
422
  def ensure_effective_user_access(*paths, mode: 'rx')
423
- unless @user_method.is_a? NoopUserMethod
424
- ensure_remote_command("setfacl -m u:#{@user_method.effective_user}:#{mode} #{paths.join(' ')}")
423
+ return if @user_method.is_a?(NoopUserMethod) || @user_method.effective_user == 'root'
424
+
425
+ paths_str = paths.join(' ')
426
+ if @user_method.ssh_user == 'root'
427
+ ensure_remote_command("chown #{@user_method.effective_user} #{paths_str} && chmod u=#{mode} #{paths_str}")
428
+ else
429
+ ensure_remote_command("setfacl -m u:#{@user_method.effective_user}:#{mode} #{paths_str}")
425
430
  end
426
431
  end
427
432
  end
@@ -1,7 +1,7 @@
1
1
  module Proxy
2
2
  module RemoteExecution
3
3
  module Ssh
4
- VERSION = '1.0.1'
4
+ VERSION = '1.0.2'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_proxy_remote_execution_ssh
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Nečas