[SCM] Samba Shared Repository - branch v3-3-test updated -
release-3-2-0pre2-4731-g9ebaf67
Jeremy Allison
jra at samba.org
Tue Dec 23 18:42:16 GMT 2008
The branch, v3-3-test has been updated
via 9ebaf67d1dce717cafd5761b2f66296712a09957 (commit)
from f0c0f2bee3bb874ba841a3b73c8677cd0ba67873 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test
- Log -----------------------------------------------------------------
commit 9ebaf67d1dce717cafd5761b2f66296712a09957
Author: Jeremy Allison <jeremy at jeremy-desktop.(none)>
Date: Tue Dec 23 10:42:38 2008 -0800
Fix more âasprintfâ, declared with attribute warn_unused_result.
Jeremy.
-----------------------------------------------------------------------
Summary of changes:
source/passdb/pdb_interface.c | 22 ++++++++++++++--------
source/passdb/pdb_ldap.c | 7 ++++---
2 files changed, 18 insertions(+), 11 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/passdb/pdb_interface.c b/source/passdb/pdb_interface.c
index 5a79f09..b13644b 100644
--- a/source/passdb/pdb_interface.c
+++ b/source/passdb/pdb_interface.c
@@ -179,20 +179,26 @@ static struct pdb_methods *pdb_get_methods_reload( bool reload )
pdb->free_private_data( &(pdb->private_data) );
if ( !NT_STATUS_IS_OK( make_pdb_method_name( &pdb, lp_passdb_backend() ) ) ) {
char *msg = NULL;
- asprintf(&msg, "pdb_get_methods_reload: "
- "failed to get pdb methods for backend %s\n",
- lp_passdb_backend());
- smb_panic(msg);
+ if (asprintf(&msg, "pdb_get_methods_reload: "
+ "failed to get pdb methods for backend %s\n",
+ lp_passdb_backend()) > 0) {
+ smb_panic(msg);
+ } else {
+ smb_panic("pdb_get_methods_reload");
+ }
}
}
if ( !pdb ) {
if ( !NT_STATUS_IS_OK( make_pdb_method_name( &pdb, lp_passdb_backend() ) ) ) {
char *msg = NULL;
- asprintf(&msg, "pdb_get_methods_reload: "
- "failed to get pdb methods for backend %s\n",
- lp_passdb_backend());
- smb_panic(msg);
+ if (asprintf(&msg, "pdb_get_methods_reload: "
+ "failed to get pdb methods for backend %s\n",
+ lp_passdb_backend()) > 0) {
+ smb_panic(msg);
+ } else {
+ smb_panic("pdb_get_methods_reload");
+ }
}
}
diff --git a/source/passdb/pdb_ldap.c b/source/passdb/pdb_ldap.c
index 95e9a01..f031483 100644
--- a/source/passdb/pdb_ldap.c
+++ b/source/passdb/pdb_ldap.c
@@ -4184,9 +4184,10 @@ static char *get_ldap_filter(TALLOC_CTX *mem_ctx, const char *username)
char *escaped = NULL;
char *result = NULL;
- asprintf(&filter, "(&%s(objectclass=%s))",
- "(uid=%u)", LDAP_OBJ_SAMBASAMACCOUNT);
- if (filter == NULL) goto done;
+ if (asprintf(&filter, "(&%s(objectclass=%s))",
+ "(uid=%u)", LDAP_OBJ_SAMBASAMACCOUNT) < 0) {
+ goto done;
+ }
escaped = escape_ldap_string_alloc(username);
if (escaped == NULL) goto done;
--
Samba Shared Repository
More information about the samba-cvs
mailing list