Bug 1333 - A number of error returns from libsmbclient functions do not return error codes in errno.
Summary: A number of error returns from libsmbclient functions do not return error cod...
Status: CLOSED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: libsmbclient (show other bugs)
Version: 3.0.0preX
Hardware: Other other
: P3 normal
Target Milestone: none
Assignee: Derrell Lipman
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-09 09:28 UTC by Richard Sharpe
Modified: 2005-08-24 10:23 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Sharpe 2004-05-09 09:28:36 UTC
coolo has pointed out some cases where errno is not set on an error return:

> > I was just looking. And for example smbc_server got one case at the very
> > end of the function where it detects an error, but doesn't set errno.
> > This returns back to the application calling smbc_open as
> > "Can't open smb://... (0: Sucess)"
> >
> > smbc_attr_server sets in the same context errno to ENOMEM
>
Comment 1 Stephan Kulow 2004-05-09 11:55:26 UTC
the fix you commited now got some strange saved_errno which isn't used? 
Comment 2 Stephan Kulow 2004-05-13 08:49:41 UTC
See http://bugs.kde.org/show_bug.cgi?id=66381 and the referenced 
http://bugs.kde.org/attachment.cgi?id=5972&action=view 
 
cli_RNetShareEnum shares from the same errno problem as cli_NetServerEnum 
did. I wonder though how why the broken pipe was lost though. 
 
I'd suggest setting errno = 0 before cli_api and then checking if errno is set 
by the called function and if not, define errno to something reasonable. For 
this function count == 0 is not necessarly an error, but when the 
DEBUG(...failed is hit, then the function shouldn't leave without errno set. 
 
 
Comment 3 Gerald (Jerry) Carter (dead mail address) 2004-05-24 13:06:00 UTC
Richard, is this bug fixed ?  or not ?  I can't tell.
If it is fixed as per your comment in in change r616,
please close it as fixed.

Otherwise, please adds a comment on what needs to be done.
Comment 4 Stephan Kulow 2004-05-25 00:32:41 UTC
r616 is about the initial comment, the bug is really more a reminder. And the 
bug in #2 is real 
Comment 5 Gerald (Jerry) Carter (dead mail address) 2005-02-07 08:31:24 UTC
is this bug still present in 3.0.11 ?
Comment 6 Gerald (Jerry) Carter (dead mail address) 2005-03-29 06:09:05 UTC
no comment in a month.  closing.
Comment 7 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:23:54 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.