Created attachment 607032 [details] example selinux audit log containing trigger data Description of problem: sealert outputs sh errors when an alert description contains parenthesis. Example text that causes error: SELinux is preventing /usr/sbin/httpd from execute access on the file /var/tmp/ffiasFfSA (deleted). The console output that occurs when this bug is triggered is: sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `{ rpm -qf /var/tmp/ffiasFfSA (deleted); } 2>&1' Version-Release number of selected component (if applicable): setroubleshoot-server-3.0.47-3.el6_3.x86_64 : SELinux troubleshoot server How reproducible: Attempt to parse effected audit log. Steps to Reproduce: 1. Normal execution of the program (sealert -a /var/log/audit/audit.log Actual results: Spurious STDERR output Expected results: Normal output only Additional info: It seems that the end result is acceptable, as sealert displays information about the alert and suggested actions to resolve. The STDERR output doesn't -seem- to cause problems. Attached is a log containing data triggering this bug. Notice: this bug was discovered in CentOS, however this should apply in RedHat as well, hence my reporting this upstream.
Thanks for the reproducer: # sealert -a audit-bugged.log 90% donesh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `{ rpm -qf /dev/shm/ffiLrZ5md (deleted); } 2>&1' sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `{ rpm -qf /var/tmp/ffiweyQpP (deleted); } 2>&1' sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `{ rpm -qf /tmp/ffihraCsr (deleted); } 2>&1' sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `{ rpm -qf /tmp/ffi7qKEQL (deleted); } 2>&1' sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `{ rpm -qf /dev/shm/ffij4iYAP (deleted); } 2>&1' sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `{ rpm -qf /var/tmp/ffisQXNIN (deleted); } 2>&1' 90% donesh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `{ rpm -qf /tmp/ffimYq09u (deleted); } 2>&1' sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `{ rpm -qf /var/tmp/ffidJQUNx (deleted); } 2>&1' sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `{ rpm -qf /dev/shm/ffiyKAQrA (deleted); } 2>&1' sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `{ rpm -qf /tmp/ffi7sQhQP (deleted); } 2>&1' sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `{ rpm -qf /var/tmp/ffirnRrjl (deleted); } 2>&1' sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `{ rpm -qf /dev/shm/fficqZDMQ (deleted); } 2>&1' sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `{ rpm -qf /tmp/ffi6Puhvs (deleted); } 2>&1' sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `{ rpm -qf /var/tmp/ffi7opCgK (deleted); } 2>&1' sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `{ rpm -qf /dev/shm/ffiod5911 (deleted); } 2>&1' 90% donesh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `{ rpm -qf /var/tmp/ffimd316H (deleted); } 2>&1' sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `{ rpm -qf /tmp/ffioeOtsP (deleted); } 2>&1' sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `{ rpm -qf /dev/shm/ffiaXoBLA (deleted); } 2>&1' sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `{ rpm -qf /tmp/ffignbzrg (deleted); } 2>&1' sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `{ rpm -qf /var/tmp/ffilOd94b (deleted); } 2>&1' sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `{ rpm -qf /dev/shm/ffi8hmKI7 (deleted); } 2>&1' 92% donesh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `{ rpm -qf /tmp/ffiE3rPcM (deleted); } 2>&1' sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `{ rpm -qf /dev/shm/ffiTJ7psR (deleted); } 2>&1' sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `{ rpm -qf /var/tmp/ffi7fJzPO (deleted); } 2>&1' 98% donesh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `{ rpm -qf /tmp/ffityM2P1 (deleted); } 2>&1' sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `{ rpm -qf /var/tmp/ffiasFfSA (deleted); } 2>&1' sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `{ rpm -qf /dev/shm/ffiRj4tU9 (deleted); } 2>&1' 100% donefound 3 alerts in audit-bugged.log --------------------------------------------------------------------------------
*** Bug 855496 has been marked as a duplicate of this bug. ***
Fixed in setroubleshoot-3.0.47-4.el6
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux release for currently deployed products. This request is not yet committed for inclusion in a release.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2013-0387.html