diff options
Diffstat (limited to 'source3/passdb')
-rw-r--r-- | source3/passdb/machine_sid.c | 5 | ||||
-rw-r--r-- | source3/passdb/passdb.c | 2 | ||||
-rw-r--r-- | source3/passdb/pdb_get_set.c | 2 | ||||
-rw-r--r-- | source3/passdb/pdb_ldap.c | 11 |
4 files changed, 12 insertions, 8 deletions
diff --git a/source3/passdb/machine_sid.c b/source3/passdb/machine_sid.c index d1599047a7..8fafcbbbd4 100644 --- a/source3/passdb/machine_sid.c +++ b/source3/passdb/machine_sid.c @@ -128,7 +128,10 @@ static DOM_SID *pdb_generate_sam_sid(void) } /* check for an old MACHINE.SID file for backwards compatibility */ - asprintf(&fname, "%s/MACHINE.SID", lp_private_dir()); + if (asprintf(&fname, "%s/MACHINE.SID", lp_private_dir()) == -1) { + SAFE_FREE(sam_sid); + return NULL; + } if (read_sid_from_file(fname, sam_sid)) { /* remember it for future reference and unlink the old MACHINE.SID */ diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c index 70b9dcd3b5..46dab156ee 100644 --- a/source3/passdb/passdb.c +++ b/source3/passdb/passdb.c @@ -206,7 +206,7 @@ static NTSTATUS samu_set_unix_internal(struct samu *user, const struct passwd *p /* Now deal with the user SID. If we have a backend that can generate RIDs, then do so. But sometimes the caller just wanted a structure initialized and will fill in these fields later (such as from a - NET_USER_INFO_3 structure) */ + netr_SamInfo3 structure) */ if ( create && !pdb_rid_algorithm() ) { uint32 user_rid; diff --git a/source3/passdb/pdb_get_set.c b/source3/passdb/pdb_get_set.c index 3b55dd478f..c427d41e23 100644 --- a/source3/passdb/pdb_get_set.c +++ b/source3/passdb/pdb_get_set.c @@ -538,7 +538,7 @@ bool pdb_set_user_sid_from_string(struct samu *sampass, fstring u_sid, enum pdb_ We never fill this in from a passdb backend but rather set is based on the user's primary group membership. However, the struct samu* is overloaded and reused in domain memship code - as well and built from the NET_USER_INFO_3 or PAC so we + as well and built from the netr_SamInfo3 or PAC so we have to allow the explicitly setting of a group SID here. ********************************************************************/ diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c index da2f9f30da..dec9b5bafb 100644 --- a/source3/passdb/pdb_ldap.c +++ b/source3/passdb/pdb_ldap.c @@ -349,6 +349,7 @@ int ldapsam_search_suffix_by_name(struct ldapsam_privates *ldap_state, filter = talloc_asprintf(talloc_tos(), "(&%s%s)", "(uid=%u)", get_objclass_filter(ldap_state->schema_ver)); if (!filter) { + SAFE_FREE(escape_user); return LDAP_NO_MEMORY; } /* @@ -358,10 +359,10 @@ int ldapsam_search_suffix_by_name(struct ldapsam_privates *ldap_state, filter = talloc_all_string_sub(talloc_tos(), filter, "%u", escape_user); + SAFE_FREE(escape_user); if (!filter) { return LDAP_NO_MEMORY; } - SAFE_FREE(escape_user); ret = smbldap_search_suffix(ldap_state->smbldap_state, filter, attr, result); @@ -2683,7 +2684,7 @@ static NTSTATUS ldapsam_enum_group_members(struct pdb_methods *methods, goto done; } - rc = smbldap_search(conn, lp_ldap_user_suffix(), + rc = smbldap_search(conn, lp_ldap_suffix(), LDAP_SCOPE_SUBTREE, filter, sid_attrs, 0, &result); @@ -2739,7 +2740,7 @@ static NTSTATUS ldapsam_enum_group_members(struct pdb_methods *methods, LDAP_OBJ_SAMBASAMACCOUNT, gidstr); - rc = smbldap_search(conn, lp_ldap_user_suffix(), + rc = smbldap_search(conn, lp_ldap_suffix(), LDAP_SCOPE_SUBTREE, filter, sid_attrs, 0, &result); @@ -6264,7 +6265,7 @@ NTSTATUS pdb_init_ldapsam(struct pdb_methods **pdb_method, const char *location) entry, get_userattr_key2string(ldap_state->schema_ver, LDAP_ATTR_USER_SID), - NULL); + talloc_tos()); if (domain_sid_string) { bool found_sid; @@ -6300,7 +6301,7 @@ NTSTATUS pdb_init_ldapsam(struct pdb_methods **pdb_method, const char *location) entry, get_attr_key2string( dominfo_attr_list, LDAP_ATTR_ALGORITHMIC_RID_BASE ), - NULL); + talloc_tos()); if (alg_rid_base_string) { alg_rid_base = (uint32)atol(alg_rid_base_string); if (alg_rid_base != algorithmic_rid_base()) { |