]> git.ipfire.org Git - pakfire.git/commitdiff
file: Actually only replace /usr/bin/env as interpreter
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 1 Jan 2025 17:00:22 +0000 (17:00 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 1 Jan 2025 17:00:22 +0000 (17:00 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/file.c

index 1d079db2cf491da14971e82a1573cdd056082cee..a988d811cdf1cb98ebdbaa6b0b172e2632507ab4 100644 (file)
@@ -1932,6 +1932,12 @@ int pakfire_file_fix_interpreter(struct pakfire_file* file) {
                                while (*p && isspace(*p))
                                        p++;
 
+                               // Check if the interpreter is /usr/bin/env
+                               if (!pakfire_string_startswith(p, "/usr/bin/env")) {
+                                       r = 0;
+                                       goto ERROR;
+                               }
+
                                // Consume the old interpreter
                                while (*p && !isspace(*p))
                                        p++;