38leinad / tango Goto Github PK
View Code? Open in Web Editor NEWSMB/CIFS Filesharing Client (Windows Filesharing/SAMBA) for iOS
Home Page: http://38leinad.wordpress.com/
License: Other
SMB/CIFS Filesharing Client (Windows Filesharing/SAMBA) for iOS
Home Page: http://38leinad.wordpress.com/
License: Other
Tango -------- A very simple SMB/CIFS filesharing client for Apple's iOS platform. It is the filesharing protocol of Microsoft Windows in the version called LAN Manager 0.12; which is supported and tested by/with Windows XP. It is not nearly complete and at the moment it only has the following features: * Connect to a password-protected network share * Password enryption (only weak LM2 challenge/response) * Browse directory contents * Reading and writing files The library comes with a simple iPhone app to test the library.
I fixed half of it by using unicode instead of ASCII and setting the flag to unicode in _tango_TRANS2_FIND_FIRST2 and now the request goes through without error when watching it on the sniffer. However since the response is unicode I need to modify the response parsing.
Please help..
what can i set in share, username & password field.
means my server ftp details or my pc ip address & pc login password.
Please suggest...
can't connect to Win7/WinSvr2008R2 share drive
No milestone No one is assigned
I've tried connecting share drive on Windows 7 or Windows Server 2008 R2 and failed with the error message "Error. Unable to login" on the iphone.
the console log:
2011-08-06 16:59:24.623 tango[1673:207] APPLICATION STARTED
2011-08-06 17:00:08.036 tango[1673:207] tango connecting
_tango_send(): Bytes to send (including nbt-header!): 51
_tango_send(): Sent 51 bytes.
_tango_send_and_receive(): Received 4 bytes.
_tango_send_and_receive(): Received 117 bytes.
_tango_NEGOTIATE_PROTOCOL(): Received response
_tango_NEGOTIATE_PROTOCOL(): Server Capabilities 0x1e3fc
_tango_NEGOTIATE_PROTOCOL(): - CAP_LARGE_READX
_tango_send(): Bytes to send (including nbt-header!): 106
_tango_send(): Sent 106 bytes.
_tango_send_and_receive(): Received 4 bytes.
_tango_send_and_receive(): Received 35 bytes.
_tango_SESSION_SETUP(): Received response
_tango_evaluate_response_header(): NT_STATUS Level is 0003 with value 006d.
Thanks
Ben
2 participants
38leinaD commented 2 years ago
Hi Ben,
Thanks. Will try to get a Windows 7 VM and have a look at the issue. As suspected, it has to do with the authentication-method supported with Win7.
I will have to add the NTLM2 authentication method (http://ubiqx.org/cifs/SMB.html 2.8.5 NTLM Version 2)
Cheers,
Daniel
Dear sir,
I have the same problem as #5, I deeply hope the NTLM2 authentication method, Can you help me?
Thanks a lot!
Hi.tan
device: iPad2: iOS 5.0.1
desktop: Macbook Pro: Mac OS X 10.7.2
I tried to download and run your sample app on iOS 5 and it wouldn't display properly. However, I put your library and obj c wrapper classes into a test project and I kept getting this error and output:
2011-12-11 14:10:48.888 TEST_Tango[4243:707] pressed
_tango_send(): Bytes to send (including nbt-header!): 51
_tango_send(): Sent 51 bytes.
_tango_send_and_receive(): Timeout during recv(): No such file or directory
I do have file sharing enabled on my desktop. For the share input field I have tried:
[host name].local[share folder]
[host name].home[share folder]
[host name].local
[host name].home\
I am not sure if this is something I am doing wrong, but it never seems to retrieve any fileInfo on the first try using listDirectory. I end up having to insert it in a while loop and keep calling that function until something is retrieved. But even then there's often many files missing, others don't have any names.
Whats wrong with that?
Hi,
I wonder, if anybody can help me on this issue: Connecting to a file share on Windows XP works alright, but a SAMBA share fails. Password encryption on the samba server is switched on. The server log states invalid credentials.
Thanks for any help in advance!
Here is a trace:
_tango_NEGOTIATE_PROTOCOL(): Sending NEGOTIATE_PROTOCOL request: ----------------------------------------------------------------------------- @PROTOCOL = 0xffSMB @COMMAND = 0x72 @STATUS = 0x00000000 @FLAGS = 0x08 @FLAGS2 = 0x4041 @EXTRA = 00000000 | 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 | ........ 00000008 | 0x00 0x00 0x00 0x00 | .... @TID = 0x0000 @PID = 0x1234 @UID = 0x0000 @MID = 0x0000 @PARAMETERS = Zero Bytes @DATA = 00000000 | 0x02 0x4e 0x54 0x20 0x4c 0x4d 0x20 0x30 | .NT LM 0 00000008 | 0x2e 0x31 0x32 0x00 | .12. ----------------------------------------------------------------------------- _tango_send(): Bytes to send (including nbt-header!): 51 _tango_send(): Sent 51 bytes. _tango_send_and_receive(): Received 4 bytes. _tango_send_and_receive(): Received 97 bytes. _tango_NEGOTIATE_PROTOCOL(): Received response _tango_NEGOTIATE_PROTOCOL(): Received response for NEGOTIATE_PROTOCOL_REQUEST: ----------------------------------------------------------------------------- @PROTOCOL = 0xffSMB @COMMAND = 0x72 @STATUS = 0x00000000 @FLAGS = 0x88 @FLAGS2 = 0x4001 @EXTRA = 00000000 | 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 | ........ 00000008 | 0x00 0x00 0x00 0x00 | .... @TID = 0x0000 @PID = 0x1234 @UID = 0x0000 @MID = 0x0000 @PARAMETERS = @DialectIndex = 0x0000 @SecurityMode = 0x03 @MaxMpxCount = 0x0032 @MaxNumberVCs = 0x0001 @MaxBufferSize = 0x00004104 @MaxRawSize = 0x00010000 @SessionKey = 0x00007886 @Capabilities = 0x0080f3fd @SystemTimeLow = 0x32d86f80 @SystemTimeHigh = 0x01cdc679 @ServerTimeZone = 0xffc4 @EncryptionKeyLength = 0x08 @DATA = 00000000 | 0x73 0xfb 0xdc 0x5d 0x84 0xf6 0xfa 0x24 | s..]...$ ----------------------------------------------------------------------------- _tango_NEGOTIATE_PROTOCOL(): Server Capabilities 0x80f3fd _tango_NEGOTIATE_PROTOCOL(): - CAP_LARGE_READX _tango_SESSION_SETUP(): LM-Challenge is: 00000000 | 0x73 0xfb 0xdc 0x5d 0x84 0xf6 0xfa 0x24 | s..]...$ _tango_SESSION_SETUP(): LM-Response is: 00000000 | 0xae 0xd0 0x04 0x82 0xaa 0x16 0xf4 0xbd | ........ 00000008 | 0x1e 0x5e 0x2b 0xc8 0xca 0x02 0xdc 0xb9 | .^+..... 00000016 | 0x12 0x63 0x51 0xc3 0xca 0xac 0xb8 0x6c | .cQ....l _tango_SESSION_SETUP(): Sending SESSION SETUP request: ----------------------------------------------------------------------------- @PROTOCOL = 0xffSMB @COMMAND = 0x73 @STATUS = 0x00000000 @FLAGS = 0x08 @FLAGS2 = 0x4041 @EXTRA = 00000000 | 0x00 0x00 0x00 0x00 0xa6 0xdc 0x9a 0x00 | ........ 00000008 | 0xff 0x92 0x7e 0x01 | ..~. @TID = 0x0000 @PID = 0x1234 @UID = 0x0000 @MID = 0x0000 @PARAMETERS = 00000000 | 0xff 0x20 0x00 0x00 0xff 0xff 0x02 0x00 | . ...... 00000008 | 0x14 0x05 0x86 0x78 0x00 0x00 0x18 0x00 | ...x.... 00000016 | 0x00 0x00 0x00 0x00 0x00 0x00 0x41 0x00 | ......A. 00000024 | 0x00 0x80 | .. @DATA = 00000000 | 0xae 0xd0 0x04 0x82 0xaa 0x16 0xf4 0xbd | ........ 00000008 | 0x1e 0x5e 0x2b 0xc8 0xca 0x02 0xdc 0xb9 | .^+..... 00000016 | 0x12 0x63 0x51 0xc3 0xca 0xac 0xb8 0x6c | .cQ....l 00000024 | 0x65 0x65 0x65 0x65 0x65 0x65 0x65 0x65 | eeeeeeee 00000032 | 0x65 0x00 0x3f 0x00 0x69 0x4f 0x53 0x00 | e.?.iOS. 00000040 | 0x74 0x61 0x6e 0x67 0x6f 0x00 | tango. ----------------------------------------------------------------------------- _tango_send(): Bytes to send (including nbt-header!): 111 _tango_send(): Sent 111 bytes. _tango_send_and_receive(): Received 4 bytes. _tango_send_and_receive(): Received 35 bytes. _tango_SESSION_SETUP(): Received response _tango_evaluate_response_header(): NT_STATUS Level is 0003 with value 006d. ---------------- LOGIN FAILED --------------------- @PROTOCOL = 0xffSMB @COMMAND = 0x73 @STATUS = 0xc000006d @FLAGS = 0x88 @FLAGS2 = 0x4001 @EXTRA = 00000000 | 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 | ........ 00000008 | 0x00 0x00 0x00 0x00 | .... @TID = 0x0000 @PID = 0x1234 @UID = 0x0000 @MID = 0x0000 @PARAMETERS = Zero Bytes @DATA = Zero Bytes
2012-07-11 19:08:18.847 tango[2775:f803] pressed
_tango_send(): Bytes to send (including nbt-header!): 51
_tango_send(): Sent 51 bytes.
_tango_send_and_receive(): Received 4 bytes.
_tango_send_and_receive(): Received 125 bytes.
_tango_NEGOTIATE_PROTOCOL(): Received response
_tango_NEGOTIATE_PROTOCOL(): Server Capabilities 0xe3fd
_tango_NEGOTIATE_PROTOCOL(): - CAP_LARGE_READX
_tango_send(): Bytes to send (including nbt-header!): 123
_tango_send(): Sent 123 bytes.
_tango_send_and_receive(): Received 4 bytes.
_tango_send_and_receive(): Received 35 bytes.
_tango_SESSION_SETUP(): Received response
_tango_evaluate_response_header(): NT_STATUS Level is 0003 with value 006d.
I am getting error when I am trying to get shared folder of windows XP with iphone app.
Please help.
inside _tango_TRANS2_FIND_FIRST2, if the response is rather large, the server returns only part of the data.
so the check:
if (resp_total_data_count != resp_data_count) {
will fail, since (resp_total_data_count > resp_data_count)
any suggestions on how to fix?
When i am trying to connect i am getting below error as below
tango_connect(): Failed to connect(); Operation timed out.
2012-11-10 13:04:37.714 tango[2106:907] pressed
please help!!
Hi I hit this weird error on my linux server(using samba service of course) that I can access some directories under the same directory while others gave me the error message, "_tango_evaluate_response_header(): NT_STATUS Level is 0003 with value 000d." Can you take a look ? Thanks!
_tango_send(): Bytes to send (including nbt-header!): 95
_tango_send(): Sent 95 bytes.
_tango_send_and_receive(): Received 4 bytes.
_tango_send_and_receive(): Received 35 bytes.
_tango_TRANS2_FIND_FIRST2(): Received response
_tango_evaluate_response_header(): NT_STATUS Level is 0003 with value 000d.
How can I upload a image file ?
There is only a example for upload a simple small text content to a file.
Is there a way to browse all the available shares on a server ?
Thanks
Marco
Suggested fix:
else {
// Format: \hostname\share
slash_ptr = strchr(share + 2, '');
strcpy(tango_connection_ptr->share, slash_ptr+1);
}
using inet_pton doesn't seem to be the right approach in tango_connect.
Instead of:
int sin_addr_set = inet_pton(AF_INET, hostname, &(sock_addr.sin_addr));
The following could be used:
static struct in_addr addressForHost(const char* hn)
{
struct hostent *hostinfo;
struct in_addr inaddr;
inaddr.s_addr = inet_addr(hn);
if(INADDR_NONE == inaddr.s_addr) {
hostinfo = gethostbyname(hn);
if(NULL == hostinfo) {
inaddr.s_addr = INADDR_NONE;
return inaddr;
}
inaddr.s_addr = *((in_addr_t *)hostinfo->h_addr_list[0]);
}
return inaddr;
}
sock_addr.sin_addr = addressForHost(hostname);
int sin_addr_set = sock_addr.sin_addr.s_addr != INADDR_NONE;
I am a beginner IOS. I am making a SMB client to connect SMB sever. I used tango (https://github.com/38leinaD/tango). If I used Mac : Go -> connect to server.. -> smb://192.168.1.8 . connect normally! but if I use tangoLogin, in Share 's editText: address is "\192.168.1.8\Movies ", Tango Testapp will notice :" Unble to login" ( i filled user and password exactly ). i don't understand.
I've tried connecting share drive on Windows 7 or Windows Server 2008 R2 and failed with the error message "Error. Unable to login" on the iphone.
the console log:
2011-08-06 16:59:24.623 tango[1673:207] APPLICATION STARTED
2011-08-06 17:00:08.036 tango[1673:207] tango connecting
_tango_send(): Bytes to send (including nbt-header!): 51
_tango_send(): Sent 51 bytes.
_tango_send_and_receive(): Received 4 bytes.
_tango_send_and_receive(): Received 117 bytes.
_tango_NEGOTIATE_PROTOCOL(): Received response
_tango_NEGOTIATE_PROTOCOL(): Server Capabilities 0x1e3fc
_tango_NEGOTIATE_PROTOCOL(): - CAP_LARGE_READX
_tango_send(): Bytes to send (including nbt-header!): 106
_tango_send(): Sent 106 bytes.
_tango_send_and_receive(): Received 4 bytes.
_tango_send_and_receive(): Received 35 bytes.
_tango_SESSION_SETUP(): Received response
_tango_evaluate_response_header(): NT_STATUS Level is 0003 with value 006d.
Thanks
Ben
Hi Daniel,
I'm very interested and curious with your lib. Thank you for the lib.
The issue I'm facing is I cannot log into a XP machine. I got the same error code as the issue #5. . It looks like the lib supported XP already but I don't know why it doesn't work for me. I tested the lib with an iPhone emulator.
Do you have any idea to solve this problem?
Thanks again for the good lib.
ntquy99
Great work on this. I've run into a bit of a problem that I think some of the other posts have touched upon. Sometimes when connecting or accessing a folder, I'll run into the "_tango_evaluate_response_header(): NT_STATUS Level is 0003 with value 000d." error and the tangoFSFolderViewController will load with 0 rows. If I hit the "Back" button and try to navigate to another folder or the SAME folder, sometimes, the connection randomly goes through and the contents of a folder will show up correctly, but more often than not, a new tangoFSFolderViewController shows up with 0 rows. This leads me to believe there's some sort of latency or race issue going on. I notice that whenever the connection does not go through, smb_response's size variable always returns with a size of 35 and none of the "Connection problem" error handling messages of _tango_send or _tango_receive are hit. The call of _tango_TRANS2_FIND_FIRST2 bails out here:
/**
* 3. Evaluate Response
*/
if (!_tango_evaluate_response_header(connection, smb)) {
goto bailout;
}
Does the connection to SMBs work pretty consistently on XP? I haven't tried it out yet. Maybe OSX is the problem?I'm running this on OSX 10.6 (Snow Leopard) with Windows File Sharing enabled. Appreciate any tips you can throw my way. Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.