libsmbclient and IP numbers

Richard Sharpe sharpe at ns.aus.com
Fri Nov 16 05:04:04 GMT 2001


Tom Jansen wrote:

> Hi,
> 
> 
>>>>>smbc_opendir("smb://<insert IP here>/); it fails! Is this not supported?
>>>>>
>>>>It works perfectly here 
>>>>
> This is not true. My wrong. read on please.
> 
> 
>>My guess is that the IP will work against a Samba box, but not against
>>NT.  Can you verify.  With NT, you need a name for the NetBIOS session
>>request.  smbd doesn't actually require this.
>>
> 
> Linux client: libsmbclient from HEAD
> Linux server: samba 2.2.2
> 
> I've tried the following with the program snippet attached:
> 
> Linux client vs. Windows 2000: 
> corona is the netbios name of the box with ip 130.89.226.223
> 
> o smbc_opendir(smb://130.89.226.223) returned: -1 errno: 0 strerror: Success


OK, now I understand this ... The code thinks that it is a workgroup, 
and tries to obtain the server list. It comes up with an empty list, so 
you get a wierd error message ...


> o smbc_opendir(smb://130.89.226.223/mp3) returned: 11024
>   All OK!
> o smbc_opendir(smb://corona) returned: 11024
>   All OK!
> o smbc_opendir(smb://corona/mp3) returned: 11024
>   All OK!
> 
> Linux client vs. Win98:
> sir-bedevere is the netbios name of the box with ip 130.89.226.223
> 
> o smbc_opendir(smb://130.89.226.216) returned: -1 errno: 0 strerror: Success


Same explanation as above.


> o smbc_opendir(smb://130.89.226.216/upload) returned: -1 errno: 2 strerror: No
> such    file or directory


Does the upload share exist? Hmmm, I can see that it does. Will have to 
test with Win98.


> o smbc_opendir(smb://sir-bedevere) returned: 11024
>   All OK!
> o smbc_opendir(smb://sir-bedevere/upload) returned: 11024
>   All OK!
> 
> Linux client vs Linux server:
> niihau is the netbios name of the box with ip 130.89.226.217
> 
> o smbc_opendir(smb://130.89.226.217) returned: -1 errno: 0 strerror: Success


Same explanation as above ...


> o smbc_opendir(smb://130.89.226.217/upload) returned: 11024
>   All OK!
> o smbc_opendir(smb://niihau/) returned: 11024
>   All OK!
> o smbc_opendir(smb://niihau/upload) returned: 11024
>   All OK!


-- 
Richard Sharpe, rsharpe at ns.aus.com, LPIC-1
www.samba.org, www.ethereal.com, SAMS Teach Yourself Samba
in 24 Hours, Special Edition, Using Samba





More information about the samba-technical mailing list