CR-LF Translation Proposal

Christopher R. Hertel crh at nts.umn.edu
Fri Mar 2 23:06:01 GMT 2001


> On Wed, Feb 14, 2001 at 12:32:07AM +0100, flyer wrote:
> > Hi,
> > 
> > I'm in the need to transfer text files from a Linux box to a Win 
> > workstation and consider the Samba inability to properly manage the 
> > CR-LF translation a severe problem, if not a bug.

Samba does properly manage CR-LF by *not* translating it.  There are a 
lot of tools that can convert between Unix termination (<LF>), Mac 
termination (<CR>) and MS termination (<CR><LF>) but *all* require some 
form of user intervention to get it right.

> > I red [sic] the FAQ about CR-LF translation (missing) support and I 
> > don't agree with the theory of not letting Samba translate CR-LF
> > sequences.

It is not theory, it is practice.

> > The default behaviour could be left unchanged but an useful support could
> > be given by adding a config option to allow translation for some file
> > extensions only.
> > The user itself could specify such extensions and in smb.conf could take

No, the user does not have access to smb.conf.  The system manager would 
have to establish any such policy, though the policy could be user based.

> > place an option like the following:
> > CR-LFtranslation = .txt  .doc  ...............

A .doc file is most often an MS Word document, and converting line 
termination would probably ruin it.  Regarding the .txt file, the system 
manger would need to establish a policy for each user *and* each machine, 
requiring that the client machine type be determined at connection time.
Ick.

The reason that this is not done is that there is no way to automatically 
determine both the OS of the machine reading the file and the termination 
in use in the source file.

Note, though, that the smbclient utility *can* translate termination. 
Once again, this is under USER CONTROL.  If you want to translate 
<CR><LF> to <LF> or the other way 'round, copy the file using smbclient.

Chris -)-----

-- 
Christopher R. Hertel -)-----                   University of Minnesota
crh at nts.umn.edu              Networking and Telecommunications Services

    Ideals are like stars; you will not succeed in touching them
    with your hands...you choose them as your guides, and following
    them you will reach your destiny.  --Carl Schultz





More information about the samba-technical mailing list