[SCM] Samba Shared Repository - branch master updated
Volker Lendecke
vlendec at samba.org
Fri Apr 22 08:46:03 UTC 2016
The branch, master has been updated
via ac7974a Fixes an obvious copy-paste error in source3/utils/net_dns.c
via d2e1437 lib: dns: Clean up allocated structure on error exit.
via 773a16b pdb_ldap: Don't use autofree if "mods" still changes
via 0b1f4db nss_wins: Fix the hostent setup
via d3569ca nss_wins: ip_pton expects the raw IP address
from 2ef0c9a dbcheck: Avoid pathological behaviour in operational module
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit ac7974a64e9bee8caf9e418f46e6570eb857c1bd
Author: Richard Sharpe <rsharpe at nutanix.com>
Date: Wed Apr 20 20:56:05 2016 -0700
Fixes an obvious copy-paste error in source3/utils/net_dns.c
Signed-off-by: Richard Sharpe <rsharpe at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
Autobuild-User(master): Volker Lendecke <vl at samba.org>
Autobuild-Date(master): Fri Apr 22 10:45:30 CEST 2016 on sn-devel-144
commit d2e143708ff336894b65f413adc71a5990dc9995
Author: Jeremy Allison <jra at samba.org>
Date: Thu Apr 21 17:35:37 2016 -0700
lib: dns: Clean up allocated structure on error exit.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Richard Sharpe <rsharpe at samba.org>
commit 773a16ba86482d0f1fcc9f3f147e512adba2f2e3
Author: Volker Lendecke <vl at samba.org>
Date: Fri Mar 4 10:51:33 2016 +0100
pdb_ldap: Don't use autofree if "mods" still changes
This will prevent some use-after-free's, potentially it might for example fix
bugzilla 11851. Not directly related, but it's a crash related to ldap-backed
user creation.
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 0b1f4db325bb0ed9171619c874908ee25327bba9
Author: Tom Mortensen <tomm at lime-technology.com>
Date: Sat Apr 16 10:57:12 2016 +0200
nss_wins: Fix the hostent setup
This can never have been tested....
Signed-off-by: Tom Mortensen <tomm at lime-technology.com>
Reviewed-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit d3569ca2711d21ac87ff539662333ad315a2a618
Author: Tom Mortensen <tomm at lime-technology.com>
Date: Sat Apr 16 10:57:12 2016 +0200
nss_wins: ip_pton expects the raw IP address
Signed-off-by: Tom Mortensen <tomm at lime-technology.com>
Reviewed-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
-----------------------------------------------------------------------
Summary of changes:
lib/addns/dnsgss.c | 10 ++++++----
nsswitch/wins.c | 13 +++++++++----
source3/passdb/pdb_ldap.c | 8 +++++++-
source3/utils/net_dns.c | 1 -
4 files changed, 22 insertions(+), 10 deletions(-)
Changeset truncated at 500 lines:
diff --git a/lib/addns/dnsgss.c b/lib/addns/dnsgss.c
index f7ed1d1..fd1af7e 100644
--- a/lib/addns/dnsgss.c
+++ b/lib/addns/dnsgss.c
@@ -89,6 +89,8 @@ static DNS_ERROR dns_negotiate_gss_ctx_int( TALLOC_CTX *mem_ctx,
struct gss_buffer_desc_struct input_desc, *input_ptr, output_desc;
OM_uint32 major, minor;
OM_uint32 ret_flags;
+ struct dns_request *req = NULL;
+ struct dns_buffer *buf = NULL;
DNS_ERROR err;
gss_OID_desc krb5_oid_desc =
@@ -112,9 +114,7 @@ static DNS_ERROR dns_negotiate_gss_ctx_int( TALLOC_CTX *mem_ctx,
if (output_desc.length != 0) {
- struct dns_request *req;
struct dns_rrec *rec;
- struct dns_buffer *buf;
time_t t = time(NULL);
@@ -143,12 +143,13 @@ static DNS_ERROR dns_negotiate_gss_ctx_int( TALLOC_CTX *mem_ctx,
if (!ERR_DNS_IS_OK(err)) goto error;
- err = dns_marshall_request(req, req, &buf);
+ err = dns_marshall_request(mem_ctx, req, &buf);
if (!ERR_DNS_IS_OK(err)) goto error;
err = dns_send(conn, buf);
if (!ERR_DNS_IS_OK(err)) goto error;
+ TALLOC_FREE(buf);
TALLOC_FREE(req);
}
@@ -162,7 +163,6 @@ static DNS_ERROR dns_negotiate_gss_ctx_int( TALLOC_CTX *mem_ctx,
if (major == GSS_S_CONTINUE_NEEDED) {
struct dns_request *resp;
- struct dns_buffer *buf;
struct dns_tkey_record *tkey;
struct dns_rrec *tkey_answer = NULL;
uint16_t i;
@@ -210,6 +210,8 @@ static DNS_ERROR dns_negotiate_gss_ctx_int( TALLOC_CTX *mem_ctx,
error:
+ TALLOC_FREE(buf);
+ TALLOC_FREE(req);
return err;
}
diff --git a/nsswitch/wins.c b/nsswitch/wins.c
index 3243ffb..fc65c03 100644
--- a/nsswitch/wins.c
+++ b/nsswitch/wins.c
@@ -47,7 +47,7 @@ NSS_STATUS _nss_wins_gethostbyname2_r(const char *name, int af, struct hostent *
static char *lookup_byname_backend(const char *name)
{
const char *p;
- char *ip;
+ char *ip, *ipp;
size_t nbt_len;
wbcErr result;
@@ -65,6 +65,11 @@ static char *lookup_byname_backend(const char *name)
return NULL;
}
+ ipp = strchr(ip, '\t');
+ if (ipp != NULL) {
+ *ipp = '\0';
+ }
+
return ip;
}
@@ -275,7 +280,7 @@ _nss_wins_gethostbyname_r(const char *hostname, struct hostent *he,
}
if ((he->h_addr_list = (char **)get_static(
- &buffer, &buflen, i * sizeof(char *))) == NULL) {
+ &buffer, &buflen, 2 * sizeof(char *))) == NULL) {
nss_status = NSS_STATUS_TRYAGAIN;
goto out;
}
@@ -286,9 +291,9 @@ _nss_wins_gethostbyname_r(const char *hostname, struct hostent *he,
goto out;
}
- memcpy(he->h_addr_list[i], &in, INADDRSZ);
+ memcpy(he->h_addr_list[0], &in, INADDRSZ);
- he->h_addr_list[0] = NULL;
+ he->h_addr_list[1] = NULL;
/* Set h_addr_type and h_length */
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index 50ab3a7..4383785 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -5291,10 +5291,10 @@ static NTSTATUS ldapsam_create_user(struct pdb_methods *my_methods,
}
init_okay = init_ldap_from_sam(ldap_state, entry, &mods, user, pdb_element_is_set_or_changed);
- smbldap_talloc_autofree_ldapmod(tmp_ctx, mods);
if (!init_okay) {
DEBUG(1,("ldapsam_create_user: Unable to fill user structs\n"));
+ ldap_mods_free(mods, true);
return NT_STATUS_UNSUCCESSFUL;
}
@@ -5312,12 +5312,14 @@ static NTSTATUS ldapsam_create_user(struct pdb_methods *my_methods,
if (!sid_compose(&group_sid, get_global_sam_sid(), DOMAIN_RID_USERS) ||
!sid_to_gid(&group_sid, &gid)) {
DEBUG (0, ("ldapsam_create_user: Unable to get the Domain Users gid: bailing out!\n"));
+ ldap_mods_free(mods, true);
return NT_STATUS_INVALID_PRIMARY_GROUP;
}
/* lets allocate a new userid for this user */
if (!winbind_allocate_uid(&uid)) {
DEBUG (0, ("ldapsam_create_user: Unable to allocate a new user id: bailing out!\n"));
+ ldap_mods_free(mods, true);
return NT_STATUS_UNSUCCESSFUL;
}
@@ -5354,6 +5356,7 @@ static NTSTATUS ldapsam_create_user(struct pdb_methods *my_methods,
escape_name = escape_rdn_val_string_alloc(name);
if (!escape_name) {
DEBUG (0, ("ldapsam_create_user: Out of memory!\n"));
+ ldap_mods_free(mods, true);
return NT_STATUS_NO_MEMORY;
}
@@ -5367,6 +5370,7 @@ static NTSTATUS ldapsam_create_user(struct pdb_methods *my_methods,
if (!homedir || !shell || !uidstr || !gidstr || !dn) {
DEBUG (0, ("ldapsam_create_user: Out of memory!\n"));
+ ldap_mods_free(mods, true);
return NT_STATUS_NO_MEMORY;
}
@@ -5385,6 +5389,8 @@ static NTSTATUS ldapsam_create_user(struct pdb_methods *my_methods,
rc = smbldap_modify(ldap_state->smbldap_state, dn, mods);
}
+ ldap_mods_free(mods, true);
+
if (rc != LDAP_SUCCESS) {
DEBUG(0,("ldapsam_create_user: failed to create a new user [%s] (dn = %s)\n", name ,dn));
return NT_STATUS_UNSUCCESSFUL;
diff --git a/source3/utils/net_dns.c b/source3/utils/net_dns.c
index 7a04459..3b9730a 100644
--- a/source3/utils/net_dns.c
+++ b/source3/utils/net_dns.c
@@ -72,7 +72,6 @@ DNS_ERROR DoDNSUpdate(char *pszServerName,
if (!ERR_DNS_IS_OK(err)) goto error;
err = dns_update_transaction(mem_ctx, conn, req, &resp);
- if (!ERR_DNS_IS_OK(err)) goto error;
if (!ERR_DNS_IS_OK(err)) {
DEBUG(3,("DoDNSUpdate: failed to probe DNS\n"));
--
Samba Shared Repository
More information about the samba-cvs
mailing list