diff options
author | Volker Lendecke <vl@samba.org> | 2011-07-03 12:12:45 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2011-07-03 22:45:26 +0200 |
commit | 714e1014c59979d9a7a7c12f21185fdf7bcab818 (patch) | |
tree | e61b7080f5005b9e6152cef98ceb1d9b659a2f55 | |
parent | 7ca63fb8fe17ccbfa5400c2b6d465a21096cb8fc (diff) | |
download | samba-714e1014c59979d9a7a7c12f21185fdf7bcab818.tar.gz |
s3: Make cli_cm_connect return NTSTATUS
-rw-r--r-- | source3/libsmb/clidfs.c | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c index eb168a614ce..da4150dee91 100644 --- a/source3/libsmb/clidfs.c +++ b/source3/libsmb/clidfs.c @@ -261,16 +261,17 @@ static void cli_set_mntpoint(struct cli_state *cli, const char *mnt) referring_cli == NULL means a new initial connection. ********************************************************************/ -static struct cli_state *cli_cm_connect(TALLOC_CTX *ctx, - struct cli_state *referring_cli, - const char *server, - const char *share, - const struct user_auth_info *auth_info, - bool show_hdr, - bool force_encrypt, - int max_protocol, - int port, - int name_type) +static NTSTATUS cli_cm_connect(TALLOC_CTX *ctx, + struct cli_state *referring_cli, + const char *server, + const char *share, + const struct user_auth_info *auth_info, + bool show_hdr, + bool force_encrypt, + int max_protocol, + int port, + int name_type, + struct cli_state **pcli) { struct cli_state *cli; NTSTATUS status; @@ -281,7 +282,7 @@ static struct cli_state *cli_cm_connect(TALLOC_CTX *ctx, port, name_type, &cli); if (!NT_STATUS_IS_OK(status)) { - return NULL; + return status; } /* Enter into the list. */ @@ -301,7 +302,8 @@ static struct cli_state *cli_cm_connect(TALLOC_CTX *ctx, } } - return cli; + *pcli = cli; + return NT_STATUS_OK; } /******************************************************************** @@ -354,6 +356,7 @@ struct cli_state *cli_cm_open(TALLOC_CTX *ctx, { /* Try to reuse an existing connection in this list. */ struct cli_state *c = cli_cm_find(referring_cli, server, share); + NTSTATUS status; if (c) { return c; @@ -368,7 +371,7 @@ struct cli_state *cli_cm_open(TALLOC_CTX *ctx, return NULL; } - return cli_cm_connect(ctx, + status = cli_cm_connect(ctx, referring_cli, server, share, @@ -377,7 +380,12 @@ struct cli_state *cli_cm_open(TALLOC_CTX *ctx, force_encrypt, max_protocol, port, - name_type); + name_type, + &c); + if (!NT_STATUS_IS_OK(status)) { + return NULL; + } + return c; } /**************************************************************************** |