Bug 3522 - CreateDirectory of a path name that exists on a Samba server (as a simple file) fails with wrong code/message.
Summary: CreateDirectory of a path name that exists on a Samba server (as a simple fil...
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: File Services (show other bugs)
Version: 3.0.21b
Hardware: Sparc Solaris
: P3 major
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-17 17:56 UTC by Sandeep Tamhankar
Modified: 2006-02-17 20:00 UTC (History)
0 users

See Also:


Attachments
Program (source) that creates a directory and reports error code (1.92 KB, text/plain)
2006-02-17 17:58 UTC, Sandeep Tamhankar
no flags Details
Compiled binary of sambatest.cpp (168.00 KB, application/octet-stream)
2006-02-17 18:02 UTC, Sandeep Tamhankar
no flags Details
Patch I've applied. (490 bytes, patch)
2006-02-17 20:00 UTC, Jeremy Allison
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sandeep Tamhankar 2006-02-17 17:56:36 UTC
CreateDirectory of a path name that exists on a Samba server (as a simple file) fails with the wrong code.

Steps to reproduce:
1. From a Windows machine, map a network drive to a Solaris Samba share.
2. Create a file "foo" on the share.
3. In a cmd window, do a 'md foo' when cwd is the directory containing the 'foo' file created earlier.

Expected result:
A subdirectory or file foo already exists.

Actual result:
The directory name is invalid.

I wrote a c++ program that just does the CreateDirectory and reports the error code from GetLastError.  The correct code is 183 (ERROR_ALREADY_EXISTS).  The code I got on 3.0.21b is 267.

I tested against a 3.0.10 Solaris Samba installation, and that correctly returned 183 as well.  I also tested against a Windows file server, just to be sure that 183 is the correct response, and that worked correctly as well.
Comment 1 Sandeep Tamhankar 2006-02-17 17:58:21 UTC
Created attachment 1737 [details]
Program (source) that creates a directory and reports error code
Comment 2 Sandeep Tamhankar 2006-02-17 18:02:13 UTC
Created attachment 1738 [details]
Compiled binary of sambatest.cpp
Comment 3 Jeremy Allison 2006-02-17 20:00:32 UTC
Created attachment 1739 [details]
Patch I've applied.
Comment 4 Jeremy Allison 2006-02-17 20:00:57 UTC
This fixes the problem for me. It'll be in 3.0.21c. Thanks,
Jeremy.