CRNL <-> NL automatic conversion

Thu Apr 16 15:28:18 GMT 1998

As I understood from a couple of posted messages, this problem regularly
pops up in the news. It also seems that Samba doesn't support this
feature. So, if I can spend enough time on it, I might consider
starting. My first question is, of course: has anyone written this
feature ? or even started or tried ?

Without much digging in the Samba code yet, I can already point out the
- conversion is a lot more complex than the codepage stuff,
  as the number of characters change;
- this has a very big impact if a client reads, writes,
  and seeks at random in a file;
- I'm thinking of two possible implementations,
  there are surely others:
	- either copy the whole converted file into some
	  temporary disk cache, and use that one for the
	  transactions with the client. (don't forget to
	  copy it back at close time if it has been updated);
	- or buffer blocks in memory. It has to be in shared
	  memory, with access control (semaphores), as
	  several smbd instances might access the same file
	  at the same time. Note that shared memory and
	  semaphores are not used the same way on all Unix

The system should be configurable:
- allow to specify a list of file-specs (a la 'hide files')
  for files to convert (forced ascii),
- the same for files not to convert (forced binary),
- for others: detect the file type from the first n bytes,
- conversion mode could be forced off for some clients
  (i.e. other Samba servers on Unix platforms), but then
  it gets really ugly if two clients access (read, write,
  seek) the same ascii file, one being a Win*-OS/2 client,
  the other being a Unix Samba server...

Has anyone any idea / suggestion / warning ?

Thanks in advance,

Sebastien Bauer
email: seb _ bauer, at, bigfoot, dot, com -
   please rebuild address before sending, thanks to spammers! :-(

PS: I'm taking two weeks off, so I won't be able to answer immediately.
If you post a reply to the comp.protocols.smb newsgroup, please also
send a copy either to me or to the samba mailing list - Thanks!

More information about the samba mailing list