summaryrefslogtreecommitdiffstats
path: root/source/libsmb/clirap.c
diff options
context:
space:
mode:
authorRichard Sharpe <sharpe@samba.org>2004-05-08 20:15:52 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:51:30 -0500
commitfaa8cc18df51c4406815b68caba5ed5b8d43ba18 (patch)
treece029144bc1723e2f09e1076740e01ed19c795c7 /source/libsmb/clirap.c
parent55bf9b2bbf7c31cf7c21bb3a49ee927cabda8b4e (diff)
downloadsamba-faa8cc18df51c4406815b68caba5ed5b8d43ba18.tar.gz
samba-faa8cc18df51c4406815b68caba5ed5b8d43ba18.tar.xz
samba-faa8cc18df51c4406815b68caba5ed5b8d43ba18.zip
r588: Some fixes from coolo ...
I think that the ECONNREFUSED should probably be ENOENT.
Diffstat (limited to 'source/libsmb/clirap.c')
-rw-r--r--source/libsmb/clirap.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source/libsmb/clirap.c b/source/libsmb/clirap.c
index f8204e05d68..8cc5d8bf901 100644
--- a/source/libsmb/clirap.c
+++ b/source/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);
}