Skip to content

Commit

Permalink
Merge pull request #6571 from juztas/crabRelease
Browse files Browse the repository at this point in the history
Escape single quote if execute in clean env for crab release
  • Loading branch information
ticoann committed Feb 11, 2016
2 parents 2229e0c + 462c9d2 commit 8071818
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/python/WMCore/Credential/Proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ def setEnv(self, cmd):
if self.uisource is not None and len(self.uisource) > 0:
ret = 'source ' + self.uisource + ' && ' + ret
if self.cleanEnvironment:
# Need to escape ' in cmd
ret = ret.replace("'", r"'\''")
ret = "env -i sh -c '%s'" % ret

return ret
Expand Down Expand Up @@ -732,4 +734,4 @@ def getAllUserGroups(self, proxy):
for attribute in attributes:
splAttr = attribute.split('/') #splitted attribut
filtAttr = [part for part in splAttr if not (part.startswith('Role=') or part.startswith('Capability='))] #filtered attribute
yield '/'.join(filtAttr)
yield '/'.join(filtAttr)

0 comments on commit 8071818

Please sign in to comment.