diff options
author | Jeremy Allison <jra@samba.org> | 2006-07-11 18:01:26 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:19:14 -0500 |
commit | fbdcf2663b56007a438ac4f0d8d82436b1bfe688 (patch) | |
tree | 4e42c1f061391cea3d640152fd240682cbf4fd9a /source3/smbwrapper | |
parent | 5bf62a0c3cc95abe918f3e772bb10e0a90fdce22 (diff) | |
download | samba-fbdcf2663b56007a438ac4f0d8d82436b1bfe688.tar.gz samba-fbdcf2663b56007a438ac4f0d8d82436b1bfe688.tar.bz2 samba-fbdcf2663b56007a438ac4f0d8d82436b1bfe688.zip |
r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need
to do the upper layer directories but this is what
everyone is waiting for....
Jeremy.
(This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8)
Diffstat (limited to 'source3/smbwrapper')
-rw-r--r-- | source3/smbwrapper/smbw.c | 36 | ||||
-rw-r--r-- | source3/smbwrapper/smbw.h | 2 |
2 files changed, 19 insertions, 19 deletions
diff --git a/source3/smbwrapper/smbw.c b/source3/smbwrapper/smbw.c index d4a5b51af4..89ae9396aa 100644 --- a/source3/smbwrapper/smbw.c +++ b/source3/smbwrapper/smbw.c @@ -432,7 +432,7 @@ return a connection to a server (existing or new) struct smbw_server *smbw_server(char *server, char *share) { struct smbw_server *srv=NULL; - struct cli_state c; + struct cli_state *c; char *username; char *password; char *workgroup; @@ -499,13 +499,13 @@ struct smbw_server *smbw_server(char *server, char *share) } /* have to open a new connection */ - if (!cli_initialise(&c) || !cli_connect(&c, server_n, &ip)) { + if (((c = cli_initialise()) == NULL) || !cli_connect(c, server_n, &ip)) { errno = ENOENT; return NULL; } - if (!cli_session_request(&c, &calling, &called)) { - cli_shutdown(&c); + if (!cli_session_request(c, &calling, &called)) { + cli_shutdown(c); if (strcmp(called.name, "*SMBSERVER")) { make_nmb_name(&called , "*SMBSERVER", 0x20); goto again; @@ -516,29 +516,29 @@ struct smbw_server *smbw_server(char *server, char *share) DEBUG(4,(" session request ok\n")); - if (!cli_negprot(&c)) { - cli_shutdown(&c); + if (!cli_negprot(c)) { + cli_shutdown(c); errno = ENOENT; return NULL; } - if (!cli_session_setup(&c, username, + if (!cli_session_setup(c, username, password, strlen(password), password, strlen(password), workgroup) && /* try an anonymous login if it failed */ - !cli_session_setup(&c, "", "", 1,"", 0, workgroup)) { - cli_shutdown(&c); + !cli_session_setup(c, "", "", 1,"", 0, workgroup)) { + cli_shutdown(c); errno = EPERM; return NULL; } DEBUG(4,(" session setup ok\n")); - if (!cli_send_tconX(&c, share, "?????", + if (!cli_send_tconX(c, share, "?????", password, strlen(password)+1)) { - errno = smbw_errno(&c); - cli_shutdown(&c); + errno = smbw_errno(c); + cli_shutdown(c); return NULL; } @@ -584,11 +584,11 @@ struct smbw_server *smbw_server(char *server, char *share) /* some programs play with file descriptors fairly intimately. We try to get out of the way by duping to a high fd number */ - if (fcntl(SMBW_CLI_FD + srv->cli.fd, F_GETFD) && errno == EBADF) { - if (dup2(srv->cli.fd,SMBW_CLI_FD+srv->cli.fd) == - srv->cli.fd+SMBW_CLI_FD) { - close(srv->cli.fd); - srv->cli.fd += SMBW_CLI_FD; + if (fcntl(SMBW_CLI_FD + srv->cli->fd, F_GETFD) && errno == EBADF) { + if (dup2(srv->cli->fd,SMBW_CLI_FD+srv->cli->fd) == + srv->cli->fd+SMBW_CLI_FD) { + close(srv->cli->fd); + srv->cli->fd += SMBW_CLI_FD; } } @@ -597,7 +597,7 @@ struct smbw_server *smbw_server(char *server, char *share) return srv; failed: - cli_shutdown(&c); + cli_shutdown(c); if (!srv) return NULL; SAFE_FREE(srv->server_name); diff --git a/source3/smbwrapper/smbw.h b/source3/smbwrapper/smbw.h index 3f0b1cbb44..f64cb20964 100644 --- a/source3/smbwrapper/smbw.h +++ b/source3/smbwrapper/smbw.h @@ -32,7 +32,7 @@ struct smbw_server { struct smbw_server *next, *prev; - struct cli_state cli; + struct cli_state *cli; char *server_name; char *share_name; char *workgroup; |