summaryrefslogtreecommitdiff
path: root/auth/credentials
diff options
context:
space:
mode:
Diffstat (limited to 'auth/credentials')
-rw-r--r--auth/credentials/credentials.c15
-rw-r--r--auth/credentials/credentials.h3
2 files changed, 18 insertions, 0 deletions
diff --git a/auth/credentials/credentials.c b/auth/credentials/credentials.c
index e6a471064f..c1c6993032 100644
--- a/auth/credentials/credentials.c
+++ b/auth/credentials/credentials.c
@@ -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
diff --git a/auth/credentials/credentials.h b/auth/credentials/credentials.h
index 0f498ad2d0..1377bfa879 100644
--- a/auth/credentials/credentials.h
+++ b/auth/credentials/credentials.h
@@ -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
*/