diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-05-23 03:23:32 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-05-23 03:23:32 +0000 |
commit | 6bbf8840c52a993f901a99e54aad22251889daae (patch) | |
tree | 961953fe468cf15bc8500782c86333f1f87fddd6 /ironic/openstack | |
parent | 49c323f29579e2fc9c10307fb21e62a7aa0049db (diff) | |
parent | ac236c085b77ed350115b3387fc0184374390ae0 (diff) | |
download | ironic-6bbf8840c52a993f901a99e54aad22251889daae.tar.gz |
Merge "Sync a rootwrap KillFilter fix from oslo-incubator"
Diffstat (limited to 'ironic/openstack')
-rw-r--r-- | ironic/openstack/common/rootwrap/filters.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ironic/openstack/common/rootwrap/filters.py b/ironic/openstack/common/rootwrap/filters.py index d9618af88..f73dd0108 100644 --- a/ironic/openstack/common/rootwrap/filters.py +++ b/ironic/openstack/common/rootwrap/filters.py @@ -196,6 +196,10 @@ class KillFilter(CommandFilter): return False try: command = os.readlink("/proc/%d/exe" % int(args[1])) + # NOTE(yufang521247): /proc/PID/exe may have '\0' on the + # end, because python doen't stop at '\0' when read the + # target path. + command = command.split('\0')[0] # NOTE(dprince): /proc/PID/exe may have ' (deleted)' on # the end if an executable is updated or deleted if command.endswith(" (deleted)"): |