Niels Thykier wrote... > Can you help me come up with a more reliable regex / handling of file(1) > output that satisfy your request from #931996 and also avoiding > regressions like this bug?
Ups, sorry for breaking debhelper the second time in a week. Y'know, three time's a charm, still it's called unstable for a reason :=] Anyway, looking into the file sources and playing around a bit I learned some results of a stat call are prefixed to the actual detection text, indeed failing the left-anchored ELF string for setuid executables. The worst that can happen for ELF executables is something like | setuid, setgid, sticky ELF 64-bit LSB pie executable, (...) and in that order. Aside, I cannot imagine sticky executable files but it's technically possible, so let's play safe. So a quick and lazy solution was | /^([a-z, ]*)?ELF/ while a less error-prone is | /^((setuid|setgid|sticky),? )*ELF/ although that one supports Perl reputation of being write-only code. Still both do the job, I've checked. Kind regards, Christoph
signature.asc
Description: PGP signature