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 1453169 Details for
Bug 1593212
--enable-network got broken by commit disabling host_resolv
[?]
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]
Proposed fix
mock-1.4.11-fix-networking.patch (text/plain), 2.85 KB, created by
Jaroslav Škarvada
on 2018-06-20 09:49:37 UTC
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Jaroslav Škarvada
Created:
2018-06-20 09:49:37 UTC
Size:
2.85 KB
patch
obsolete
>diff --git a/py/mock.py b/py/mock.py >index 7a52813..81b1326 100755 >--- a/py/mock.py >+++ b/py/mock.py >@@ -663,6 +663,8 @@ def main(): > # cmdline options override config options > util.set_config_opts_per_cmdline(config_opts, options, args) > >+ util.setup_host_resolv(config_opts) >+ > # allow a different mock group to be specified > if config_opts['chrootgid'] != mockgid: > uidManager.restorePrivs() >diff --git a/py/mockbuild/util.py b/py/mockbuild/util.py >index aefa4ce..bf54778 100644 >--- a/py/mockbuild/util.py >+++ b/py/mockbuild/util.py >@@ -1283,6 +1283,20 @@ def do_update_config(log, config_opts, cfg, uidManager, name, skipError=True): > log.error(" If you're trying to specify a path, include the .cfg extension, e.g. -r ./target.cfg") > sys.exit(1) > >+@traceLog() >+def setup_host_resolv(config_opts): >+ if not config_opts['use_host_resolv']: >+ # default /etc/hosts contents >+ if 'etc/hosts' not in config_opts['files']: >+ config_opts['files']['etc/hosts'] = dedent('''\ >+ 127.0.0.1 localhost localhost.localdomain >+ ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 >+ ''') >+ # bind mount an empty /etc/resolv.conf when using nspawn and networking is disabled >+ if config_opts['use_nspawn'] and not config_opts['rpmbuild_networking']: >+ resolv_path = (tempfile.mkstemp(prefix="mock-resolv."))[1] >+ atexit.register(_nspawnTempResolvAtExit, resolv_path) >+ config_opts['nspawn_args'] += ['--bind={0}:/etc/resolv.conf'.format(resolv_path)] > > @traceLog() > def load_config(config_path, name, uidManager, version, pkg_python_dir): >@@ -1320,19 +1334,6 @@ def load_config(config_path, name, uidManager, version, pkg_python_dir): > '~' + pwd.getpwuid(os.getuid())[0]), '.config/mock.cfg') > do_update_config(log, config_opts, cfg, uidManager, name) > >- if not config_opts['use_host_resolv']: >- # default /etc/hosts contents >- if 'etc/hosts' not in config_opts['files']: >- config_opts['files']['etc/hosts'] = dedent('''\ >- 127.0.0.1 localhost localhost.localdomain >- ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 >- ''') >- # bind mount an empty /etc/resolv.conf when using nspawn and networking is disabled >- if config_opts['use_nspawn'] and not config_opts['rpmbuild_networking']: >- resolv_path = (tempfile.mkstemp(prefix="mock-resolv."))[1] >- atexit.register(_nspawnTempResolvAtExit, resolv_path) >- config_opts['nspawn_args'] += ['--bind={0}:/etc/resolv.conf'.format(resolv_path)] >- > if config_opts['use_container_host_hostname'] and '%_buildhost' not in config_opts['macros']: > config_opts['macros']['%_buildhost'] = socket.getfqdn() > return config_opts
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 1593212
: 1453169