diff options
author | James Peach <jpeach@samba.org> | 2007-03-02 23:24:27 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:49:07 -0500 |
commit | fcaeedeff3c7d65f65da19440eb7b1ac01481167 (patch) | |
tree | a5dc09c95ad0c389872aa3edd4ee32b4069b6d47 /source4/auth | |
parent | 9ca1a3c1861c69eff483441bf6147d58c2b79fab (diff) | |
download | samba-fcaeedeff3c7d65f65da19440eb7b1ac01481167.tar.gz samba-fcaeedeff3c7d65f65da19440eb7b1ac01481167.tar.bz2 samba-fcaeedeff3c7d65f65da19440eb7b1ac01481167.zip |
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)
Diffstat (limited to 'source4/auth')
-rw-r--r-- | source4/auth/credentials/credentials.c | 15 |
1 files changed, 15 insertions, 0 deletions
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) { |