9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: rog@vitanuova.com
To: 9fans@cse.psu.edu
Subject: Re: [9fans] kfs un-removable file
Date: Mon, 27 Oct 2003 16:02:13 +0000	[thread overview]
Message-ID: <3ff7aff7e446ebd1fe0a788c93d5d844@vitanuova.com> (raw)
In-Reply-To: <E1AE7WQ-000GOT-5t@t40.swtch.com>

> I doubt that.  C2 80 is UTF for 0x80, the error rune.
> When any of the UTF routines process a bad UTF sequence, they
> replace it with the error rune.  So what's really happening,
> probably, is that kfs is giving you bad data (not UTF) and
> ls is coping.

that's not necessarily the case.

we've got some files on our filesystem (an old style fileserver) that
have C2 80 sequences in them, and they seem to be unremovable.  a
direct stat on the files still gives the c2-80 sequences (as far as i
can see convM2D doesn't do any utf conversions, so it shouldn't be
necessary to look at the raw dir format)

not only are the files non-removable, several of them have a few
duplicates.

after a little experimentation, it seems that the fileserver (and
presumably kfs too) doesn't check utf consistency on input, but does
convert utf chars on output (mind you, it's not obvious from a quick
check in the source).

in fact, in the example i just tried, i did similar to:

	char buf[] = "/tmp/yyXz";
	buf[7] = 0xff; create(buf, OWRITE, 8r666);
	buf[7] = 0xfd; create(buf, OWRITE, 8r666);

both creates succeeded, and i now have two unremovable
files in my /tmp (oops).

cat /tmp | xd -c

shows that the filenames of each are identical (in this
case they're each exactly "yy").

i'd suggest that perhaps it'd be a good idea for the fileserver
to canonicalise names on creation as quite apart from
invalid utf sequences, aren't there several possible
utf sequences that can validly map to the same character?



  parent reply	other threads:[~2003-10-27 16:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-27 13:07 steve-simon
2003-10-27 13:35 ` Russ Cox
2003-10-27 15:15   ` C H Forsyth
2003-10-27 16:15     ` ron minnich
2003-10-27 16:02   ` rog [this message]
2003-10-27 16:06     ` Scott Schwartz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3ff7aff7e446ebd1fe0a788c93d5d844@vitanuova.com \
    --to=rog@vitanuova.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).