[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#12366: [gnu-prog-discuss] Writing unwritable files
From: |
Paolo Bonzini |
Subject: |
bug#12366: [gnu-prog-discuss] Writing unwritable files |
Date: |
Thu, 06 Sep 2012 14:39:51 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 |
Il 06/09/2012 14:30, Pádraig Brady ha scritto:
>>
>> I consider "shuf foo -o foo" (on a read-write file) to be insecure.
>> Besides, it works by chance just because it reads everything in memory
>> first. If it used mmap to process the input file, "shuf foo -o foo"
>> would be broken, and the only way to fix it would be to do the same as
>> "sed -i".
>>
>> shuf could in fact introduce a "shuf -i" mode that would be consistent
>> with the way "sed -i" works, including the ability to create a backup
>> file _and_ the breaking of hard links.
>
> Well `sort` and `shuf` need to read all their input before
> generating output.
Yes, but they could use mmap instead of a single large buffer to cope
with files that are bigger than the available memory, but smaller than
the address space.
> This is traditional behavior and
> POSIX also states that -o can refer to one of the input files.
Interesting, thanks!
Paolo
- bug#12366: [gnu-prog-discuss] Writing unwritable files, Paolo Bonzini, 2012/09/06
- bug#12366: [gnu-prog-discuss] Writing unwritable files, Pádraig Brady, 2012/09/06
- bug#12366: [gnu-prog-discuss] Writing unwritable files,
Paolo Bonzini <=
- bug#12366: [gnu-prog-discuss] Writing unwritable files, Bernhard Voelker, 2012/09/06
- bug#12366: [gnu-prog-discuss] Writing unwritable files, Jim Meyering, 2012/09/06
- bug#12366: [gnu-prog-discuss] Writing unwritable files, Paul Eggert, 2012/09/06
- bug#12366: [gnu-prog-discuss] Writing unwritable files, Paolo Bonzini, 2012/09/06
- bug#12366: [gnu-prog-discuss] Writing unwritable files, Paul Eggert, 2012/09/06
- bug#12366: [gnu-prog-discuss] Writing unwritable files, Paolo Bonzini, 2012/09/06
- bug#12366: [gnu-prog-discuss] Writing unwritable files, Paul Eggert, 2012/09/06
- bug#12366: [gnu-prog-discuss] Writing unwritable files, Bob Proulx, 2012/09/06
- bug#12366: [gnu-prog-discuss] Writing unwritable files, Paul Eggert, 2012/09/06
- bug#12366: [gnu-prog-discuss] Writing unwritable files, Bernhard Voelker, 2012/09/06