summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-07-23 09:14:39 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-07-24 10:46:12 +1000
commit9521cd0409add2628352ee5ef888c5a8a90fbb27 (patch)
treefd5fe74cd7052462902bd6ca52eb2bed2be4b122
parent69e98ff86c4e90d2259b7a4ea93e45e2ec426bc3 (diff)
downloadsamba-9521cd0409add2628352ee5ef888c5a8a90fbb27.tar.gz
samba-9521cd0409add2628352ee5ef888c5a8a90fbb27.tar.bz2
samba-9521cd0409add2628352ee5ef888c5a8a90fbb27.zip
param: Make the 'unicode' parameter common
This parameter is most useful for interop testing, rather than production use. Andrew Bartlett
-rw-r--r--lib/param/loadparm.c1
-rw-r--r--lib/param/param_functions.c1
-rw-r--r--source3/include/proto.h1
-rw-r--r--source3/libsmb/clientgen.c3
-rw-r--r--source3/param/loadparm.c9
-rw-r--r--source3/smbd/negprot.c6
6 files changed, 19 insertions, 2 deletions
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index 33aef249db..ea20e2d7f3 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -1524,7 +1524,6 @@ static struct loadparm_context *global_loadparm_context;
/* These functions remain only in lib/param for now */
FN_GLOBAL_BOOL(readraw, bReadRaw)
-FN_GLOBAL_BOOL(unicode, bUnicode)
FN_GLOBAL_BOOL(writeraw, bWriteRaw)
FN_GLOBAL_STRING(cachedir, szCacheDir)
FN_GLOBAL_STRING(socket_address, szSocketAddress)
diff --git a/lib/param/param_functions.c b/lib/param/param_functions.c
index eb75f7da69..d12faa60e2 100644
--- a/lib/param/param_functions.c
+++ b/lib/param/param_functions.c
@@ -216,6 +216,7 @@ FN_GLOBAL_BOOL(syslog_only, bSyslogOnly)
FN_GLOBAL_BOOL(timestamp_logs, bTimestampLogs)
FN_GLOBAL_BOOL(time_server, bTimeServer)
FN_GLOBAL_BOOL(tls_enabled, tls_enabled)
+FN_GLOBAL_BOOL(unicode, bUnicode)
FN_GLOBAL_BOOL(unix_extensions, bUnixExtensions)
FN_GLOBAL_BOOL(unix_password_sync, bUnixPasswdSync)
FN_GLOBAL_BOOL(use_mmap, bUseMmap)
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 3a2bf1baa5..ddccbb73b4 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1163,6 +1163,7 @@ bool lp_host_msdfs(void);
bool lp_enhanced_browsing(void);
bool lp_use_mmap(void);
bool lp_unix_extensions(void);
+bool lp_unicode(void);
bool lp_use_spnego(void);
bool lp_client_use_spnego(void);
bool lp_client_use_spnego_principal(void);
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index dcb8467339..88cb44da57 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -191,6 +191,9 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
if (getenv("CLI_FORCE_ASCII")) {
force_ascii = true;
}
+ if (!lp_unicode()) {
+ force_ascii = true;
+ }
if (flags & CLI_FULL_CONNECTION_FORCE_ASCII) {
force_ascii = true;
}
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 2a9900b168..3a21ac4fe8 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -1595,6 +1595,14 @@ static struct parm_struct parm_table[] = {
.flags = FLAG_ADVANCED,
},
{
+ .label = "unicode",
+ .type = P_BOOL,
+ .p_class = P_GLOBAL,
+ .offset = GLOBAL_VAR(bUnicode),
+ .special = NULL,
+ .enum_list = NULL
+ },
+ {
.label = "min receivefile size",
.type = P_BYTES,
.p_class = P_GLOBAL,
@@ -4818,6 +4826,7 @@ static void init_globals(bool reinit_globals)
#else
Globals.bUseMmap = true;
#endif
+ Globals.bUnicode = true;
Globals.bUnixExtensions = true;
Globals.bResetOnZeroVC = false;
Globals.bLogWriteableFilesOnExit = false;
diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c
index 93af42b5c1..c9350afa49 100644
--- a/source3/smbd/negprot.c
+++ b/source3/smbd/negprot.c
@@ -274,7 +274,11 @@ static void reply_nt1(struct smb_request *req, uint16 choice)
req->flags2 | FLAGS2_EXTENDED_SECURITY);
}
- capabilities |= CAP_NT_SMBS|CAP_RPC_REMOTE_APIS|CAP_UNICODE;
+ capabilities |= CAP_NT_SMBS|CAP_RPC_REMOTE_APIS;
+
+ if (lp_unicode()) {
+ capabilities |= CAP_UNICODE;
+ }
if (lp_unix_extensions()) {
capabilities |= CAP_UNIX;