only proxy to a remote when remote.name.annex-proxy is set
Avoids someone writing to proxy.log and gaining access to remotes of someone else's repository that they were not intended to be able to proxy to.
This commit is contained in:
parent
fb0fd78485
commit
ca08f3fcc2
1 changed files with 3 additions and 1 deletions
|
@ -20,6 +20,7 @@ import CmdLine.GitAnnexShell.Fields
|
|||
import Remote.GCrypt (getGCryptUUID)
|
||||
import P2P.Protocol (ServerMode(..))
|
||||
import Git.Types
|
||||
import qualified Types.Remote as R
|
||||
import Logs.Proxy
|
||||
import Logs.Cluster
|
||||
import Logs.UUID
|
||||
|
@ -204,8 +205,9 @@ checkProxy remoteuuid ouruuid = M.lookup ouruuid <$> getProxies >>= \case
|
|||
proxyfor ps = do
|
||||
rs <- concat . byCost <$> remoteList
|
||||
let sameuuid r = uuid r == remoteuuid
|
||||
let proxyconfigured = remoteAnnexProxy . R.gitconfig
|
||||
let samename r p = name r == proxyRemoteName p
|
||||
case headMaybe (filter (\r -> sameuuid r && any (samename r) ps) rs) of
|
||||
case headMaybe (filter (\r -> sameuuid r && proxyconfigured r && any (samename r) ps) rs) of
|
||||
Nothing -> notconfigured
|
||||
Just r -> do
|
||||
Annex.changeState $ \st ->
|
||||
|
|
Loading…
Add table
Reference in a new issue