Subject: [netatalk-admins] Can't stop CR/LF translation...

From: David Welton <[email-masked]>
Date: Tue, 24 Mar 1998 10:12:26 -0800

Hi, I seem to be encountering a problem with the end of line character
translation.

I first noticed this when I used the server I have set up to transfer
some gif's from my boss.  He created them on his windoze box, then
placed them in a shared directory hosted by a Mac appletalk server.
>From there I moved them to my own netatalk server, clicking and
dragging with a mac...  At this point I went to open an image, and, lo
and behold, corruption!

I spent some time digging around in various docs, and examining the
files with vi, and noticed that it is translating ^M's into \n's.
This does not make the gifs look very pretty:->  So I went to change
AppleVolumes.system in /etc/netatalk, and I restarted the server
(first I tried hupping it twice, to no effect), after having edited it
to the following:

.         BINA    UNIX
# .       TEXT    UNIX      

....
.gif   GIFf    JVWR  

It is still doing the translation.. is there something I am missing?
I would rather it did no translation than having it do it badly and
screw things up.

Thanks for your time,
-- 
David Welton                          http://www.efn.org/~davidw 

	Debian GNU/Linux - www.debian.org

---

From: [email-masked]
Date: Wed, 25 Mar 98 19:01:37 PST

Original message sent on Wed, Mar 25  5:58 PM by [email-masked] (David
Welton) :

> Actually, I went one better (I hope it's seen that way at least!) and
> hacked a new command line option into afpd so that you can turn off
> CR/LF translation by starting it with '-e'.  I did this by adding a
> variable in afp_options.  I hope this was the right place to put it.
>
> Everything seems to work great now :-)
>
> Anyway, I have attached my diffs for review.

Looks solid to me, the most important thing would be to make sure you got all
the "#ifdef CRLF"s out of there, and it looks like you did.

If you're interested, I did something similar to the code, but my approach was
to add an option to the AppleVolumes file so that translation can be selected
volume-by-volume.  This required a lot more changes, because afpd has to
translate in the "copyfile" function where it never had to before, but I've been
using it for several weeks with no problems.  You would have to merge the
changes manually because it's based on 1.4b2 (without asun's patches) plus it
changes some of the same places you've already changed.  But since you seem to
be comfortable messing about in the code, if you want to take a look I'll be
happy to e-mail it (it's too long to post to the group).  Any other netatalk
hackers out there are also welcome to it, just drop me a request!

Bob Smith
Hammett & Edison, Inc.
[email-masked]