From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Tue, 1 Feb 2011 09:11:45 -0500 To: 9fans@9fans.net Message-ID: <553b27e69992450b4c78e93d38c60744@brasstown.quanstro.net> In-Reply-To: <86ipx4s36p.fsf@cmarib.ramside> References: <86ipx4s36p.fsf@cmarib.ramside> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] RESOLVED: recoving important header file rudely Topicbox-Message-UUID: a659d96a-ead6-11e9-9d60-3106f5b1d025 > term% mkdir trashdir && cd trashdir && mkdir x > term% touch `{i=0; while (test $i -lt 128) { echo -n abcdefghijklmnop; i=`{echo $i+1|hoc} } } > term% cp abc* abc* x > # watch the cp executable suicide > # now, make SURE there's nothing in this rio window that you want to keep... > term% rm abc* > # watch the rio window go bye bye! it used to be that path elements on the file server were limited to 26 non-space characters. if you're running ken, that limit is typically 56 characters. but fileservers (e.g. ramfs) are free to choose any limit they wish. i think fgb's fix is a good band-aid. but we need to be flexible and handle arbitrary sized file names. i'm applying this. i goto Again because i don't want to break the rest of the glob. ; diffy -c plan9.c /n/dump/2011/0201/sys/src/cmd/rc/plan9.c:443,448 - plan9.c:443,449 int Readdir(int f, void *p, int onlydirs) { + char *s; int n; if(f<0 || f>=NFD) /n/dump/2011/0201/sys/src/cmd/rc/plan9.c:465,472 - plan9.c:466,478 } if(dir[f].i == dir[f].n) return 0; - strcpy(p, dir[f].dbuf[dir[f].i].name); + s = dir[f].dbuf[dir[f].i].name; dir[f].i++; + if(strlen(s) >= NDIR){ + pfmt(err, "rc: file name too long: %s\n", s); + goto Again; + } + strcpy(p, s); return 1; } - erik