From: Volker Lendecke Date: Mon, 28 Nov 2022 07:35:57 +0000 (+0100) Subject: lib: Fix whitespace X-Git-Tag: talloc-2.4.0~257 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7870e82cb4405a983f106a119203f1e193cb2f12;p=thirdparty%2Fsamba.git lib: Fix whitespace Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/lib/ldb-samba/ldif_handlers.c b/lib/ldb-samba/ldif_handlers.c index 78a433748bb..fa05168d36a 100644 --- a/lib/ldb-samba/ldif_handlers.c +++ b/lib/ldb-samba/ldif_handlers.c @@ -1,4 +1,4 @@ -/* +/* ldb database library - ldif handlers for Samba Copyright (C) Andrew Tridgell 2005 @@ -7,7 +7,7 @@ ** NOTE! The following LGPL license applies to the ldb ** library. This does NOT imply that all of Samba is released ** under the LGPL - + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either @@ -59,7 +59,7 @@ static int ldif_write_NDR(struct ldb_context *ldb, void *mem_ctx, return ldb_handler_copy(ldb, mem_ctx, in, out); } p = talloc_size(mem_ctx, struct_size); - err = ndr_pull_struct_blob(in, mem_ctx, + err = ndr_pull_struct_blob(in, mem_ctx, p, pull_fn); if (err != NDR_ERR_SUCCESS) { /* fail in not in mask_error mode */ @@ -74,7 +74,7 @@ static int ldif_write_NDR(struct ldb_context *ldb, void *mem_ctx, out->data = (uint8_t *)ndr_print_struct_string(mem_ctx, print_fn, "NDR", p); talloc_free(p); if (out->data == NULL) { - return ldb_handler_copy(ldb, mem_ctx, in, out); + return ldb_handler_copy(ldb, mem_ctx, in, out); } out->length = strlen((char *)out->data); return 0; @@ -95,18 +95,18 @@ static int ldif_read_objectSid(struct ldb_context *ldb, void *mem_ctx, char p[in->length+1]; memcpy(p, in->data, in->length); p[in->length] = '\0'; - + ret = dom_sid_parse(p, &sid); if (ret == false) { return -1; } - + *out = data_blob_talloc(mem_ctx, NULL, ndr_size_dom_sid(&sid, 0)); if (out->data == NULL) { return -1; } - + ndr_err = ndr_push_struct_into_fixed_blob(out, &sid, (ndr_push_flags_fn_t)ndr_push_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -144,7 +144,7 @@ bool ldif_comparision_objectSid_isString(const struct ldb_val *v) } if (strncmp("S-", (const char *)v->data, 2) != 0) return false; - + return true; } @@ -208,7 +208,7 @@ static int extended_dn_read_SID(struct ldb_context *ldb, void *mem_ctx, return 0; } } - + /* Perhaps not a string after all */ *out = data_blob_talloc(mem_ctx, NULL, in->length/2+1); @@ -290,13 +290,13 @@ static int extended_dn_read_GUID(struct ldb_context *ldb, void *mem_ctx, if (in->length != 32) { return -1; } - + *out = data_blob_talloc(mem_ctx, NULL, in->length/2+1); - + if (!out->data) { return -1; } - + (*out).length = strhex_to_str((char *)out->data, out->length, (const char *)in->data, in->length); @@ -407,12 +407,12 @@ static int ldif_write_ntSecurityDescriptor(struct ldb_context *ldb, void *mem_ct enum ndr_err_code ndr_err; if (ldb_get_flags(ldb) & LDB_FLG_SHOW_BINARY) { - return ldif_write_NDR(ldb, mem_ctx, in, out, + return ldif_write_NDR(ldb, mem_ctx, in, out, sizeof(struct security_descriptor), (ndr_pull_flags_fn_t)ndr_pull_security_descriptor, (ndr_print_fn_t)ndr_print_security_descriptor, true); - + } sd = talloc(mem_ctx, struct security_descriptor); @@ -457,7 +457,7 @@ static int ldif_write_sddlSecurityDescriptor(struct ldb_context *ldb, void *mem_ return ldb_handler_copy(ldb, mem_ctx, in, out); } -/* +/* canonicalise an objectCategory. We use the long form as the canonical form: 'person' becomes cn=Person,cn=Schema,cn=Configuration, @@ -588,7 +588,7 @@ static int ldif_read_prefixMap(struct ldb_context *ldb, void *mem_ctx, /* If this does not parse, then it is probably the text version, and we should try it that way */ blob->version = PREFIX_MAP_VERSION_DSDB; - + string = talloc_strndup(mem_ctx, (const char *)in->data, in->length); if (string == NULL) { talloc_free(blob); @@ -612,9 +612,9 @@ static int ldif_read_prefixMap(struct ldb_context *ldb, void *mem_ctx, if (line == p) { break; } - - blob->ctr.dsdb.mappings = talloc_realloc(blob, - blob->ctr.dsdb.mappings, + + blob->ctr.dsdb.mappings = talloc_realloc(blob, + blob->ctr.dsdb.mappings, struct drsuapi_DsReplicaOIDMapping, blob->ctr.dsdb.num_mappings+1); if (!blob->ctr.dsdb.mappings) { @@ -650,7 +650,7 @@ static int ldif_read_prefixMap(struct ldb_context *ldb, void *mem_ctx, } } - ndr_err = ndr_push_struct_blob(out, mem_ctx, + ndr_err = ndr_push_struct_blob(out, mem_ctx, blob, (ndr_push_flags_fn_t)ndr_push_prefixMapBlob); talloc_free(tmp_ctx); @@ -694,7 +694,7 @@ static int ldif_write_prefixMap(struct ldb_context *ldb, void *mem_ctx, if (blob == NULL) { return -1; } - ndr_err = ndr_pull_struct_blob_all(in, blob, + ndr_err = ndr_pull_struct_blob_all(in, blob, blob, (ndr_pull_flags_fn_t)ndr_pull_prefixMapBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -713,7 +713,7 @@ static int ldif_write_prefixMap(struct ldb_context *ldb, void *mem_ctx, char *partial_oid = NULL; if (i > 0) { - string = talloc_asprintf_append(string, ";"); + string = talloc_asprintf_append(string, ";"); } oid_blob = data_blob_const(blob->ctr.dsdb.mappings[i].oid.binary_oid, @@ -723,7 +723,7 @@ static int ldif_write_prefixMap(struct ldb_context *ldb, void *mem_ctx, blob->ctr.dsdb.mappings[i].id_prefix)); goto failed; } - string = talloc_asprintf_append(string, "%u:%s", + string = talloc_asprintf_append(string, "%u:%s", blob->ctr.dsdb.mappings[i].id_prefix, partial_oid); talloc_free(discard_const(partial_oid)); @@ -750,7 +750,7 @@ static bool ldif_comparision_prefixMap_isString(const struct ldb_val *v) if (IVAL(v->data, 0) == PREFIX_MAP_VERSION_DSDB) { return false; } - + return true; } @@ -947,7 +947,7 @@ static int ldif_comparison_int64(struct ldb_context *ldb, void *mem_ctx, static int ldif_write_repsFromTo(struct ldb_context *ldb, void *mem_ctx, const struct ldb_val *in, struct ldb_val *out) { - return ldif_write_NDR(ldb, mem_ctx, in, out, + return ldif_write_NDR(ldb, mem_ctx, in, out, sizeof(struct repsFromToBlob), (ndr_pull_flags_fn_t)ndr_pull_repsFromToBlob, (ndr_print_fn_t)ndr_print_repsFromToBlob, @@ -960,7 +960,7 @@ static int ldif_write_repsFromTo(struct ldb_context *ldb, void *mem_ctx, static int ldif_write_replPropertyMetaData(struct ldb_context *ldb, void *mem_ctx, const struct ldb_val *in, struct ldb_val *out) { - return ldif_write_NDR(ldb, mem_ctx, in, out, + return ldif_write_NDR(ldb, mem_ctx, in, out, sizeof(struct replPropertyMetaDataBlob), (ndr_pull_flags_fn_t)ndr_pull_replPropertyMetaDataBlob, (ndr_print_fn_t)ndr_print_replPropertyMetaDataBlob, @@ -973,7 +973,7 @@ static int ldif_write_replPropertyMetaData(struct ldb_context *ldb, void *mem_ct static int ldif_write_replUpToDateVector(struct ldb_context *ldb, void *mem_ctx, const struct ldb_val *in, struct ldb_val *out) { - return ldif_write_NDR(ldb, mem_ctx, in, out, + return ldif_write_NDR(ldb, mem_ctx, in, out, sizeof(struct replUpToDateVectorBlob), (ndr_pull_flags_fn_t)ndr_pull_replUpToDateVectorBlob, (ndr_print_fn_t)ndr_print_replUpToDateVectorBlob, @@ -1314,7 +1314,7 @@ static int samba_syntax_operator_fn(struct ldb_context *ldb, enum ldb_parse_op o /* compare two binary objects. This is correct for sorting as the sort order is: - + a aa b @@ -1326,7 +1326,7 @@ static int samba_syntax_operator_fn(struct ldb_context *ldb, enum ldb_parse_op o b aa bb - + */ static int samba_ldb_comparison_binary(struct ldb_context *ldb, void *mem_ctx, const struct ldb_val *v1, const struct ldb_val *v2) @@ -1749,7 +1749,7 @@ const struct ldb_schema_syntax *ldb_samba_syntax_by_name(struct ldb_context *ldb { unsigned int j; const struct ldb_schema_syntax *s = NULL; - + for (j=0; j < ARRAY_SIZE(samba_syntaxes); j++) { if (strcmp(name, samba_syntaxes[j].name) == 0) { s = &samba_syntaxes[j]; @@ -1770,7 +1770,7 @@ const struct ldb_schema_syntax *ldb_samba_syntax_by_lDAPDisplayName(struct ldb_c break; } } - + return s; } diff --git a/lib/ldb/modules/rdn_name.c b/lib/ldb/modules/rdn_name.c index 3cb62bf567b..d90b8a52347 100644 --- a/lib/ldb/modules/rdn_name.c +++ b/lib/ldb/modules/rdn_name.c @@ -1,4 +1,4 @@ -/* +/* ldb database library Copyright (C) Andrew Bartlett 2005-2009 @@ -7,7 +7,7 @@ ** NOTE! The following LGPL license applies to the ldb ** library. This does NOT imply that all of Samba is released ** under the LGPL - + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either @@ -116,7 +116,7 @@ static int rdn_name_add(struct ldb_module *module, struct ldb_request *req) if (rdn_name == NULL) { return LDB_ERR_OPERATIONS_ERROR; } - + rdn_val_p = ldb_dn_get_rdn_val(msg->dn); if (rdn_val_p == NULL) { return LDB_ERR_OPERATIONS_ERROR; @@ -176,13 +176,13 @@ static int rdn_name_add(struct ldb_module *module, struct ldb_request *req) } if (i == attribute->num_values) { char *rdn_errstring = talloc_asprintf(ac, - "RDN mismatch on %s: %s (%.*s) should match one of:", - ldb_dn_get_linearized(msg->dn), rdn_name, + "RDN mismatch on %s: %s (%.*s) should match one of:", + ldb_dn_get_linearized(msg->dn), rdn_name, (int)rdn_val.length, (const char *)rdn_val.data); for (i = 0; i < attribute->num_values; i++) { rdn_errstring = talloc_asprintf_append( rdn_errstring, " (%.*s)", - (int)attribute->values[i].length, + (int)attribute->values[i].length, (const char *)attribute->values[i].data); } ldb_set_errstring(ldb, rdn_errstring); diff --git a/lib/util/util_strlist.c b/lib/util/util_strlist.c index b56e17379cb..08a23dd60f2 100644 --- a/lib/util/util_strlist.c +++ b/lib/util/util_strlist.c @@ -1,19 +1,19 @@ -/* +/* Unix SMB/CIFS implementation. - + Copyright (C) Andrew Tridgell 2005 Copyright (C) Jelmer Vernooij 2005 - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -84,7 +84,7 @@ _PUBLIC_ char **str_list_make(TALLOC_CTX *mem_ctx, const char *string, const cha while (string && *string) { size_t len = strcspn(string, sep); char **ret2; - + if (len == 0) { string += strspn(string, sep); continue; @@ -114,7 +114,7 @@ _PUBLIC_ char **str_list_make(TALLOC_CTX *mem_ctx, const char *string, const cha } /** - * build a null terminated list of strings from an argv-like input string + * build a null terminated list of strings from an argv-like input string * Entries are separated by spaces and can be enclosed by quotes. * Does NOT support escaping */ @@ -135,7 +135,7 @@ _PUBLIC_ char **str_list_make_shell(TALLOC_CTX *mem_ctx, const char *string, con size_t len = strcspn(string, sep); char *element; char **ret2; - + if (len == 0) { string += strspn(string, sep); continue; @@ -163,7 +163,7 @@ _PUBLIC_ char **str_list_make_shell(TALLOC_CTX *mem_ctx, const char *string, con } ret = ret2; - ret[num_elements] = element; + ret[num_elements] = element; num_elements++; } @@ -175,13 +175,13 @@ _PUBLIC_ char **str_list_make_shell(TALLOC_CTX *mem_ctx, const char *string, con } /** - * join a list back to one string + * join a list back to one string */ _PUBLIC_ char *str_list_join(TALLOC_CTX *mem_ctx, const char **list, char separator) { char *ret = NULL; int i; - + if (list[0] == NULL) return talloc_strdup(mem_ctx, ""); @@ -194,25 +194,25 @@ _PUBLIC_ char *str_list_join(TALLOC_CTX *mem_ctx, const char **list, char separa return ret; } -/** join a list back to one (shell-like) string; entries +/** join a list back to one (shell-like) string; entries * separated by spaces, using quotes where necessary */ _PUBLIC_ char *str_list_join_shell(TALLOC_CTX *mem_ctx, const char **list, char sep) { char *ret = NULL; int i; - + if (list[0] == NULL) return talloc_strdup(mem_ctx, ""); - if (strchr(list[0], ' ') || strlen(list[0]) == 0) + if (strchr(list[0], ' ') || strlen(list[0]) == 0) ret = talloc_asprintf(mem_ctx, "\"%s\"", list[0]); - else + else ret = talloc_strdup(mem_ctx, list[0]); for (i = 1; list[i]; i++) { - if (strchr(list[i], ' ') || strlen(list[i]) == 0) + if (strchr(list[i], ' ') || strlen(list[i]) == 0) ret = talloc_asprintf_append_buffer(ret, "%c\"%s\"", sep, list[i]); - else + else ret = talloc_asprintf_append_buffer(ret, "%c%s", sep, list[i]); } @@ -240,9 +240,9 @@ _PUBLIC_ char **str_list_copy(TALLOC_CTX *mem_ctx, const char **list) if (list == NULL) return NULL; - + ret = talloc_array(mem_ctx, char *, str_list_length(list)+1); - if (ret == NULL) + if (ret == NULL) return NULL; for (i=0;list && list[i];i++) { @@ -263,11 +263,11 @@ _PUBLIC_ bool str_list_equal(const char * const *list1, const char * const *list2) { int i; - + if (list1 == NULL || list2 == NULL) { - return (list1 == list2); + return (list1 == list2); } - + for (i=0;list1[i] && list2[i];i++) { if (strcmp(list1[i], list2[i]) != 0) { return false; @@ -547,9 +547,9 @@ _PUBLIC_ const char **str_list_copy_const(TALLOC_CTX *mem_ctx, if (list == NULL) return NULL; - + ret = talloc_array(mem_ctx, const char *, str_list_length(list)+1); - if (ret == NULL) + if (ret == NULL) return NULL; for (i=0;list && list[i];i++) { diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c index 09cf898ddff..da9101305a8 100644 --- a/source3/lib/substitute.c +++ b/source3/lib/substitute.c @@ -1,4 +1,4 @@ -/* +/* Unix SMB/CIFS implementation. string substitution functions Copyright (C) Andrew Tridgell 1992-2000 @@ -324,7 +324,7 @@ char *talloc_sub_basic(TALLOC_CTX *mem_ctx, b = a_string; switch (*(p+1)) { - case 'U' : + case 'U' : r = strlower_talloc(tmp_ctx, smb_name); if (r == NULL) { goto error; @@ -391,7 +391,7 @@ char *talloc_sub_basic(TALLOC_CTX *mem_ctx, a_string = realloc_string_sub(a_string, "%J", r); break; } - case 'i': + case 'i': a_string = realloc_string_sub( a_string, "%i", sub_sockaddr[0] ? sub_sockaddr : "0.0.0.0"); @@ -403,12 +403,12 @@ char *talloc_sub_basic(TALLOC_CTX *mem_ctx, a_string = realloc_string_sub(a_string, "%j", r); break; } - case 'L' : + case 'L' : if ( strncasecmp_m(p, "%LOGONSERVER%", strlen("%LOGONSERVER%")) == 0 ) { break; } if (local_machine_name && *local_machine_name) { - a_string = realloc_string_sub(a_string, "%L", local_machine_name); + a_string = realloc_string_sub(a_string, "%L", local_machine_name); } else { a_string = realloc_string_sub(a_string, "%L", lp_netbios_name()); } @@ -460,7 +460,7 @@ char *talloc_sub_basic(TALLOC_CTX *mem_ctx, slprintf(vnnstr,sizeof(vnnstr)-1, "%u", get_my_vnn()); a_string = realloc_string_sub(a_string, "%V", vnnstr); break; - default: + default: break; } @@ -516,11 +516,11 @@ char *talloc_sub_specified(TALLOC_CTX *mem_ctx, b = a_string; switch (*(p+1)) { - case 'U' : + case 'U' : a_string = talloc_string_sub( tmp_ctx, a_string, "%U", username); break; - case 'u' : + case 'u' : a_string = talloc_string_sub( tmp_ctx, a_string, "%u", username); break; @@ -571,7 +571,7 @@ char *talloc_sub_specified(TALLOC_CTX *mem_ctx, a_string = talloc_string_sub(tmp_ctx, a_string, "%N", lp_netbios_name()); break; - default: + default: break; } @@ -627,19 +627,19 @@ char *talloc_sub_advanced(TALLOC_CTX *ctx, TALLOC_FREE(h); break; } - case 'P': - a_string = realloc_string_sub(a_string, "%P", connectpath); + case 'P': + a_string = realloc_string_sub(a_string, "%P", connectpath); break; - case 'S': + case 'S': a_string = realloc_string_sub(a_string, "%S", servicename); break; - case 'g': - a_string = realloc_string_sub(a_string, "%g", gidtoname(gid)); + case 'g': + a_string = realloc_string_sub(a_string, "%g", gidtoname(gid)); break; - case 'u': - a_string = realloc_string_sub(a_string, "%u", user); + case 'u': + a_string = realloc_string_sub(a_string, "%u", user); break; - default: + default: break; } diff --git a/source3/libads/ldap_schema.c b/source3/libads/ldap_schema.c index d8192e055f2..85b322c1fe2 100644 --- a/source3/libads/ldap_schema.c +++ b/source3/libads/ldap_schema.c @@ -1,19 +1,19 @@ -/* +/* Unix SMB/CIFS implementation. ads (active directory) utility library Copyright (C) Guenther Deschner 2005-2007 Copyright (C) Gerald (Jerry) Carter 2006 - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -40,7 +40,7 @@ static ADS_STATUS ads_get_attrnames_by_oids(ADS_STRUCT *ads, char *expr = NULL; const char *attrs[] = { "lDAPDisplayName", "attributeId", NULL }; int i = 0, p = 0; - + if (!ads || !mem_ctx || !names || !count || !OIDs || !OIDs_out) { return ADS_ERROR(LDAP_PARAM_ERROR); } @@ -55,7 +55,7 @@ static ADS_STATUS ads_get_attrnames_by_oids(ADS_STRUCT *ads, for (i=0; iposix_uidnumber_attr = talloc_strdup(schema, names_out[i]); - continue; + continue; } if (strequal(ADS_ATTR_RFC2307_GIDNUMBER_OID, oids_out[i]) || strequal(ADS_ATTR_SFU_GIDNUMBER_OID, oids_out[i]) || strequal(ADS_ATTR_SFU20_GIDNUMBER_OID, oids_out[i])) { schema->posix_gidnumber_attr = talloc_strdup(schema, names_out[i]); - continue; + continue; } if (strequal(ADS_ATTR_RFC2307_HOMEDIR_OID, oids_out[i]) || strequal(ADS_ATTR_SFU_HOMEDIR_OID, oids_out[i]) || strequal(ADS_ATTR_SFU20_HOMEDIR_OID, oids_out[i])) { schema->posix_homedir_attr = talloc_strdup(schema, names_out[i]); - continue; + continue; } if (strequal(ADS_ATTR_RFC2307_SHELL_OID, oids_out[i]) || strequal(ADS_ATTR_SFU_SHELL_OID, oids_out[i]) || strequal(ADS_ATTR_SFU20_SHELL_OID, oids_out[i])) { schema->posix_shell_attr = talloc_strdup(schema, names_out[i]); - continue; + continue; } if (strequal(ADS_ATTR_RFC2307_GECOS_OID, oids_out[i]) || @@ -342,14 +342,14 @@ ADS_STATUS ads_check_posix_schema_mapping(TALLOC_CTX *mem_ctx, !schema->posix_shell_attr || !schema->posix_gecos_attr) { status = ADS_ERROR(LDAP_NO_MEMORY); - TALLOC_FREE( schema ); + TALLOC_FREE( schema ); goto done; } *s = schema; - + status = ADS_ERROR(LDAP_SUCCESS); - + done: TALLOC_FREE(ctx); diff --git a/source3/winbindd/winbindd_misc.c b/source3/winbindd/winbindd_misc.c index 3155a2224de..bed4e422796 100644 --- a/source3/winbindd/winbindd_misc.c +++ b/source3/winbindd/winbindd_misc.c @@ -1,4 +1,4 @@ -/* +/* Unix SMB/CIFS implementation. Winbind daemon - miscellaneous other functions @@ -228,7 +228,7 @@ bool winbindd_list_trusted_domains(struct winbindd_cli_state *state) for ( i = 0; i < num_domains; i++ ) { struct winbindd_domain *domain; - bool is_online = true; + bool is_online = true; struct winbindd_tdc_domain *d = NULL; char *trust_type = NULL; struct dom_sid_buf buf;