static bool lpcfg_update(struct loadparm_context *lp_ctx)
{
struct debug_settings settings;
+ int max_protocol, min_protocol;
TALLOC_CTX *tmp_ctx;
tmp_ctx = talloc_new(lp_ctx);
unsetenv("SOCKET_TESTNONBLOCK");
}
+ /* Check if command line max protocol < min protocol, if so
+ * report a warning to the user.
+ */
+ max_protocol = lpcfg_client_max_protocol(lp_ctx);
+ min_protocol = lpcfg_client_min_protocol(lp_ctx);
+ if (lpcfg_client_max_protocol(lp_ctx) < lpcfg_client_min_protocol(lp_ctx)) {
+ const char *max_protocolp, *min_protocolp;
+ max_protocolp = lpcfg_get_smb_protocol(max_protocol);
+ min_protocolp = lpcfg_get_smb_protocol(min_protocol);
+ DBG_ERR("Max protocol %s is less than min protocol %s.\n",
+ max_protocolp, min_protocolp);
+ }
+
TALLOC_FREE(tmp_ctx);
return true;
}
{-1, NULL}
};
+const char* lpcfg_get_smb_protocol(int type)
+{
+ int i;
+ for (i = 1; enum_protocol[i].value != -1; i++) {
+ if (enum_protocol[i].value == type) {
+ return enum_protocol[i].name;
+ }
+ }
+ return NULL;
+}
+
static const struct enum_list enum_security[] = {
{SEC_AUTO, "AUTO"},
{SEC_USER, "USER"},
bool bRetval;
TALLOC_CTX *frame = talloc_stackframe();
struct loadparm_context *lp_ctx;
+ int max_protocol, min_protocol;
DEBUG(3, ("lp_load_ex: refreshing parameters\n"));
bAllowIncludeRegistry = true;
+ /* Check if command line max protocol < min protocol, if so
+ * report a warning to the user.
+ */
+ max_protocol = lp_client_max_protocol();
+ min_protocol = lp_client_min_protocol();
+ if (max_protocol < min_protocol) {
+ const char *max_protocolp, *min_protocolp;
+ max_protocolp = lpcfg_get_smb_protocol(max_protocol);
+ min_protocolp = lpcfg_get_smb_protocol(min_protocol);
+ DBG_ERR("Max protocol %s is less than min protocol %s.\n",
+ max_protocolp, min_protocolp);
+ }
+
TALLOC_FREE(frame);
return (bRetval);
}