Bug 2564 - possible bug in smbc_opendir error codes
Summary: possible bug in smbc_opendir error codes
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: libsmbclient (show other bugs)
Version: 3.0.9
Hardware: x86 Linux
: P3 normal
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
Depends on:
Reported: 2005-04-01 10:27 UTC by Mike
Modified: 2005-08-24 10:23 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Mike 2005-04-01 10:27:35 UTC
There appears to be a bug in the error codes being returned by smbc_opendir.

The case is as follows:

I am attempting to open a file using the smbc_opendir function using a user with
no access rights to the file (Obviously I am expecting the call to fail since a)
I am trying to open a file and b) the user has no rights.)

opendir fails with ENOENT rather than the expected ENOTDIR or EACCESS

I am using Samba v.3.0.9-1.3E.2 on a RedHat ES server. The smbclient code is
being run on the same machine as the samba server. User level security is being
used. I will try and update with a tcpdump of an example session later.
Comment 1 Derrell Lipman 2005-04-19 12:32:40 UTC
The error code returned by cli_qpathinfo2() when a filename rather than a
directory name is passed, maps to EINVAL  The error code returned by
cli_getatr() when talking to a non-NT peer, properly maps to ENOTDIR.  When
EINVAL is returned, we now determine if the passed parameter was in fact a
directory, and if not, map the errno to ENOTDIR instead of EINVAL.
Comment 2 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:23:18 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.