Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 572777 Details for
Bug 803217
scm get does not respect SSH_AUTH_SOCK environment variable
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Final (hopefully) scm environment fix
scm-environ-3.patch (text/plain), 3.72 KB, created by
Clark Williams
on 2012-03-26 15:03:29 UTC
(
hide
)
Description:
Final (hopefully) scm environment fix
Filename:
MIME Type:
Creator:
Clark Williams
Created:
2012-03-26 15:03:29 UTC
Size:
3.72 KB
patch
obsolete
>commit 16c0b808f0342b2a713b45a95143070a09c84fe2 >Author: Clark Williams <williams@redhat.com> >Date: Mon Mar 19 09:47:22 2012 -0500 > > fix problem in scm.py with SSH_AUTH_SOCK [BZ# 803217] > > Make a copy of the environment for the SCM plugin and add > the SSH_AUTH_SOCK to it (as well as changing HOME to match the > homedir of the active pid). Use the SCM environment when running > subprocesses for SCM operations. > > Add SSH_AUTH_SOCK to the KEEP_ENV_VARS config in consolehelper > so that SCM operations work properly. > > Signed-off-by: Clark Williams <williams@redhat.com> > >diff --git a/etc/consolehelper/mock b/etc/consolehelper/mock >index ce6c66e..b975f59 100644 >--- a/etc/consolehelper/mock >+++ b/etc/consolehelper/mock >@@ -2,4 +2,4 @@ USER=root > PROGRAM=/usr/sbin/mock > SESSION=false > FALLBACK=false >-KEEP_ENV_VARS=COLUMNS >+KEEP_ENV_VARS=COLUMNS,SSH_AUTH_SOCK >diff --git a/py/mock.py b/py/mock.py >index be0f501..d70d85e 100755 >--- a/py/mock.py >+++ b/py/mock.py >@@ -705,6 +705,10 @@ def main(ret): > scmWorker.get_sources() > (options.sources, options.spec) = scmWorker.prepare_sources() > >+ # security cleanup (don't need/want this in the chroot) >+ if os.environ.has_key('SSH_AUTH_SOCK'): >+ del os.environ['SSH_AUTH_SOCK'] >+ > # elevate privs > uidManager._becomeUser(0, 0) > >diff --git a/py/mockbuild/scm.py b/py/mockbuild/scm.py >index 10ce46f..22d89d2 100644 >--- a/py/mockbuild/scm.py >+++ b/py/mockbuild/scm.py >@@ -70,24 +70,23 @@ class scmWorker(object): > > self.log.debug("SCM checkout command: " + self.get) > self.log.debug("SCM checkout post command: " + str(self.postget)) >+ self.environ = os.environ.copy() >+ # Set HOME properly while checking out from SCM since tools like >+ # Subversion might have there settings needed to carry out checkout >+ # non-interactively >+ self.environ['HOME'] = pwd.getpwuid(os.getuid()).pw_dir >+ self.environ['CVS_RSH'] = "ssh" >+ if not self.environ.has_key('SSH_AUTH_SOCK'): >+ self.environ['SSH_AUTH_SOCK'] = pwd.getpwuid(os.getuid()).pw_dir + "/.ssh/auth_sock" > > decorate(traceLog()) > def get_sources(self): > self.wrk_dir = tempfile.mkdtemp(".mock-scm." + self.pkg) > self.src_dir = self.wrk_dir + "/" + self.pkg > self.log.debug("SCM checkout directory: " + self.wrk_dir) >- os.environ['CVS_RSH'] = "ssh" >- os.environ['SSH_AUTH_SOCK'] = pwd.getpwuid(os.getuid()).pw_dir + "/.ssh/auth_sock" >- # Set HOME properly while checking out from SCM since tools like >- # Subversion might have there settings needed to carry out checkout >- # non-interactively >- old_home = os.environ['HOME'] >- os.environ['HOME'] = pwd.getpwuid(os.getuid()).pw_dir >- mockbuild.util.do(shlex.split(self.get), shell=False, cwd=self.wrk_dir) >+ mockbuild.util.do(shlex.split(self.get), shell=False, cwd=self.wrk_dir, env=self.environ) > if self.postget: >- mockbuild.util.do(shlex.split(self.postget), shell=False, cwd=self.src_dir) >- os.environ['HOME'] = old_home >- >+ mockbuild.util.do(shlex.split(self.postget), shell=False, cwd=self.src_dir, env=self.environ) > self.log.debug("Fetched sources from SCM") > > decorate(traceLog()) >@@ -153,7 +152,7 @@ class scmWorker(object): > os.chdir(self.wrk_dir) > os.rename(self.name, tardir) > cmd = "tar czf " + tarball + " " + tardir >- mockbuild.util.do(shlex.split(cmd), shell=False, cwd=self.wrk_dir) >+ mockbuild.util.do(shlex.split(cmd), shell=False, cwd=self.wrk_dir, env=self.environ) > os.rename(tarball, tardir + "/" + tarball) > os.rename(tardir, self.name) > os.chdir(dir)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 803217
:
570811
|
571387
|
572370
| 572777 |
587386