diff options
author | Richard Sharpe <sharpe@samba.org> | 2004-05-08 20:15:52 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:51:30 -0500 |
commit | 6a110a5d2bdbdea201dc3165586e6dff5d09ce90 (patch) | |
tree | 071e020fcd4f88ec58df1025bdbc8c9d7a6f9dad /source3/libsmb | |
parent | 959c52b5baf0019e0a18d672c51e3aba0ad06579 (diff) | |
download | samba-6a110a5d2bdbdea201dc3165586e6dff5d09ce90.tar.gz samba-6a110a5d2bdbdea201dc3165586e6dff5d09ce90.tar.bz2 samba-6a110a5d2bdbdea201dc3165586e6dff5d09ce90.zip |
r588: Some fixes from coolo ...
I think that the ECONNREFUSED should probably be ENOENT.
(This used to be commit faa8cc18df51c4406815b68caba5ed5b8d43ba18)
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/clirap.c | 15 | ||||
-rw-r--r-- | source3/libsmb/libsmbclient.c | 5 |
2 files changed, 15 insertions, 5 deletions
diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c index f8204e05d6..8cc5d8bf90 100644 --- a/source3/libsmb/clirap.c +++ b/source3/libsmb/clirap.c @@ -217,6 +217,8 @@ BOOL cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype, int uLevel = 1; int count = -1; + errno = 0; /* reset */ + /* send a SMBtrans command with api NetServerEnum */ p = param; SSVAL(p,0,0x68); /* api number */ @@ -269,7 +271,18 @@ BOOL cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype, SAFE_FREE(rparam); SAFE_FREE(rdata); - + + if (count < 0) { + errno = cli_errno(cli); + } else { + if (!count) { + /* this is a very special case, when the domain master for the + work group isn't part of the work group itself, there is something + wild going on */ + errno = ENOENT; + } + } + return(count > 0); } diff --git a/source3/libsmb/libsmbclient.c b/source3/libsmb/libsmbclient.c index f08d9440f9..417b5ba8d4 100644 --- a/source3/libsmb/libsmbclient.c +++ b/source3/libsmb/libsmbclient.c @@ -1939,7 +1939,6 @@ static SMBCFILE *smbc_opendir_ctx(SMBCCTX *context, const char *fname) SAFE_FREE(dir->fname); SAFE_FREE(dir); } - errno = cli_errno(&srv->cli); return NULL; @@ -2032,7 +2031,6 @@ static SMBCFILE *smbc_opendir_ctx(SMBCCTX *context, const char *fname) SAFE_FREE(dir->fname); SAFE_FREE(dir); } - errno = cli_errno(&srv->cli); return NULL; @@ -2106,7 +2104,6 @@ static SMBCFILE *smbc_opendir_ctx(SMBCCTX *context, const char *fname) SAFE_FREE(dir->fname); SAFE_FREE(dir); } - errno = cli_errno(&srv->cli); return NULL; } @@ -2150,7 +2147,7 @@ static SMBCFILE *smbc_opendir_ctx(SMBCCTX *context, const char *fname) } else { - errno = ENODEV; /* Neither the workgroup nor server exists */ + errno = ECONNREFUSED; /* Neither the workgroup nor server exists */ if (dir) { SAFE_FREE(dir->fname); SAFE_FREE(dir); |