Bug 919405

Summary: Samba4 impossible to read/copy if accessing from Android devices
Product: [Fedora] Fedora Reporter: Salvatore La Bua <slabua>
Component: sambaAssignee: Guenther Deschner <gdeschner>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: abokovoy, asn, gdeschner, jlayton, mike_parlett, sbose, ssorce
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-25 22:53:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
smb.conf
none
tcpdump between the two machines
none
log.smbd
none
log.jcifs
none
log.192.168.1.100 none

Description Salvatore La Bua 2013-03-08 11:38:02 UTC
It appears that in Samba4 is impossible to read (as in open) and copy shared files if accessing from an Android device. The shared folders are perfectly visible and accessible from the android device, it is possible to copy files from the device to a shared folder and also rename shared files, but it is not possible to copy files from a shared folder to the android device or even open shared files from their own location.
The same setup was working correctly with the previous version of samba (tested in F16, with same samba server, selinux and firewall configuration).

Steps to Reproduce:
1. Set up a fresh samba server;
2. Put some files in the shared folder (a jpg image and/or a text file would do);
3. Access the server through an Android file explorer with samba capabilities, such as ES File Explorer;
4. Copy a file from the Android device to the shared folder;
5. Copy or open the newly copied file in step 4.;
6. Copy or open a file from the shared folder to the Android device;
  
Actual results:
Action performed at step 4. will succeed;
Action performed at step 5. will fail;
Action performed at step 6. will fail, images and files preview on the Android file explorer also show up as an error icon /!\ to indicate that files can't be read from the shared folders;

Expected results:
Steps 4., 5. and 6. should always succeed.

Additional info:
I tried with different phones and Android versions, such as 2.3.7 and 4.2.2.

Comment 1 Alexander Bokovoy 2013-03-08 14:21:36 UTC
Could you please share:

1. smb.conf
2. debug log of level 10 (log level = 10) when performing steps that lead to a problem.

Specifically, we want to see what client-server exchange between each other in such case.

Comment 2 Andreas Schneider 2013-03-08 14:29:54 UTC
Thanks for taking the time to report an issue.

Every major SMB/CIFS client is correctly working with Samba 4.0. We don't know about any issues in this area. 

I would say it is a bug in the jCIFS client used by ES File Explorer.

However you could try to set:

max protocol = LANMAN1

in your smb.conf.

Comment 3 Salvatore La Bua 2013-03-08 15:20:26 UTC
(In reply to comment #1)
> 1. smb.conf

http://pastebin.com/3HmpSRXw

> 2. debug log of level 10 (log level = 10) when performing steps that lead to
> a problem.
> 
> Specifically, we want to see what client-server exchange between each other
> in such case.

I'm not sure what exactly I should grep from the logs, or should I report all of them? I got log files for smbd, the phone ip and jcifs0_1_d0.

(In reply to comment #2)
> I would say it is a bug in the jCIFS client used by ES File Explorer.

It was working, though, with a previous version of samba. Meanwhile, I'll check other clients and see if they work fine.

> However you could try to set:
> 
> max protocol = LANMAN1
> 
> in your smb.conf.

If I use the line above I can't access to the server in any way, neither from a windows machine.

Comment 4 MikeP 2013-03-10 17:46:09 UTC
Hi

I can confirm this problem.

reading a file from Sammaba 4.0.3-2 (FC18 x64) with Android ICS ES File explorer

Browse share OK
Delete file on share Ok
Copy File Share to Same Share FAIL
Read file on Share FAIL
Copy file to Share OK

I have tried this from homes share
Addin a Samba share for my home and explitily mapping it

No clues found yet.. Sorry

Mike

Comment 5 Salvatore La Bua 2013-03-10 19:34:07 UTC
(In reply to comment #4)
> Hi
> 
> I can confirm this problem.
[...]
> Mike

Thank you Mike.
I also tried different android samba clients, such as AndSMB and Solid Explorer, and I get the same unsuccessful result.

-- 
Salvatore

Comment 6 Andreas Schneider 2013-03-11 11:06:14 UTC
We need log files, config file and a network trace.

Please read https://www.samba.org/~asn/reporting_samba_bugs.txt

Comment 7 Salvatore La Bua 2013-03-11 12:45:31 UTC
Created attachment 708351 [details]
smb.conf

Comment 8 Salvatore La Bua 2013-03-11 12:46:37 UTC
Created attachment 708352 [details]
tcpdump between the two machines

Comment 9 Salvatore La Bua 2013-03-11 12:47:17 UTC
Created attachment 708353 [details]
log.smbd

Comment 10 Salvatore La Bua 2013-03-11 12:48:13 UTC
Created attachment 708354 [details]
log.jcifs

Comment 11 Salvatore La Bua 2013-03-11 12:48:47 UTC
Created attachment 708355 [details]
log.192.168.1.100

Comment 12 Salvatore La Bua 2013-03-11 12:50:55 UTC
(In reply to comment #6)
> We need log files, config file and a network trace.
> 
> Please read https://www.samba.org/~asn/reporting_samba_bugs.txt

All the requested log files are attached.

Comment 13 Alexander Bokovoy 2013-03-11 13:03:15 UTC
Cloudshark version of the tcpdump:
http://www.cloudshark.org/captures/a9497b4e1d92

Comment 14 Andreas Schneider 2013-03-11 21:06:28 UTC
See also https://bugzilla.samba.org/show_bug.cgi?id=9706

Comment 15 Andreas Schneider 2013-03-11 21:10:40 UTC
A bug for jCIFS should be reported too.

Comment 16 Fedora Update System 2013-03-22 10:11:06 UTC
samba-4.0.4-3.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/samba-4.0.4-3.fc18

Comment 17 Fedora Update System 2013-03-22 21:10:50 UTC
Package samba-4.0.4-3.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing samba-4.0.4-3.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-4247/samba-4.0.4-3.fc18
then log in and leave karma (feedback).

Comment 18 Fedora Update System 2013-03-25 22:53:31 UTC
samba-4.0.4-3.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 19 MikeP 2013-03-26 06:14:28 UTC
Loaded testing version

it would all appear to work as expected

well done all and thank you


mike

Comment 20 Andreas Schneider 2013-03-26 14:03:04 UTC
MikeP: If you have time please report a bug to jCIFS or the Android app using jCIFS. They have a bug in what they send to the server. We just handle the wrong flags they send more gracefully.

The details can be found in this thread:

https://lists.samba.org/archive/samba-technical/2013-March/090922.html