Mangle again.

Christopher R. Hertel (crh@NTS.Umn.EDU)
Tue, 31 Mar 1998 15:45:53 -0600 (CST)

From:	"Christopher R. Hertel" <crh@NTS.Umn.EDU>
Message-Id: <199803312145.PAA02458@unet.unet.umn.edu>
Subject: Mangle again.
To:	samba-technical@samba.anu.edu.au (samba-tech)
Date:	Tue, 31 Mar 1998 15:45:53 -0600 (CST)

This is probably for Jeremy and Andrew,

I want to know if illegal_name() should go away...

There is an internal function called illegal_name() in mangle.c.
Basically, it checks an input string to determine whether it contains any
of the following illegal characters:

"*\\/?<>|\":"

There is also a macro called isdoschar() which tests a character to see if
it is a legal DOS character. This macro appears to return True for
alphanumeric characters (isalnum()) and for characters in

"._^$~!#%&-{}()@'`"

illegal_name() is only used once:

BOOL name_map_mangle( char *OutName, BOOL need83, int snum )
{
#ifdef MANGLE_LONG_FILENAMES
if( !need83 && illegal_name(OutName) )
need83 = True;
#endif
:
:

So... my question:

Is this a left-over from before the code-page stuff? If so should it,
perhaps, be written as:

static BOOL illegal_name( char *name )
{
while( *name )
{
if( !isdoschar( *name ) )
return( True );
}
return( False );
} /* illegal_name */

or should it, perhaps, be dropped?

Chris -)-----

--
Christopher R. Hertel -)-----                   University of Minnesota
crh@nts.umn.edu              Networking and Telecommunications Services