The branch, master has been updated via e8e9e7f vfs:shadow_copy2: fix a debug message via 25243af docs: fix copy'n'paste error in vfs_shadow_copy2 manpage via f7583be asn1: Make asn1_peek_tag_needed_size static via 2aa1cf4 asn1: Fix a typo via 5e1a84c winbind: Properly error check init_lsa_ref_domain_list via 5a2c305 idmap: Fix whitespace via 9039f1f libcli: Fix a typo via 812e074 libsmb: Remove ip_service based resolve_lmhosts via c29188f libsmb: Convert resolve_hosts to sockaddr_storage from da8674c Rename 'errors' to 'samba-errors' and make it public.
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit e8e9e7f2fe33d1e158202df4eb91d3738c9eb266 Author: Michael Adam <ob...@samba.org> Date: Wed Jan 13 01:37:24 2016 +0100 vfs:shadow_copy2: fix a debug message The debug message for the mountpoint option was the wrong way around. This fixes it, also converting the message to use DBG_WARNING() while we're touching it. Signed-off-by: Michael Adam <ob...@samba.org> Reviewed-by: Uri Simchoni <u...@samba.org> Autobuild-User(master): Uri Simchoni <u...@samba.org> Autobuild-Date(master): Wed Jan 13 10:56:42 CET 2016 on sn-devel-144 commit 25243affa961e5c1650ec0ba9059fb6b51eb95c4 Author: Michael Adam <ob...@samba.org> Date: Wed Jan 13 01:46:25 2016 +0100 docs: fix copy'n'paste error in vfs_shadow_copy2 manpage Signed-off-by: Michael Adam <ob...@samba.org> Reviewed-by: Uri Simchoni <u...@samba.org> commit f7583be4429b9353d84ab6bdaba9edad42d46b96 Author: Volker Lendecke <v...@samba.org> Date: Mon Jan 11 21:41:22 2016 +0100 asn1: Make asn1_peek_tag_needed_size static Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Uri Simchoni <u...@samba.org> commit 2aa1cf48fc9913e512b340f933d3747327326843 Author: Volker Lendecke <v...@samba.org> Date: Mon Jan 11 21:38:20 2016 +0100 asn1: Fix a typo Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Uri Simchoni <u...@samba.org> commit 5e1a84c43ed0c69ca97499370d97c182e5d903e1 Author: Volker Lendecke <v...@samba.org> Date: Mon Dec 28 17:01:47 2015 +0100 winbind: Properly error check init_lsa_ref_domain_list Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Uri Simchoni <u...@samba.org> commit 5a2c30564337bfc8ba991c45ce8db6eee1831ace Author: Volker Lendecke <v...@samba.org> Date: Sun Dec 27 19:55:40 2015 +0100 idmap: Fix whitespace Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Uri Simchoni <u...@samba.org> commit 9039f1f29eb971894d6c0276f99a39a140fe2013 Author: Volker Lendecke <v...@samba.org> Date: Thu Dec 17 15:42:33 2015 +0100 libcli: Fix a typo Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Uri Simchoni <u...@samba.org> commit 812e07418eae036f079bec7835516a86ae89f86e Author: Volker Lendecke <v...@samba.org> Date: Tue Dec 15 21:52:38 2015 +0100 libsmb: Remove ip_service based resolve_lmhosts Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Uri Simchoni <u...@samba.org> commit c29188f501936f986470821064032d6681622ca5 Author: Volker Lendecke <v...@samba.org> Date: Tue Dec 15 21:43:50 2015 +0100 libsmb: Convert resolve_hosts to sockaddr_storage Eventually I want to get rid of struct ip_service. Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Uri Simchoni <u...@samba.org> ----------------------------------------------------------------------- Summary of changes: docs-xml/manpages/vfs_shadow_copy2.8.xml | 4 +- lib/util/asn1.c | 5 +- lib/util/asn1.h | 1 - source3/libsmb/namequery.c | 80 +++++++++----------------------- source3/modules/vfs_shadow_copy2.c | 11 +++-- source3/winbindd/idmap_nss.c | 8 ++-- source3/winbindd/idmap_rid.c | 6 +-- source3/winbindd/idmap_util.c | 4 +- source3/winbindd/wb_sids2xids.c | 14 ++++-- source4/libcli/ldap/ldap_client.c | 2 +- 10 files changed, 54 insertions(+), 81 deletions(-) Changeset truncated at 500 lines: diff --git a/docs-xml/manpages/vfs_shadow_copy2.8.xml b/docs-xml/manpages/vfs_shadow_copy2.8.xml index dc16d5d..ad2e9c7 100644 --- a/docs-xml/manpages/vfs_shadow_copy2.8.xml +++ b/docs-xml/manpages/vfs_shadow_copy2.8.xml @@ -351,10 +351,10 @@ only particular subtrees of the filesystem as well. </para> <para> - Note that <command>shadow:snapdirseverywhere</command> + Note that <command>shadow:crossmountpoints</command> depends on <command>shadow:snapdir</command> and needs it to be a relative path. Setting an absolute snapdir path disables - <command>shadow:snapdirseverywhere</command>. + <command>shadow:crossmountpoints</command>. </para> <para> Note that this option is incompatible with the diff --git a/lib/util/asn1.c b/lib/util/asn1.c index 9ce7c23..8f2c516 100644 --- a/lib/util/asn1.c +++ b/lib/util/asn1.c @@ -284,7 +284,7 @@ bool ber_write_OID_String(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, const char *OID) if (newp[0] != '.') return false; p = newp + 1; - /*the ber representation can't use more space then the string one */ + /*the ber representation can't use more space than the string one */ *blob = data_blob_talloc(mem_ctx, NULL, strlen(OID)); if (!blob->data) return false; @@ -543,7 +543,8 @@ bool asn1_peek_tag(struct asn1_data *data, uint8_t tag) /* * just get the needed size the tag would consume */ -bool asn1_peek_tag_needed_size(struct asn1_data *data, uint8_t tag, size_t *size) +static bool asn1_peek_tag_needed_size(struct asn1_data *data, uint8_t tag, + size_t *size) { off_t start_ofs = data->ofs; uint8_t b; diff --git a/lib/util/asn1.h b/lib/util/asn1.h index 128858f..9ebf453 100644 --- a/lib/util/asn1.h +++ b/lib/util/asn1.h @@ -76,7 +76,6 @@ bool asn1_peek(struct asn1_data *data, void *p, int len); bool asn1_read(struct asn1_data *data, void *p, int len); bool asn1_read_uint8(struct asn1_data *data, uint8_t *v); bool asn1_peek_uint8(struct asn1_data *data, uint8_t *v); -bool asn1_peek_tag_needed_size(struct asn1_data *data, uint8_t tag, size_t *size); bool asn1_peek_tag(struct asn1_data *data, uint8_t tag); bool asn1_start_tag(struct asn1_data *data, uint8_t tag); bool asn1_end_tag(struct asn1_data *data); diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index 7eb5dff..4709c03 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -2275,59 +2275,12 @@ fail: } /******************************************************** - Resolve via "lmhosts" method. -*********************************************************/ - -static NTSTATUS resolve_lmhosts(const char *name, int name_type, - struct ip_service **return_iplist, - int *return_count) -{ - /* - * "lmhosts" means parse the local lmhosts file. - */ - struct sockaddr_storage *ss_list; - NTSTATUS status = NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND; - TALLOC_CTX *ctx = NULL; - - *return_iplist = NULL; - *return_count = 0; - - DEBUG(3,("resolve_lmhosts: " - "Attempting lmhosts lookup for name %s<0x%x>\n", - name, name_type)); - - ctx = talloc_init("resolve_lmhosts"); - if (!ctx) { - return NT_STATUS_NO_MEMORY; - } - - status = resolve_lmhosts_file_as_sockaddr(get_dyn_LMHOSTSFILE(), - name, name_type, - ctx, - &ss_list, - return_count); - if (NT_STATUS_IS_OK(status)) { - if (convert_ss2service(return_iplist, - ss_list, - return_count)) { - talloc_free(ctx); - return NT_STATUS_OK; - } else { - talloc_free(ctx); - return NT_STATUS_NO_MEMORY; - } - } - talloc_free(ctx); - return status; -} - - -/******************************************************** Resolve via "hosts" method. *********************************************************/ static NTSTATUS resolve_hosts(const char *name, int name_type, - struct ip_service **return_iplist, + TALLOC_CTX *mem_ctx, + struct sockaddr_storage **return_iplist, int *return_count) { /* @@ -2388,16 +2341,15 @@ static NTSTATUS resolve_hosts(const char *name, int name_type, *return_count += 1; - *return_iplist = SMB_REALLOC_ARRAY(*return_iplist, - struct ip_service, - *return_count); + *return_iplist = talloc_realloc( + mem_ctx, *return_iplist, struct sockaddr_storage, + *return_count); if (!*return_iplist) { DEBUG(3,("resolve_hosts: malloc fail !\n")); freeaddrinfo(ailist); return NT_STATUS_NO_MEMORY; } - (*return_iplist)[i].ss = ss; - (*return_iplist)[i].port = PORT_NONE; + (*return_iplist)[i] = ss; i++; } if (ailist) { @@ -2715,9 +2667,16 @@ NTSTATUS internal_resolve_name(const char *name, tok = resolve_order[i]; if((strequal(tok, "host") || strequal(tok, "hosts"))) { - status = resolve_hosts(name, name_type, return_iplist, + struct sockaddr_storage *ss_list; + status = resolve_hosts(name, name_type, + talloc_tos(), &ss_list, return_count); if (NT_STATUS_IS_OK(status)) { + if (!convert_ss2service(return_iplist, + ss_list, + return_count)) { + status = NT_STATUS_NO_MEMORY; + } goto done; } } else if(strequal( tok, "kdc")) { @@ -2740,9 +2699,16 @@ NTSTATUS internal_resolve_name(const char *name, goto done; } } else if (strequal(tok, "lmhosts")) { - status = resolve_lmhosts(name, name_type, - return_iplist, return_count); + struct sockaddr_storage *ss_list; + status = resolve_lmhosts_file_as_sockaddr( + get_dyn_LMHOSTSFILE(), name, name_type, + talloc_tos(), &ss_list, return_count); if (NT_STATUS_IS_OK(status)) { + if (!convert_ss2service(return_iplist, + ss_list, + return_count)) { + status = NT_STATUS_NO_MEMORY; + } goto done; } } else if (strequal(tok, "wins")) { diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c index d1673a4..93bca9c 100644 --- a/source3/modules/vfs_shadow_copy2.c +++ b/source3/modules/vfs_shadow_copy2.c @@ -1900,11 +1900,12 @@ static int shadow_copy2_connect(struct vfs_handle_struct *handle, char *p; p = strstr(handle->conn->connectpath, mount_point); if (p != handle->conn->connectpath) { - DEBUG(1, ("Warning: mount_point (%s) is not a " - "subdirectory of the share root " - "(%s). Ignoring provided value.\n", - mount_point, - handle->conn->connectpath)); + DBG_WARNING("Warning: the share root (%s) is " + "not a subdirectory of the " + "specified mountpoint (%s). " + "Ignoring provided value.\n", + handle->conn->connectpath, + mount_point); mount_point = NULL; } } diff --git a/source3/winbindd/idmap_nss.c b/source3/winbindd/idmap_nss.c index e65a499..24f8217 100644 --- a/source3/winbindd/idmap_nss.c +++ b/source3/winbindd/idmap_nss.c @@ -30,16 +30,16 @@ #define DBGC_CLASS DBGC_IDMAP /***************************** - Initialise idmap database. + Initialise idmap database. *****************************/ static NTSTATUS idmap_nss_int_init(struct idmap_domain *dom) -{ +{ return NT_STATUS_OK; } /********************************** - lookup a set of unix ids. + lookup a set of unix ids. **********************************/ static NTSTATUS idmap_nss_unixids_to_sids(struct idmap_domain *dom, struct id_map **ids) @@ -120,7 +120,7 @@ static NTSTATUS idmap_nss_unixids_to_sids(struct idmap_domain *dom, struct id_ma } /********************************** - lookup a set of sids. + lookup a set of sids. **********************************/ static NTSTATUS idmap_nss_sids_to_unixids(struct idmap_domain *dom, struct id_map **ids) diff --git a/source3/winbindd/idmap_rid.c b/source3/winbindd/idmap_rid.c index d6c649b..d68dbf7 100644 --- a/source3/winbindd/idmap_rid.c +++ b/source3/winbindd/idmap_rid.c @@ -94,7 +94,7 @@ static NTSTATUS idmap_rid_id_to_sid(struct idmap_domain *dom, struct id_map *map } /********************************** - Single sid to id lookup function. + Single sid to id lookup function. **********************************/ static NTSTATUS idmap_rid_sid_to_id(struct idmap_domain *dom, struct id_map *map) @@ -123,7 +123,7 @@ static NTSTATUS idmap_rid_sid_to_id(struct idmap_domain *dom, struct id_map *map } /********************************** - lookup a set of unix ids. + lookup a set of unix ids. **********************************/ static NTSTATUS idmap_rid_unixids_to_sids(struct idmap_domain *dom, struct id_map **ids) @@ -151,7 +151,7 @@ static NTSTATUS idmap_rid_unixids_to_sids(struct idmap_domain *dom, struct id_ma } /********************************** - lookup a set of sids. + lookup a set of sids. **********************************/ static NTSTATUS idmap_rid_sids_to_unixids(struct idmap_domain *dom, struct id_map **ids) diff --git a/source3/winbindd/idmap_util.c b/source3/winbindd/idmap_util.c index dc7d37c..f90565f 100644 --- a/source3/winbindd/idmap_util.c +++ b/source3/winbindd/idmap_util.c @@ -32,7 +32,7 @@ /***************************************************************** Returns the SID mapped to the given UID. If mapping is not possible returns an error. -*****************************************************************/ +*****************************************************************/ NTSTATUS idmap_uid_to_sid(struct dom_sid *sid, uid_t uid) { @@ -95,7 +95,7 @@ backend: /***************************************************************** Returns SID mapped to the given GID. If mapping is not possible returns an error. -*****************************************************************/ +*****************************************************************/ NTSTATUS idmap_gid_to_sid(struct dom_sid *sid, gid_t gid) { diff --git a/source3/winbindd/wb_sids2xids.c b/source3/winbindd/wb_sids2xids.c index e3962de..940a06b 100644 --- a/source3/winbindd/wb_sids2xids.c +++ b/source3/winbindd/wb_sids2xids.c @@ -184,16 +184,22 @@ static void wb_sids2xids_lookupsids_done(struct tevent_req *subreq) struct lsa_DomainInfo *info; struct lsa_TranslatedName *n = &names->names[i]; struct wbint_TransID *t = &state->ids.ids[i]; + int domain_index; sid_copy(&dom_sid, &state->non_cached[i]); sid_split_rid(&dom_sid, &t->rid); info = &domains->domains[n->sid_index]; t->type = lsa_SidType_to_id_type(n->sid_type); - t->domain_index = init_lsa_ref_domain_list(state, - state->idmap_doms, - info->name.string, - &dom_sid); + + domain_index = init_lsa_ref_domain_list( + state, state->idmap_doms, info->name.string, &dom_sid); + if (domain_index == -1) { + tevent_req_oom(req); + return; + } + t->domain_index = domain_index; + t->xid.id = UINT32_MAX; t->xid.type = t->type; } diff --git a/source4/libcli/ldap/ldap_client.c b/source4/libcli/ldap/ldap_client.c index 94367a1..4b8f951 100644 --- a/source4/libcli/ldap/ldap_client.c +++ b/source4/libcli/ldap/ldap_client.c @@ -223,7 +223,7 @@ static void ldap_connection_recv_next(struct ldap_connection *conn) } /* - * The minimun size of a LDAP pdu is 7 bytes + * The minimum size of a LDAP pdu is 7 bytes * * dumpasn1 -hh ldap-unbind-min.dat * -- Samba Shared Repository