Filename and path length restrictions under Win95 and WinNT vs

Andrew Tridgell tridge at samba.org
Sat Feb 6 01:14:22 GMT 1999


There are a number of internal limits in Samba that might cause
problems. They center around the use of pstring and fstring in the
Samba sources.

They are defined as:

typedef char pstring[1024];
typedef char fstring[128];

in source/include/smb.h.

pstring is used for filenames. You will find that, unless you change
the above definition, Samba won't handle paths over 1024 bytes long
(remember, it is bytes, not characters, in some locales a character is
more than one byte for some/all characters).

fstring should only be used for strings that are _known_ to be short,
like netbios names. It is quite possible that we have a bug that
causes fstring to be used for filename components in which case that
could cause the limit you are seeing.

If you want to track this down then I suggest you do the following:

1) change the size of fstring and see if it makes a difference. f it
   does then work out which use of fstring is causing the problem and
   change it to a pstring. Submit a patch.

2) do some of your testing with smbclient. That will remove any
   effects caused by the win9x GUI.

The other limit is your OS limit on filename sizes and filename
component lengths. Samba can't do anything about that. To find out
what it is I suggest you play with a shell command line and see what
length files you can create/manipulate.

Cheers, Tridge


More information about the samba-technical mailing list