patch for FILE: and NE??: "print to file" problems

Andy Bakun abakun at reac.com
Tue Jun 29 22:36:41 GMT 1999


In

     http://us1.samba.org/listproc/samba-technical/3697.html

I described a problem I was having with files being generated named FILE:
and NE??: when telling the printer driver to print to a file.  These files
would either contain the print output or be empty.  Included is a patch
which adds these two patterns to the list of "restricted msdos filenames".
In my tests, the applications that did have the problem of generating these
files and didn't prompt for a filename to save the printer output to works
as it should now.  Unfortunately, I lost the list of people who sent mail
to me saying they were having the same problem.  Anyway, could those of you
who have been experiencing this problem please try this patch out and let
us know if it fixes anything.

Andy.

--------- cut 8< -----------
*** smbd/mangle.c.orig  Tue Jun 29 16:58:38 1999
--- smbd/mangle.c       Tue Jun 29 17:13:35 1999
***************
*** 213,221 ****
--- 213,228 ----
      case 'N':
        if( 0 == strcmp( p, "UL" ) )
          return( True );
+       /* NE??, where ?? is a two digit number, NT uses this for dynamic
printer ports */
+       if( *p == 'E' && isdigit((int)p[1]) && isdigit((int)p[2]) && p[3]
== 0 )
+         return( True );
        break;
      case 'P':
        if( 0 == strcmp( p, "RN" ) )
+         return( True );
+       break;
+     case 'F':
+       if( 0 == strcmp( p, "ILE" ) )
          return( True );
        break;
      }
--------- cut 8< -----------




More information about the samba-technical mailing list