From: Ales Kozumplik ales@redhat.com
--- pyanaconda/packaging/dnfpayload.py | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/pyanaconda/packaging/dnfpayload.py b/pyanaconda/packaging/dnfpayload.py index ba7fd27..815f1c5 100644 --- a/pyanaconda/packaging/dnfpayload.py +++ b/pyanaconda/packaging/dnfpayload.py @@ -341,6 +341,10 @@ class DNFPayload(packaging.PackagePayload): super(DNFPayload, self).reset() self.txID = None
+ def selectEnvironment(self, environmentid): + env = self._base.comps.environment_by_pattern(environmentid) + map(self.selectGroup, (id_.name for id_ in env.group_ids)) + def setup(self, storage): # must end up with the base repo (and its metadata) ready super(DNFPayload, self).setup(storage)
From: Ales Kozumplik ales@redhat.com
--- pyanaconda/packaging/dnfpayload.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/packaging/dnfpayload.py b/pyanaconda/packaging/dnfpayload.py index 815f1c5..b394950 100644 --- a/pyanaconda/packaging/dnfpayload.py +++ b/pyanaconda/packaging/dnfpayload.py @@ -326,7 +326,7 @@ class DNFPayload(packaging.PackagePayload): def isRepoEnabled(self, repo_id): try: return self._base.repos[repo_id].enabled - except dnf.exceptions.RepoError: + except (dnf.exceptions.RepoError, KeyError): return super(DNFPayload, self).isRepoEnabled(repo_id)
def preInstall(self, packages=None, groups=None):
From: Ales Kozumplik ales@redhat.com
Due to a serious problem with NSS and fork() the Payload will have to do without crypto.
Related:RhBug:1006280 --- pyanaconda/packaging/dnfpayload.py | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/pyanaconda/packaging/dnfpayload.py b/pyanaconda/packaging/dnfpayload.py index b394950..bc8eb0a 100644 --- a/pyanaconda/packaging/dnfpayload.py +++ b/pyanaconda/packaging/dnfpayload.py @@ -139,6 +139,10 @@ class DNFPayload(packaging.PackagePayload): conf.installroot = constants.ROOT_PATH conf.releasever = self._getReleaseVersion(None)
+ # NSS won't survive the forking we do to shield out chroot during + # transaction, disable it in RPM: + conf.tsflags.append('nocrypto') + conf.reposdir = REPO_DIRS log.info('Loading repositories config on the filesystem.') self._base.read_all_repos()
On 09/11/2013 04:35 PM, Chris Lumens wrote:
Due to a serious problem with NSS and fork() the Payload will have to do without crypto.
Related:RhBug:1006280
What are the practical consequences of this?
The phase where rpm checks the digest and signing of the package *during transaction* is skipped. But DNF checks digests of any package downloaded from a repo already. The only thing we are losing security-wise is if somebody managed to get a spoofed package into the repo and then get the metadata to be generated against that. Which is hard to imagine to be happening for Fedora and if it can happen at a third party repo then they can also sign the package properly.
We are gaining some performance (computing the hashes is not for free) and of course we avoid the SIGSEGVs in RPM.
In theory, once the Payload is in wide use, someone with a reasonable security background might come and explain and complain. Then there's two options:
1) 1006280 will get fixed and I'll reenable the crypto in RPM. 2) In case the maintainers refuse to fix 1006280 ('keep up being unhelpful' is how some people might put it) the DNF Payload will have to drop the multiprocessing approach to the chroot isolation and do something similar to what the Yum payload and anaconda-yum already do.
Ales
From: Ales Kozumplik ales@redhat.com
--- pyanaconda/packaging/dnfpayload.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/packaging/dnfpayload.py b/pyanaconda/packaging/dnfpayload.py index bc8eb0a..585d543 100644 --- a/pyanaconda/packaging/dnfpayload.py +++ b/pyanaconda/packaging/dnfpayload.py @@ -73,8 +73,13 @@ class PayloadRPMDisplay(dnf.output.LoggingTransactionDisplay): self._queue.put(('post', None))
def do_transaction(base, queue): - display = PayloadRPMDisplay(queue) - base.do_transaction(display=display) + try: + display = PayloadRPMDisplay(queue) + base.do_transaction(display=display) + except BaseException as e: + log.error('The transaction process has ended abruptly') + log.info(e) + queue.put('quit', str(e))
class DNFPayload(packaging.PackagePayload): def __init__(self, data):
diff --git a/pyanaconda/packaging/dnfpayload.py b/pyanaconda/packaging/dnfpayload.py index bc8eb0a..585d543 100644 --- a/pyanaconda/packaging/dnfpayload.py +++ b/pyanaconda/packaging/dnfpayload.py @@ -73,8 +73,13 @@ class PayloadRPMDisplay(dnf.output.LoggingTransactionDisplay): self._queue.put(('post', None))
def do_transaction(base, queue):
- display = PayloadRPMDisplay(queue)
- base.do_transaction(display=display)
- try:
display = PayloadRPMDisplay(queue)base.do_transaction(display=display)- except BaseException as e:
log.error('The transaction process has ended abruptly')log.info(e)queue.put('quit', str(e))class DNFPayload(packaging.PackagePayload): def __init__(self, data):
Can you be any more fine-grained on the exception catching here?
- Chris
On 09/11/2013 04:34 PM, Chris Lumens wrote:
Can you be any more fine-grained on the exception catching here?
Yes but that would defeat the purpose of having it as broad as possible.
If there's an exception (even SystemExit or KeyboardInterrupt) in do_transaction() and we don't catch it right here the process terminates. But multiprocessing doesn't do anything special in that case (not even log the event) and in our case, the queue on the receiving end just waits forever. So all exceptions must be caught and logged and the final token transmitted.
Ales
These all look good to me.
anaconda-patches@lists.fedorahosted.org