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.
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.
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.