1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-22 22:04:08 +03:00

auth/credentials: add cli_credentials_shallow_copy()

This is useful for testing.

Signed-off-by: Stefan Metzmacher <metze@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Stefan Metzmacher 2013-07-31 13:21:14 +02:00 committed by Andrew Bartlett
parent 6ff6778bdc
commit b3cd44d50c
2 changed files with 18 additions and 0 deletions

View File

@ -125,6 +125,21 @@ _PUBLIC_ void *_cli_credentials_callback_data(struct cli_credentials *cred)
return cred->priv_data;
}
_PUBLIC_ struct cli_credentials *cli_credentials_shallow_copy(TALLOC_CTX *mem_ctx,
struct cli_credentials *src)
{
struct cli_credentials *dst;
dst = talloc(mem_ctx, struct cli_credentials);
if (dst == NULL) {
return NULL;
}
*dst = *src;
return dst;
}
/**
* Create a new anonymous credential
* @param mem_ctx TALLOC_CTX parent for credentials structure

View File

@ -340,6 +340,9 @@ void *_cli_credentials_callback_data(struct cli_credentials *cred);
#define cli_credentials_callback_data_void(_cred) \
_cli_credentials_callback_data(_cred)
struct cli_credentials *cli_credentials_shallow_copy(TALLOC_CTX *mem_ctx,
struct cli_credentials *src);
/**
* Return attached NETLOGON credentials
*/