NWFS mangled name algorithm.

David Collier-Brown - Sun Canada davecb at scot.canada.sun.com
Tue Mar 28 15:05:24 GMT 2000

John E. Malmberg wrote:
| The only way not to break things is to do like M$soft does and store the
| mangled short filename as an attribute of the file.

	Hard links (known as "add-names" back in Multics days) are
	stable, reliable attributes of files, but they have different
	deletion behavior than we'd want.
	That having been said, one could implement a different 
	mechanism using links via Tim's VFS, and experiment with
	adding the required behavior by overriding the rename and
	delete operations.
	create ::= 
		if not 8.3,
			while matching 8.3 name exists, 
	mv ::=
		mv longname
		while matching 8.3 name exists, 
		me 8.3 name
	delete ::=
		if longname
			rm longname
			rm 8.3 with same inode number
			rm 8.3
			rm longname with same inode number and
				mangleable to the 8.3 name
	This will allow other hard links to exist, and behave
	normally. It will be expensive to delete, and Windows
	"rename to .BAK" cases may need performance tuning.

| The only reason this problem appears less frequently in a pure Microsoft is
| that the short file name is an attribute of the file.  In fact, it seems
| that the short file name is the true name of the file, and the long file
| name is the attribute.
| One user that I know of, managed to create two directories with the name
| "Delete me test" on an NT share.  The 8.3 filenames were unique, but the
| long file names were identical, including case!  The only way to delete the
| directory was from a DOS cmd window using the 8.3 short name.

David Collier-Brown in Boston
Phone: (781) 442-0734, Room BUR03-3632

More information about the samba-technical mailing list