svn commit: samba r6271 - in branches/SAMBA_4_0/source: include lib
abartlet at samba.org
abartlet at samba.org
Sun Apr 10 10:11:36 GMT 2005
Author: abartlet
Date: 2005-04-10 10:11:36 +0000 (Sun, 10 Apr 2005)
New Revision: 6271
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=6271
Log:
Don't zero the cli_credentials structure - instead allow valgrind to
track the use of un-initialised values.
This change will require a recompile from clean, as the enum
describing the status of each element now has a default of
CRED_UNINITIALISED.
Andrew Bartlett
Modified:
branches/SAMBA_4_0/source/include/credentials.h
branches/SAMBA_4_0/source/lib/credentials.c
Changeset:
Modified: branches/SAMBA_4_0/source/include/credentials.h
===================================================================
--- branches/SAMBA_4_0/source/include/credentials.h 2005-04-10 07:39:51 UTC (rev 6270)
+++ branches/SAMBA_4_0/source/include/credentials.h 2005-04-10 10:11:36 UTC (rev 6271)
@@ -23,7 +23,8 @@
/* In order of priority */
enum credentials_obtained {
- CRED_GUESSED = 0, /* Current value should be used, which was guessed */
+ CRED_UNINITIALISED = 0, /* We don't even have a guess yet */
+ CRED_GUESSED, /* Current value should be used, which was guessed */
CRED_CALLBACK, /* Callback should be used to obtain value */
CRED_SPECIFIED /* Was explicitly specified on the command-line */
};
Modified: branches/SAMBA_4_0/source/lib/credentials.c
===================================================================
--- branches/SAMBA_4_0/source/lib/credentials.c 2005-04-10 07:39:51 UTC (rev 6270)
+++ branches/SAMBA_4_0/source/lib/credentials.c 2005-04-10 10:11:36 UTC (rev 6271)
@@ -32,11 +32,17 @@
*/
struct cli_credentials *cli_credentials_init(TALLOC_CTX *mem_ctx)
{
- struct cli_credentials *cred = talloc_zero(mem_ctx, struct cli_credentials);
+ struct cli_credentials *cred = talloc(mem_ctx, struct cli_credentials);
if (!cred) {
return cred;
}
+ cred->machine_account_pending = False;
+ cred->workstation_obtained = CRED_UNINITIALISED;
+ cred->username_obtained = CRED_UNINITIALISED;
+ cred->password_obtained = CRED_UNINITIALISED;
+ cred->domain_obtained = CRED_UNINITIALISED;
+ cred->realm_obtained = CRED_UNINITIALISED;
return cred;
}
More information about the samba-cvs
mailing list