mirror of
https://github.com/samba-team/samba.git
synced 2025-07-31 20:22:15 +03:00
s3:netapi: Remove username from 'struct libnetapi_ctx'
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
This commit is contained in:
committed by
Günther Deschner
parent
fd78554d11
commit
d94053f9d8
@ -131,17 +131,6 @@ NET_API_STATUS libnetapi_net_init(struct libnetapi_ctx **context)
|
|||||||
|
|
||||||
cli_credentials_guess(ctx->creds, lp_ctx);
|
cli_credentials_guess(ctx->creds, lp_ctx);
|
||||||
|
|
||||||
if (getenv("USER")) {
|
|
||||||
ctx->username = talloc_strdup(ctx, getenv("USER"));
|
|
||||||
} else {
|
|
||||||
ctx->username = talloc_strdup(ctx, "");
|
|
||||||
}
|
|
||||||
if (!ctx->username) {
|
|
||||||
TALLOC_FREE(frame);
|
|
||||||
fprintf(stderr, "libnetapi_init: out of memory\n");
|
|
||||||
return W_ERROR_V(WERR_NOT_ENOUGH_MEMORY);
|
|
||||||
}
|
|
||||||
|
|
||||||
status = libnetapi_init_private_context(ctx);
|
status = libnetapi_init_private_context(ctx);
|
||||||
if (status != 0) {
|
if (status != 0) {
|
||||||
TALLOC_FREE(frame);
|
TALLOC_FREE(frame);
|
||||||
@ -291,13 +280,6 @@ NET_API_STATUS libnetapi_set_username(struct libnetapi_ctx *ctx,
|
|||||||
return W_ERROR_V(WERR_INVALID_PARAMETER);
|
return W_ERROR_V(WERR_INVALID_PARAMETER);
|
||||||
}
|
}
|
||||||
|
|
||||||
TALLOC_FREE(ctx->username);
|
|
||||||
ctx->username = talloc_strdup(ctx, username ? username : "");
|
|
||||||
|
|
||||||
if (!ctx->username) {
|
|
||||||
return W_ERROR_V(WERR_NOT_ENOUGH_MEMORY);
|
|
||||||
}
|
|
||||||
|
|
||||||
cli_credentials_parse_string(ctx->creds, username, CRED_SPECIFIED);
|
cli_credentials_parse_string(ctx->creds, username, CRED_SPECIFIED);
|
||||||
|
|
||||||
return NET_API_STATUS_SUCCESS;
|
return NET_API_STATUS_SUCCESS;
|
||||||
|
@ -57,7 +57,6 @@ struct libnetapi_private_ctx {
|
|||||||
struct libnetapi_ctx {
|
struct libnetapi_ctx {
|
||||||
char *debuglevel;
|
char *debuglevel;
|
||||||
char *error_string;
|
char *error_string;
|
||||||
char *username;
|
|
||||||
char *workgroup;
|
char *workgroup;
|
||||||
char *password;
|
char *password;
|
||||||
int use_kerberos;
|
int use_kerberos;
|
||||||
|
Reference in New Issue
Block a user