Folder-watching is broken

Bug #743280 reported by Sebastian Hauser
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
samba
Fix Released
Medium
samba (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: samba

# lsb_release -rd
Description: Ubuntu 10.04.2 LTS
Release: 10.04

# apt-cache policy samba
samba:
  Installiert: 2:3.4.7~dfsg-1ubuntu3.5
  Kandidat: 2:3.4.7~dfsg-1ubuntu3.5

I have my music stored on a samba-share. I'm using foobar2000 wich monitors my music. Every time I change some files on my share I get errors in foobar2000.

I did some research and found the problem. This is the way you can reproduce and monitor it on my pc:
- Add a share to the foobar200 library
- Start Wireshark, and filter the view by "smb.nt.function == 4".
- Start Process Monitor, filter everything out except foobar2000.exe. Perhaps go to "Filter > Highlight" and exclude "Result" in "SUCCESS", "FAST IO DISALLOWED" and "NAME NOT FOUND", to see the interesting lines more easily.
- Rename one of the files in the monitored folder.

Now if it's broken:
- The status of the ML directory changes to "Error!".
- Message like "Folder watching failure: The specified server cannot perform the requested operation." is logged to the console.
- Process Monitor log contains "0xC00000C3" result code for the "NotifyChangeDirectory" call.
- Wireshark captured a "NT Trans Response, FID: 0x????, NT NOTIFY" with the change notification. It contains at least two parameters, like RENAMED_OLD_NAME and RENAMED_NEW_NAME, and the first has "File Name Len" not divisible by 4 and "Next Entry Offset" neither.
- There are no further "NT NOTIFY" responses because the connection is closed due to error by the Win7 client.

Here's how that part should be implemented:
http://msdn.microsoft.com/en-us/library/ee441569(v=prot.13).aspx
"Each entry in the list MUST be DWORD aligned (32-bit aligned), so NextEntryOffset MUST be a multiple of 4."

And according to samba this is a bug and it got fixed in one of their newer releases:
http://www.samba.org/samba/history/samba-3.5.6.html
"BUG 7662: Align change notify replies on 4-byte boundary"
http://www.samba.org/samba/history/samba-3.5.6.html

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Hi Sebastian, thanks so much for the amazing bug detective work!

I've marked the bug "Fix Released" since we have Samba 3.5.8 in 11.04 (beta right now).

I've also nominated the bug to be fixed in Lucid and Maverick since hopefully the patch is relatively small and non-invasive and so can be backported.

In the meantime, if there is a way to reproduce the bug without a windows machine, that would be very helpful in backporting the fix.

Changed in samba (Ubuntu):
status: New → Fix Released
Chuck Short (zulcss)
Changed in samba (Ubuntu Lucid):
importance: Undecided → Medium
status: New → Confirmed
Changed in samba (Ubuntu Maverick):
importance: Undecided → Medium
status: New → Confirmed
Changed in samba:
importance: Unknown → Medium
status: Unknown → Fix Released
no longer affects: samba (Ubuntu Lucid)
no longer affects: samba (Ubuntu Maverick)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.