rootwrap daemon does not work properly

Bug #1663216 reported by xianchaobo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.rootwrap
Fix Released
Medium
xianchaobo

Bug Description

When use rootwrap daemon mode, and it will fail to run command in the following case:
(1)Use daemon to run a command CMDA which does not install on the host. It will fail and raise an exception:
     Unserializable message: ('#ERROR', FilterMatchNotExecutable()) ---It's OK
(2)Then install CMDA on the host, and try to run command again through daemon(DO NOT restart daemon). It still fails and raise the same exception. --- I think this is not what we expect

I try to find what's wrong and find there is a BUG in the code:
https://github.com/openstack/oslo.rootwrap/blob/master/oslo_rootwrap/filters.py#L42

I think we do not need this line `self.real_exec = ""`

When first time to run cmd, real_exec is None.
And if we do not install the cmd on the host, it will be an empty string.
Then we install cmd on the host and run cmd again. It will return the empty string, because empty string is not None. Then it will not to check the cmd on the host forever.

xianchaobo (xianchaobo)
description: updated
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.rootwrap (master)

Fix proposed to branch: master
Review: https://review.openstack.org/431516

Changed in oslo.rootwrap:
assignee: nobody → xianchaobo (xianchaobo)
status: New → In Progress
Changed in oslo.rootwrap:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.rootwrap (master)

Reviewed: https://review.openstack.org/431516
Committed: https://git.openstack.org/cgit/openstack/oslo.rootwrap/commit/?id=a76f5daad99de32bed3a5f901768c24fc869e2a5
Submitter: Jenkins
Branch: master

commit a76f5daad99de32bed3a5f901768c24fc869e2a5
Author: XianChaobo <email address hidden>
Date: Thu Feb 9 21:14:47 2017 +0800

    Always check cmd which does not exist

    In daemon mode, if run a cmd which does not exist,
    it will raise an Exception. But when we install the
    cmd later and run cmd, it still raise an Exception.
    The only work around right now is to restart the
    daemon, with this change, we can avoid restarting
    the daemon

    Closes-Bug: #1663216
    Change-Id: I6f6ff540ed103f0fec329d6264bdac26493c8fad

Changed in oslo.rootwrap:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/oslo.rootwrap 5.5.0

This issue was fixed in the openstack/oslo.rootwrap 5.5.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.