Mangle again.

Christopher R. Hertel crh at NTS.Umn.EDU
Tue Mar 31 21:45:53 GMT 1998


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 at nts.umn.edu              Networking and Telecommunications Services



More information about the samba-technical mailing list