libsmbclient problems

Mikael Albertsson mikal668 at student.liu.se
Sun Nov 10 20:44:07 GMT 2002


Hello.

I'm having some weird problems trying to use libsmbclient in an application I'm creating.

The thing is that I use smbc_read to read a file from another computer, however, sometimes I get kicked and smbc_read ends prematurely with less read than I requested. I thought "ok, I'lll just close it and try to reopen", but if I try to use smbc_close on the fd, everything comes crashing down in the blink of an eye.

Another weird thing is that most times errno is set to 104 (connection reset by peer) after smbc_read ends like this, but sometimes errno is 0 (Success) after such a premature end...this baffles me, but I can work around it.

If I skip trying to close the file from the remote computer after this happens I can go on to open other files on other computers, but if I ever try to open another file from the computer that kicked me (in the same session with my app), my app crashes.

By crash I don't mean that it segfaults, it just ends...no error or anything (if I execute my app in the background, the shell just says "Broken pipe"). I definately know that the app dies inside the call to smbc_close or smbc_read (whichever I try to use I was kicked).

Is there any way around this problem?

Apart from this problem I would like to thank for a really good software package. Keep up the good work! =)

Ps. I'm using samba Version 2.999+3.0.alpha20-3 for Debian. Ds.

Sincerely
Mikael Albertsson



More information about the samba-technical mailing list