BUG: https://bugzilla.samba.org/show_bug.cgi?id=13577
Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit
bdab834dfad55776155915f7ec410b5a192406fa)
return W_ERROR(NERR_BadOfflineJoinInfo);
}
+ /*
+ * Windows produces and consumes UTF16/UCS2 encoded blobs. Check for the
+ * unicode BOM mark and convert back to UNIX charset if necessary.
+ */
if (r->in.provision_bin_data[0] == 0xff &&
r->in.provision_bin_data[1] == 0xfe) {
ok = convert_string_talloc(ctx, CH_UTF16LE, CH_UNIX,
DATA_BLOB ucs2_blob, blob;
bool ok;
+ /*
+ * Windows produces and consumes UTF16/UCS2 encoded blobs
+ * so we also do it for compatibility. Someone may provision an
+ * account for a Windows machine with samba.
+ */
ok = push_reg_sz(c, &ucs2_blob, provision_text_data);
if (!ok) {
return -1;
}
+ /* Add the unicode BOM mark */
blob = data_blob_talloc(c, NULL, ucs2_blob.length + 2);
blob.data[0] = 0xff;