tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: handle #! /usr/bin/env



The following works:
'/env -i/!s|^#![[:space:]]*/usr/bin/env|#!|'

But I don't know how to retain the address (1).

Can anyone better with sed give me a hint?

On Sun, Mar 3, 2013 at 12:18 AM, OBATA Akio <obache%netbsd.org@localhost> wrote:
> There is a worry that dropping `env -i' may introduce security risks
> (but it should be fixed to not depend on `env -i').
>
>
> On Sun, 03 Mar 2013 13:55:47 +0900, matthew sporleder 
> <msporleder%gmail.com@localhost>
> wrote:
>
>> I think this sed should handle it:
>> -e
>> '1s|^#![[:space:]]*/[^/]*/bin/env[[:space:]]*-*[[:alpha:]]*[[:space:]]|#!|'
>>
>> I'd appreciate a second look.
>>
>> On Sat, Mar 2, 2013 at 8:33 PM, matthew sporleder 
>> <msporleder%gmail.com@localhost>
>> wrote:
>>>
>>> I'd have to adjust the sed for that one.  I will work on it a little
>>> more tomorrow unless someone beats me to it.
>>>
>>> On Sat, Mar 2, 2013 at 8:22 PM, OBATA Akio <obache%netbsd.org@localhost> 
>>> wrote:
>>>>
>>>> for the case using /usr/bin/env with `-i'?
>>>>
>>>> --
>>>> OBATA Akio / obache%NetBSD.org@localhost
>>
>>
>
>
> --
> OBATA Akio / obache%NetBSD.org@localhost


Home | Main Index | Thread Index | Old Index