[fpc-devel]Message *bounced*

O/T-Track+ 2.66b "O/T-Track+=202.66b" at f854.n292.z2.fidonet.org
Wed Sep 6 07:58:41 CEST 2000


************************************************************************
***  WARNING -- WARNING -- WARNING -- WARNING -- WARNING -- WARNING  ***
************************************************************************
*
*      The e-mail-message appended below is list- or mailserver-related
*
*   That type of mail will by definition not be processed on this system
*         and in general is not accepted in the fidonet.org-domain.
*
*      To avoid these bouncings the listkeeper is kindly requested to
*   remove any subscription coming from a z2.fidonet.org-style address.
*
*    If you have reason to believe your message was removed without due
*     reason then kindly inform 'postmaster at f854.n292.z2.fidonet.org'.
*
************************************************************************

    From:  Thomas Schatzl @2:292/862
    To:    fpc-develop @2:5020/1305.201
    Subj.: Re: [fpc-devel]TP compatible fsplit()
    Dated: 05 Sep 00  09:31:42
    [processed here:  06 Sep 00 09:58:41]

@TOPT 201
@INTL 2:5020/1305 2:292/862
@MSGID: laptop 74461b4d
@REPLYADDR: fpc-devel at lists.freepascal.org
@REPLYTO: 2:292/862 at fidonet UUCP
@PID: Microsoft Outlook Express 5.00.2919.6600
@CHRS: LATIN-1 2
@RFC-Received: from vekoll.saturnus.vein.hu (root at vekoll.saturnus.vein.hu
[193.6.40.1]) 	by infomag.iguana.be (8.9.3/8.9.3) with ESMTP id UAA16391 	for
<fpc-develop at p201.f1305.n5020.z2.fidonet.org>; Tue, 5 Sep 2000 20:47:11 +0200
@RFC-Received: from vekoll.saturnus.vein.hu (daemon at localhost [127.0.0.1]) 	by
vekoll.saturnus.vein.hu (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id KAA24579;
	Tue, 5 Sep 2000 10:23:59 +0200
@RFC-Received: from mail3.yline.com (mail3.itd.at [212.236.39.38]) 	by
vekoll.saturnus.vein.hu (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id KAA24535
	for <fpc-devel at lists.freepascal.org>; Tue, 5 Sep 2000 10:23:49 +0200
@RFC-X-Authentication-Warning: vekoll.saturnus.vein.hu: Host mail3.itd.at
[212.236.39.38] claimed to be mail3.yline.com
@RFC-Received: from [212.236.236.190] (HELO laptop)   by mail3.yline.com
(CommuniGate Pro SMTP 3.3)   with SMTP id 2393000 for
fpc-devel at lists.freepascal.org; Tue, 05 Sep 2000 10:23:34 +0200
@RFC-Message-ID: <000401c01712$cf925da0$0600a8c0 at laptop>
@RFC-References: <20000904202659.962212E802 at hermes.tue.nl>
@RFC-X-Priority: 3
@RFC-X-MSMail-Priority: Normal
@RFC-Sender: fpc-devel-admin at lists.freepascal.org
@RFC-Errors-To: fpc-devel-admin at lists.freepascal.org
@RFC-X-Mailman-Version: 1.0rc2
@RFC-List-Id: FPC developers' list <fpc-devel.lists.freepascal.org>
@RFC-X-BeenThere: fpc-devel at lists.freepascal.org
From: "Thomas Schatzl" <tom_at_work at yline.com>
To: "FPC Devel mailing list" <fpc-devel at lists.freepascal.org>
Reply-To: fpc-devel at lists.freepascal.org

Subject: Re: [fpc-devel]TP compatible fsplit()

> > Problem: when using LFN the dos' fsplit() function doesn't return the
> > correct extension for filenames having multiple dots in the name (e.g.
'..',
> > 'file...exe', etc.) or at least not compatible TP ones.
> >
> > Solution (?): Changed it so that the extension is not only the last dot,
but
> > all last dots. [I hope you understand]. This is imho most TP compatible.
> > Actually if you it were possible with TP (tried by deliberately passing
such
> > a name) it produces garbage. It's the 'compatiblest' way I found, at
least
> > Lee John's recursive directory search works then with LFN too.
>
> Why that? If some idiot calls a file "readme..txt" and you try to get
> the extension, you get ".txt", and conclude you can't open it with
> notepad?

You get '..txt' in this case. The extension is always including the point.
Btw, Windows accepts a file with '..txt' being a '.txt' file. (e.g. it uses
a routine to detect extensions similar to your old routine)

> The points remain a problem. Both if you stick them with the name or
> the extension (and can't leave them out, because you can't
> concatenate it back together again)
>
> Marco van de Voort (MarcoV at Stack.nl or marco at freepascal.org)

But consider the directory '..' (previous directory) ! TP puts everything
after the first dot into the extension (e.g both dots). This is usually
checked for in directory traversals, because both this one and '.' have to
be ignored (the exit clause in the recursive call).
Else you get a dot in the name and a dot in the extension and checks fail
resulting in an endless loop until the stack overflows. (btw, actually FPC
should issue an RTE but not crash back to Windows when compiled as a GO32V2
program; same for the Win32 compiled program)

Exactly this is the problem. Not a person creating weird file names.

I already said that I don't really like it (because it's not the way OSes
handle this too).

TP rtl is aching everywhere, don't tell me.

You could add a simple check for '..' too overriding the whole other split
function - but that's even more a hack.
This solution is best imho.

Or do you have a better idea ? See his code and try. (I am not an expert in
dir traversals, I just made it to work - but I think the checks done are
correct)

Regards,
    Thomas





_______________________________________________
fpc-devel maillist  -  fpc-devel at lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel
@Via ifmail 2:292/862 at fidonet, Tue Sep 5 2000 at 20:47 (2.14-tx8.10)

@Via D'Bridge 1.58 2:292/854  09/06 09:54





More information about the fpc-devel mailing list