From: Jeff Mahoney Subject: apparmor-utils: Fix handling of files in / References: bnc#397883 The separate handling of files and directories with realpath is broken. For files e.g. /foo, $dir ends up being empty since the / is eaten by the regex. realpath resolves an empty argument as the current directory, resulting in an incorrect path. There's no explanation of why the separate handling was used in the first place. Signed-off-by: Jeff Mahoney --- utils/Immunix/AppArmor.pm | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) --- a/utils/Immunix/AppArmor.pm +++ b/utils/Immunix/AppArmor.pm @@ -553,14 +553,7 @@ sub get_full_path ($) { } } - if (-f $path) { - my ($dir, $file) = $path =~ m/^(.*)\/(.+)$/; - $path = realpath($dir) . "/$file"; - } else { - $path = realpath($path); - } - - return $path; + return realpath($path); } sub findexecutable ($) {