Changeset 988 for vendor/current/source4/utils/oLschema2ldif.c
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source4/utils/oLschema2ldif.c
r740 r988 34 34 #include "includes.h" 35 35 #include "ldb.h" 36 #include "tools/cmdline.h"37 36 #include "dsdb/samdb/samdb.h" 38 37 #include "../lib/crypto/sha256.h" … … 83 82 if (c == NULL) return 1; 84 83 if (*c == '(') b++; 85 if (*c == ')') b--; 84 if (*c == ')') { 85 b--; 86 if (*(c - 1) != ' ' && c && (*(c + 1) == '\0')) { 87 return 2; 88 } 89 } 86 90 c++; 87 91 } … … 349 353 350 354 ctx = talloc_new(mem_ctx); 355 if (ctx == NULL) { 356 return NULL; 357 } 351 358 msg = ldb_msg_new(ctx); 359 if (msg == NULL) { 360 goto failed; 361 } 352 362 353 363 ldb_msg_add_string(msg, "objectClass", "top"); … … 393 403 } 394 404 395 SHA256_Init(&sha256_context);396 SHA256_Update(&sha256_context, (uint8_t*)s, strlen(s));397 SHA256_Final(digest, &sha256_context);405 samba_SHA256_Init(&sha256_context); 406 samba_SHA256_Update(&sha256_context, (uint8_t*)s, strlen(s)); 407 samba_SHA256_Final(digest, &sha256_context); 398 408 399 409 memcpy(&guid, digest, sizeof(struct GUID)); … … 539 549 do { 540 550 if (c == '\n') { 541 entry[t] = '\0'; 542 if (check_braces(entry) == 0) { 551 int ret2 = 0; 552 entry[t] = '\0'; 553 ret2 = check_braces(entry); 554 if (ret2 == 0) { 543 555 ret.count++; 544 556 ldif.msg = process_entry(ctx, entry); … … 549 561 } 550 562 ldb_ldif_write_file(ldb_ctx, out, &ldif); 563 break; 564 } 565 if (ret2 == 2) { 566 fprintf(stderr, "Invalid entry %s, closing braces need to be preceded by a space\n", entry); 567 ret.failures++; 551 568 break; 552 569 }
Note:
See TracChangeset
for help on using the changeset viewer.