yum-plugin-post-transaction-actions package does not allow colons in command part
ggore at redhat.com
ggore at redhat.com
Thu Aug 28 14:57:08 UTC 2014
Hello,
I have installed yum-plugin-post-transaction-actions package and have
added below line in httpd.action file in post-action directory.
|httpd*:any:setfacl -m u:apache:rwx /var/xxxx
|I got an exception while installing/removing/updating httpd package as:
|Bad Action Line:||httpd*:any:setfacl -m u:apache:rwx /var/xxxx|
The file sample.action explicitly says that "any shell command" is allowed. But for setfacl command it throws above exception.
Root Cause of this behaviour is:
* For parsing the files in post-action directory, split() function is
used and delimiter used is ':' .
* After parsing the line, only 3 words are expected to be returned by
split() function, those are key, state and a command.
* If command part contains a colon : then an exception "Bad Action
Line: " is thrown because only 3 words are expected as output.
e.g. httpd*:any:setfacl -m u:apache:rwx /var/temp
* In above example setfacl command is written in command part, and it
contains colons causing an exception.
For this issue I have created a patch and attached the same with this email.
Regards,
Ganesh Gore
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.baseurl.org/pipermail/yum-devel/attachments/20140828/72127489/attachment.html>
-------------- next part --------------
--- original/usr/lib/yum-plugins/post-transaction-actions.py 2014-05-23 19:37:42.000000000 +0530
+++ changed/usr/lib/yum-plugins/post-transaction-actions.py 2014-08-28 13:42:01.071047844 +0530
@@ -51,7 +51,7 @@ def parse_actions(ddir, conduit):
line = line.strip()
if line and line[0] != "#":
try:
- (a_key, a_state, a_command) = line.split(':')
+ (a_key, a_state, a_command) = line.split(':',2)
except ValueError,e:
conduit.error(2,'Bad Action Line: %s' % line)
continue
More information about the Yum-devel
mailing list