INHERIT_OWNER_UNIX_ONLY
};
+/* mangled names options */
+enum mangled_names_options {MANGLED_NAMES_NO, MANGLED_NAMES_YES};
+
/*
* Default passwd chat script.
*/
{INHERIT_OWNER_UNIX_ONLY, "unix only"},
{-1, NULL}};
+static const struct enum_list enum_mangled_names[] = {
+ {MANGLED_NAMES_NO, "no"},
+ {MANGLED_NAMES_NO, "false"},
+ {MANGLED_NAMES_NO, "0"},
+ {MANGLED_NAMES_YES, "yes"},
+ {MANGLED_NAMES_YES, "true"},
+ {MANGLED_NAMES_YES, "1"},
+ {-1, NULL}
+};
+
/* Note: We do not initialise the defaults union - it is not allowed in ANSI C
*
* NOTE: Handling of duplicated (synonym) parameters:
.oplocks = true,
.kernel_oplocks = false,
.level2_oplocks = true,
- .mangled_names = true,
+ .mangled_names = MANGLED_NAMES_YES,
.wide_links = false,
.follow_symlinks = true,
.sync_always = false,
bool mangle_must_mangle(const char *fname,
const struct share_params *p)
{
- if (!lp_mangled_names(p)) {
+ if (lp_mangled_names(p) == MANGLED_NAMES_NO) {
return False;
}
return mangle_fns->must_mangle(fname, p);
/* name mangling can be disabled for speed, in which case
we just truncate the string */
- if (!lp_mangled_names(p)) {
+ if (lp_mangled_names(p) == MANGLED_NAMES_NO) {
strlcpy(out, in, 13);
return True;
}
bool ok;
uint64_t last_entry_off = 0;
NTSTATUS status;
+ enum mangled_names_options mangled_names;
+ bool marshall_with_83_names;
+
+ mangled_names = lp_mangled_names(conn->params);
ZERO_STRUCT(state);
state.conn = conn;
state.info_level = info_level;
- state.check_mangled_names = lp_mangled_names(conn->params);
+ if (mangled_names != MANGLED_NAMES_NO) {
+ state.check_mangled_names = true;
+ }
state.has_wild = dptr_has_wild(dirptr);
state.got_exact_match = false;
*got_exact_match = state.got_exact_match;
+ marshall_with_83_names = (mangled_names == MANGLED_NAMES_YES);
+
status = smbd_marshall_dir_entry(ctx,
conn,
flags2,
info_level,
name_list,
- state.check_mangled_names,
+ marshall_with_83_names,
requires_resume_key,
mode,
fname,