mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-31 14:25:52 +00:00
Fix handling of interpreters with parameters
If a script contains a hashbang like #! /usr/bin/perl -w aa-autodep created a profile entry like "/usr/bin/perl -w" ix, which is obviously incorrect. This patch fixes this (by using only the first part of the hashbang line) and also adds some tests for it. References: https://bugs.launchpad.net/apparmor/+bug/1505775 Acked-by: Kshitij Gupta <kgupta8592@gmail.com> Bug: https://launchpad.net/bugs/1393979
This commit is contained in:
@@ -105,7 +105,9 @@ class AaTest_get_interpreter_and_abstraction(AATest):
|
||||
('#!/bin/dash', ('/bin/dash', 'abstractions/bash')),
|
||||
('#!/bin/sh', ('/bin/sh', 'abstractions/bash')),
|
||||
('#! /bin/sh ', ('/bin/sh', 'abstractions/bash')),
|
||||
('#! /bin/sh -x ', ('/bin/sh', 'abstractions/bash')), # '-x' is not part of the interpreter path
|
||||
('#!/usr/bin/perl', ('/usr/bin/perl', 'abstractions/perl')),
|
||||
('#!/usr/bin/perl -w', ('/usr/bin/perl', 'abstractions/perl')), # '-w' is not part of the interpreter path
|
||||
('#!/usr/bin/python', ('/usr/bin/python', 'abstractions/python')),
|
||||
('#!/usr/bin/python2', ('/usr/bin/python2', 'abstractions/python')),
|
||||
('#!/usr/bin/python2.7', ('/usr/bin/python2.7', 'abstractions/python')),
|
||||
|
Reference in New Issue
Block a user