Windows -> Unix file conversion problem

Glaanieboy

OSNN Veteran Addict
Joined
6 Mar 2002
Messages
2,628
I run Samba on my FreeBSD to enable Windows to browse the network shares on my FreeBSD box. But suddenly Samba or Windows freaked out, when mapping more than one network share to driveletters, Windows XP says:
Multiple connections to a server or shared resource by the same user, using more
than one user name, are not allowed. Disconnect all previous connections to the
server or shared resource and try again..
While just 30 mins ago I had 5 network shares all under the same username running with no problem at all.
Also, when I open up a textfile from a share in Windows, all line-breaks are converted into little white squares. When I open them up in tsWebeditor, it's going nuts and showing only garbage. The other way around, when opening a file made and saved in a Windows app in FreeBSD, I see an extra W before each line break. I have never had this problem, in fact, I even transferred my entire website from Windows to Linux just two weeks ago with no problems at all.

I must say, after some thinking while I am typing, I haven't tested it much since I installed Samba3 (samba-devel in ports) on the BSD box. I know for sure it worked perfectly under at least Samba2.

Of course I did a testparm smb.conf to test it, here's the output:
# Global parameters
[global]
workgroup = THUISNET.LAN
server string = Samba Server 192.168.0.4
interfaces = 192.168.0.4/24
smb passwd file = /etc/smbpasswd
log file = /var/log/log.%m
max log size = 50
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
load printers = No
os level = 33
preferred master = Yes
dns proxy = No
hosts allow = 192.168.0., 127.

[printers]
comment = All Printers
path = /var/spool/samba
printable = Yes
browseable = No

[glenn_home]
comment = Glenn's Homedir
path = /usr/home/glenn
valid users = glenn
read only = No

[yara_home]
comment = Yara Home
path = /home/yara
valid users = glenn, yara
read only = No

[website]
comment = Root website
path = /usr/local/www/data-dist
valid users = glenn
read only = No

[music]
comment = Music
path = /usr/local/music
valid users = glenn
read only = No

[downloads]
comment = Downloads
path = /usr/local/downloads
valid users = glenn
read only = No

[pizza]
comment = Pizza Website
path = /usr/home/stelvio
valid users = glenn, stelvio
read only = No

Please help me. I'll do some testing myself too.
 
(btw I used the smb.conf file from Samba2 with Samba3. Have I missed an option?)
 
It is the line breaks Glaanie, UNIX only takes \n, most FTP clients remove the \r automatically, but windows over SAMBA that does not happen.

What you need to do is open the UNIX file in Wordpad and all will be just fine, or open it in a program that supports UNIX line terminations.

If you transfer a text file over SAMBA to your FreeBSD box and need to work on it, open it in pico, then close the file again saving it, the extra \r's will be gone, and you can now use it without a problem.
 
About your first problem, that is a problem with Windows, it will not let you "mount" shares unless they all use the same username, which IMHO is a stupid limitation, but only a reboot will fix that. Just set them to be persistent and have them reconnect upon bootup, you won't have a problem.
 
But that's annoying! I have to transfer my entire website with lots and lots of text files, I don't wanna open them seperately in Pico... Why did it work last time? Does Samba2 work differently than Samba3 when it comes to converting line breaks? And shouldn't Samba take care of this? From what I understand Samba is meant as an invisible (to the user) networkshare-shell around Linux, so users shouldn't be bothered with difficult file conversions.
Maybe I should install Samba2 again then <_<
 
OK, I f*cked up. I uninstalled Samba-devel, so I could install samba2. But now it isn't working at all. When I browse to my server, it's asking for a password. Damn. Back to square one...
 
Samba two does not do this either.

Apache does not care about what line break you use. That is why it will work flawlessly, however, unix programs will.

Your thinking of SAMBA is a wrong one, it is supposed to let people using Windows utilize resources (HD space) on a Linux server without a problem, it is not there to remove or edit files as they are passed on to the server.
 
But if I want to be able to do both, editing files on Windows and Linux, without doing stupid conversions. Maybe a setting in Samba?
 
There is no setting in samba. To do that you need to choose either a text editor on both that can handle both, or choose a text editor on Windows that only does \n.
 
Glaanieboy said:
But if I want to be able to do both, editing files on Windows and Linux, without doing stupid conversions. Maybe a setting in Samba?

If they made a setting to strip out all the \r's in all documents, that could screw up everything majorly, word documents and whatnot would go screwy.

It just can not be done.
 
X is right, you need to use Wordpad to edit the file, I've editted files directly on my BSD server in windows via samba without problems this way. BTW, samba-devel has been moved to samba3 port since its deemed stable.
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back