Ignore:
Timestamp:
Nov 24, 2016, 1:14:11 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source4/utils/oLschema2ldif.c

    r740 r988  
    3434#include "includes.h"
    3535#include "ldb.h"
    36 #include "tools/cmdline.h"
    3736#include "dsdb/samdb/samdb.h"
    3837#include "../lib/crypto/sha256.h"
     
    8382                if (c == NULL) return 1;
    8483                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                }
    8690                c++;
    8791        }
     
    349353
    350354        ctx = talloc_new(mem_ctx);
     355        if (ctx == NULL) {
     356                return NULL;
     357        }
    351358        msg = ldb_msg_new(ctx);
     359        if (msg == NULL) {
     360                goto failed;
     361        }
    352362
    353363        ldb_msg_add_string(msg, "objectClass", "top");
     
    393403        }
    394404
    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);
    398408
    399409        memcpy(&guid, digest, sizeof(struct GUID));
     
    539549                do {
    540550                        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) {
    543555                                        ret.count++;
    544556                                        ldif.msg = process_entry(ctx, entry);
     
    549561                                        }
    550562                                        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++;
    551568                                        break;
    552569                                }
Note: See TracChangeset for help on using the changeset viewer.