lkml.org 
[lkml]   [2004]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: JFS default behavior
    On Mon, Feb 16, 2004 at 12:03:03AM +0100, Nicolas Mailhot wrote:
    > | Linus Torvalds pointed the way of Tux :
    >
    > | In short: the kernel talks bytestreams, and that implies that if you
    > | want to talk to the kernel, you HAVE TO USE UTF-8.
    >
    > In that case :
    > - should the kernel allow apps to write filenames that are invalid
    > UTF-8 and will crash UTF-8 apps ?

    Yes. The kernel interface specifies it as a bytesteam with
    0x00 and 0x2f having special meaning. That is a constraint,
    not a policy. It is user space that determines the policy
    of UTF-8.

    > UTF-8 and will crash UTF-8 apps ?

    Fix the broken apps. Crashing because of "invalid" UTF-8 is
    no more excusable than crashing because of a string longer
    than expected (buffer overrun). Filenames as read from the
    filesystem should be treated just like any other untrusted
    input.

    > - should this UTF-8 rule be noted somewhere (in a FAQ/man page/LSB spec/
    > whatever) so apps authors know they are supposed to read and write UTF-8
    > filenames and not apply locale rules to kernel objects ?

    Since the LSB spec describes user space it might be a
    suitable place.

    > - what happens to already existing invalid UTF-8 filenames ? Should the
    > kernel forcibly rewrite them (in 2.7.0...) to remove legacy mess ? What

    If you have a filesystem with filenames that don't conform
    to your policy write userspace tools to detect and/or fix
    them. If you have programs creating non-conforming
    filenames, fix or rm those programs.

    > kernel forcibly rewrite them (in 2.7.0...) to remove legacy mess ? What
    > should happen if someone plug an unconverted FS in such a system
    > afterwards ?

    The kernel won't care. Any user space code that treats the
    filenames as something other than bytestreams should be able
    to cope with any sequence of bytes.

    > These are the questions people have been asking.

    OK. The questions have been asked and answered.
    Asking again and again and again won't change the answer.



    --
    ________________________________________________________________
    J.W. Schultz Pegasystems Technologies
    email address: jw@pegasys.ws

    Remember Cernan and Schmitt
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 14:00    [W:0.026 / U:93.852 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site