Fix LDAP backend with python
[samba.git] / source4 / scripting / ejs / smbcalls_data.c
index 60dadc51658c1c963e6da0c4594d4b6284603524..3ea41d46fb4d3038d100815f68d991ce039afe51 100644 (file)
@@ -107,7 +107,7 @@ failed:
 static int ejs_blobCompare(MprVarHandle eid, int argc, struct MprVar **argv)
 {
        DATA_BLOB *blob1, *blob2;
-       BOOL ret = False;
+       bool ret = false;
 
        if (argc != 2) {
                ejsSetErrorMsg(eid, "blobCompare invalid arguments");
@@ -118,24 +118,24 @@ static int ejs_blobCompare(MprVarHandle eid, int argc, struct MprVar **argv)
        blob2 = mprToDataBlob(argv[1]);
 
        if (blob1 == blob2) {
-               ret = True;
+               ret = true;
                goto done;
        }
        if (blob1 == NULL || blob2 == NULL) {
-               ret = False;
+               ret = false;
                goto done;
        }
 
        if (blob1->length != blob2->length) {
-               ret = False;
+               ret = false;
                goto done;
        }
 
        if (memcmp(blob1->data, blob2->data, blob1->length) != 0) {
-               ret = False;
+               ret = false;
                goto done;
        }
-       ret = True;
+       ret = true;
 
 done:
        mpr_Return(eid, mprCreateBoolVar(ret));
@@ -177,7 +177,7 @@ static int ejs_regToVar(MprVarHandle eid, int argc, struct MprVar **argv)
        case REG_EXPAND_SZ: {
                char *s;
                ssize_t len;
-               len = convert_string_talloc(mprMemCtx(), CH_UTF16, CH_UNIX, 
+               len = convert_string_talloc(mprMemCtx(), lp_iconv_convenience(global_loadparm), CH_UTF16, CH_UNIX, 
                                            blob->data, blob->length, (void **)&s);
                if (len == -1) {
                        ejsSetErrorMsg(eid, "regToVar invalid REG_SZ string");
@@ -225,7 +225,7 @@ static int ejs_regToVar(MprVarHandle eid, int argc, struct MprVar **argv)
                        if (slen == 2 && b.length == 2 && SVAL(b.data, 0) == 0) {
                                break;
                        }
-                       len = convert_string_talloc(mprMemCtx(), CH_UTF16, CH_UNIX, 
+                       len = convert_string_talloc(mprMemCtx(), lp_iconv_convenience(global_loadparm), CH_UTF16, CH_UNIX, 
                                                    b.data, slen, (void **)&s);
                        if (len == -1) {
                                ejsSetErrorMsg(eid, "regToVar invalid REG_MULTI_SZ string");