[#5931] MKDIR Regression with newer SAMBA versions
Summary MKDIR Regression with newer SAMBA versions
Queue Gollem
Queue Version 1.0.3
Type Bug
State Resolved
Priority 1. Low
Owners chuck (at) horde (dot) org
Requester felix.leimbach (at) gmx (dot) net
Created 2007-11-27 (4166 days ago)
Updated 2007-11-30 (4163 days ago)
Assigned 2007-11-27 (4166 days ago)
Resolved 2007-11-30 (4163 days ago)
Patch No

2007-11-30 20:42:30 Chuck Hagenbuch Comment #10
Assigned to Chuck Hagenbuch
State ⇒ Resolved
Reply to this comment
Committed an equivalent patch to HEAD (will be in the next Horde 3.2 RC):


2007-11-30 19:41:44 Chuck Hagenbuch Deleted Original Message
2007-11-30 07:56:20 felix (dot) leimbach (at) gmx (dot) net Comment #9
New Attachment: gollem-smb.patch Download
Reply to this comment
Attached an updated patch which superseedes the old one. Improvements:

* also fixes file deletion and recursive folder deletion

* doesn't use rexexps any more

The patch passed the following tests on both samba-3.0.24 and 3.0.27a:

* create root level folders

* create subfolders

* create files in subfolders

* delete files in subfolders

* delete folder with subfolders and files in those subfolders

While I'm using it in production now I recommend you give it a bit of 
testing with other samba versions and environments as I cannot do that.
2007-11-29 22:11:32 Chuck Hagenbuch Comment #8 Reply to this comment
Since the change works in both versions I don't see a real reason not 
to apply it (though I'd fix the patch to not use a regexp when it 
really doesn't need it). I'll commit in a day or so if there's no 
negative feedback.

Is this perhaps the same issue with deleting? Any progress there?
2007-11-29 19:39:55 felix (dot) leimbach (at) gmx (dot) net Comment #7 Reply to this comment
topic is tracked back to the erroneous samba commit and now waits for 
developer feedback.

Even if it gets fixed soon I propose you put a warning about the 
incompatibility in gollem's readme with a link to this ticket. Distros 
will carry the affected samba versions for some time and people will 
stumble over the issue.
2007-11-28 08:51:48 felix (dot) leimbach (at) gmx (dot) net Comment #6 Reply to this comment
2007-11-27 14:07:16 felix (dot) leimbach (at) gmx (dot) net Comment #5
New Attachment: gollem-smb-foldercreation.patch
Reply to this comment
2007-11-27 14:05:06 felix (dot) leimbach (at) gmx (dot) net Comment #4 Reply to this comment
I will bring up the issue on the samba mailing list and see what the 
devs intended. I remember reading something about an intended small 
smbclient syntax change a while ago but can't find it anymore.

Attached a workaround for the folder-creation problem. When patched, 
gollem properly creates folders with new AND old samba versions, so no 
harm in applying that one.

Also I found out that there are more operations which don't work after 
the samba upgrade. Deleting files f.ex. yields this error:

Cannot delete "test.txt": "/temp/test.txt" is not a directory.

Don't have time for further investigation and patching now, but might 
return to it later.
2007-11-27 11:33:16 Jan Schneider Comment #3
State ⇒ Feedback
Reply to this comment
Honestly, this is really a bug in samba and I tend to not workaround 
that. It should be fixed in smbclient.
2007-11-27 10:55:14 felix (dot) leimbach (at) gmx (dot) net Comment #2 Reply to this comment
Further debugging yields:

The critical statement sent by _command() in lib/VFS/smb.php:

/usr/bin/smbclient "//" "-p139" "-Uusername" -D 
"/temp" -I -c "mkdir \"subdir1\";"

When fired from the command line this statement does what expected in 
samba-3.0.24 and misbehaves as described in the bugreport with 
samba-3.0.25c and higher.


Appending a backslash in the -D argument solves the problem FOR BOTH 

/usr/bin/smbclient "//" "-p139" "-Uusername" -D 
"/temp/" -I -c "mkdir \"subdir1\";"

Will create a patch to smb.php soon.
2007-11-27 10:42:50 felix (dot) leimbach (at) gmx (dot) net Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Summary ⇒ MKDIR Regression with newer SAMBA versions
Queue ⇒ Gollem
Reply to this comment
Regression with gollem's SMB backend between SAMBA-3.0.24 and 3.0.25c.

Problem with 3.0.25c and newer:

* Creating a folder "folder2" in ROOT/folder1 results in 
ROOT/folder1folder2 being created

* Creating a folder "folder3" in ROOT/folder1/folder2 results in 
ROOT/folder1/folder2folder3 being created

3.0.24 and lower work as expected.

Horde Framework: 3.1.4

The $dir and $mkdir variables in lib/VFS/smb.php's createFolder() are 
the same, regardless of the samba version:

Trying to create ROOT/temp/subdir1: $dir=/temp $mkdir=subdir1

Saved Queries