Commit 6a110a5d authored by Richard Sharpe's avatar Richard Sharpe Committed by Gerald (Jerry) Carter
Browse files

r588: Some fixes from coolo ...

I think that the ECONNREFUSED should probably be ENOENT.
(This used to be commit faa8cc18df51c4406815b68caba5ed5b8d43ba18)
parent 959c52b5
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -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 */
@@ -270,6 +272,17 @@ 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);
}

+1 −4
Original line number Diff line number Diff line
@@ -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);