Deutsch   English   Français   Italiano  
<681d3016@news.ausics.net>

View for Bookmarking (what is this?)
Look up another Usenet article

Message-ID: <681d3016@news.ausics.net>
From: not@telling.you.invalid (Computer Nerd Kev)
Subject: Re: Case Insensitive File Systems -- Torvalds Hates Them
Newsgroups: comp.os.linux.misc
References: <pan$4068a$3910f4f1$8cbecede$9e42905e@linux.rocks>   <slrn1016uic.2qk.rotflol2@geidiprime.bvh> <m7hgt7F8mvgU5@mid.individual.net> <6813f997@news.ausics.net> <vvbe5q$1em7m$1@dont-email.me> <68194581@news.ausics.net> <vvbook$1oubc$1@dont-email.me> <681aa121@news.ausics.net> <wwvcyckspu8.fsf@LkoBDZeT.terraraq.uk> <3aorelxelu.ln2@Telcontar.valinor> <wwv7c2sf69b.fsf@LkoBDZeT.terraraq.uk> <681be760@news.ausics.net> <vvh338$1c1cf$2@dont-email.me> <681c316b@news.ausics.net> <vvigqa$1sigj$1@dont-email.me>
User-Agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/2.4.31 (i586))
NNTP-Posting-Host: news.ausics.net
Date: 9 May 2025 08:28:38 +1000
Organization: Ausics - https://newsgroups.ausics.net
Lines: 66
X-Complaints: abuse@ausics.net
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.bbs.nz!news.ausics.net!not-for-mail
Bytes: 4225

Rich <rich@example.invalid> wrote:
> Computer Nerd Kev <not@telling.you.invalid> wrote:
>> Rich <rich@example.invalid> wrote:
>>> Computer Nerd Kev <not@telling.you.invalid> wrote:
>>>> But it means assuming that newlines in filenames won't actually 
>>>> appear.
>>> 
>>> Which, in reality, is all but true unless someone is going out of 
>>> their way to experiment or be very odd.  The only time I've ever 
>>> encountered filenames with newlines has been when I've deliberately 
>>> created them to verify some bit of code (or to try to break some bit 
>>> of code, although verify/break often go hand in hand).
>> 
>> That's my point exactly, all these work-arounds in specific programs 
>> like "find -print0" in GNU Find have been written even though use of 
>> newlines in filenames is so rare.
> 
> The -print0 "workaround" as you call it is not there "just for 
> newlines".  Banning newlines would not help with the need for -print0.  
> -print0 also helps with preventing all the other shell metacharacters 
> and spaces from also causing trouble when piping filenames through all 
> the various tools.

No, the GNU Find man page says:
"-print0, -fprint0
 Always print the exact filename, unchanged, even if the output is
 going to a terminal."

Which is the same as the default -print if the output isn't to a
terminal, except -print0 uses null instead of newline to separate
filenames because they're a particular problem. Other special
characters aren't as problematic.

>> We'd have been better off with newlines forbidden in filenames so 
>> that all the special handling just for the sake of someone "going out 
>> of their way to experiment or be very odd" could be avoided.  
>> Probably more secure against people hacking software whose authors 
>> didn't think about it too.
> 
> Forbidding newlines would not fix the need for -print0.  You'd also 
> need to forbid an entire host of printable characters (many of which 
> unsuspecting users will try to use, such as ASCII single quote ' for a 
> contraction in a filename).  You'd either need to ban things like ' 
> and $ and " and others - and as soon as you go down that path it's 
> almost a bottomless hole until you've banned everything but [a-z0-9.].

Of course not, text processing programs don't choke on them like with
newlines, and they don't make single files (log entries, etc.) look
like multiple separate ones in lists shown to users (other whitespace
characters are a hazard with multi-column file lists like with "ls",
but few other programs output filenames like that).

>> Yes it's too late to change now, _someone_ will be using filenames 
>> with newlines in a major way, but I'd say the same about the case 
>> insensitivity feature which "Torvalds Hates".
> 
> I very much doubt anyone actually "uses newlines" in a filename (other 
> than for testing that something does not break when they are 
> encountered).

Yep wasted time testing and accomodating newlines in filenames,
which could have been avoided if they weren't allowed.

-- 
__          __
#_ < |\| |< _#