From fcaeedeff3c7d65f65da19440eb7b1ac01481167 Mon Sep 17 00:00:00 2001 From: James Peach Date: Fri, 2 Mar 2007 23:24:27 +0000 Subject: r21668: Add SMB_QFS_POSIX_WHOAMI to trans2.h so it's easy to find. Add convenience API to create an anonymous credential. Don't clobber cmdline_credentials in the UNIX-WHOAMI test. (This used to be commit 73cea4e0c66f57057ed12b07bbb94b4e783ba6bf) --- source4/auth/credentials/credentials.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source4/auth/credentials') diff --git a/source4/auth/credentials/credentials.c b/source4/auth/credentials/credentials.c index 38bd701b76..6f740d95c3 100644 --- a/source4/auth/credentials/credentials.c +++ b/source4/auth/credentials/credentials.c @@ -68,6 +68,21 @@ struct cli_credentials *cli_credentials_init(TALLOC_CTX *mem_ctx) return cred; } +/** + * Create a new anonymous credential + * @param mem_ctx TALLOC_CTX parent for credentials structure + */ +struct cli_credentials *cli_credentials_init_anon(TALLOC_CTX *mem_ctx) +{ + struct cli_credentials *anon_credentials; + + anon_credentials = cli_credentials_init(mem_ctx); + cli_credentials_set_conf(anon_credentials); + cli_credentials_set_anonymous(anon_credentials); + + return anon_credentials; +} + void cli_credentials_set_kerberos_state(struct cli_credentials *creds, enum credentials_use_kerberos use_kerberos) { -- cgit