mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
s3:smbd: make mangle_fns const
metze
This commit is contained in:
parent
07e1e30b96
commit
7f2cf6b166
@ -6814,12 +6814,12 @@ bool name_to_8_3(const char *in,
|
||||
|
||||
/* The following definitions come from smbd/mangle_hash.c */
|
||||
|
||||
struct mangle_fns *mangle_hash_init(void);
|
||||
const struct mangle_fns *mangle_hash_init(void);
|
||||
|
||||
/* The following definitions come from smbd/mangle_hash2.c */
|
||||
|
||||
struct mangle_fns *mangle_hash2_init(void);
|
||||
struct mangle_fns *posix_mangle_init(void);
|
||||
const struct mangle_fns *mangle_hash2_init(void);
|
||||
const struct mangle_fns *posix_mangle_init(void);
|
||||
|
||||
/* The following definitions come from smbd/map_username.c */
|
||||
|
||||
|
@ -19,12 +19,12 @@
|
||||
|
||||
#include "includes.h"
|
||||
|
||||
static struct mangle_fns *mangle_fns;
|
||||
static const struct mangle_fns *mangle_fns;
|
||||
|
||||
/* this allows us to add more mangling backends */
|
||||
static const struct {
|
||||
const char *name;
|
||||
struct mangle_fns *(*init_fn)(void);
|
||||
const struct mangle_fns *(*init_fn)(void);
|
||||
} mangle_backends[] = {
|
||||
{ "hash", mangle_hash_init },
|
||||
{ "hash2", mangle_hash2_init },
|
||||
|
@ -673,7 +673,7 @@ static bool hash_name_to_8_3(const char *in,
|
||||
the following provides the abstraction layer to make it easier
|
||||
to drop in an alternative mangling implementation
|
||||
*/
|
||||
static struct mangle_fns mangle_fns = {
|
||||
static const struct mangle_fns mangle_hash_fns = {
|
||||
mangle_reset,
|
||||
is_mangled,
|
||||
must_mangle,
|
||||
@ -683,7 +683,7 @@ static struct mangle_fns mangle_fns = {
|
||||
};
|
||||
|
||||
/* return the methods for this mangling implementation */
|
||||
struct mangle_fns *mangle_hash_init(void)
|
||||
const struct mangle_fns *mangle_hash_init(void)
|
||||
{
|
||||
mangle_reset();
|
||||
|
||||
@ -691,5 +691,5 @@ struct mangle_fns *mangle_hash_init(void)
|
||||
tdb_mangled_cache = tdb_open_ex("mangled_cache", 1031, TDB_INTERNAL,
|
||||
(O_RDWR|O_CREAT), 0644, NULL, fast_string_hash);
|
||||
|
||||
return &mangle_fns;
|
||||
return &mangle_hash_fns;
|
||||
}
|
||||
|
@ -679,7 +679,7 @@ static void init_tables(void)
|
||||
/*
|
||||
the following provides the abstraction layer to make it easier
|
||||
to drop in an alternative mangling implementation */
|
||||
static struct mangle_fns mangle_fns = {
|
||||
static const struct mangle_fns mangle_hash2_fns = {
|
||||
mangle_reset,
|
||||
is_mangled,
|
||||
must_mangle,
|
||||
@ -689,7 +689,7 @@ static struct mangle_fns mangle_fns = {
|
||||
};
|
||||
|
||||
/* return the methods for this mangling implementation */
|
||||
struct mangle_fns *mangle_hash2_init(void)
|
||||
const struct mangle_fns *mangle_hash2_init(void)
|
||||
{
|
||||
/* the mangle prefix can only be in the mange 1 to 6 */
|
||||
mangle_prefix = lp_mangle_prefix();
|
||||
@ -703,7 +703,7 @@ struct mangle_fns *mangle_hash2_init(void)
|
||||
init_tables();
|
||||
mangle_reset();
|
||||
|
||||
return &mangle_fns;
|
||||
return &mangle_hash2_fns;
|
||||
}
|
||||
|
||||
static void posix_mangle_reset(void)
|
||||
@ -746,7 +746,7 @@ static bool posix_name_to_8_3(const char *in,
|
||||
}
|
||||
|
||||
/* POSIX paths backend - no mangle. */
|
||||
static struct mangle_fns posix_mangle_fns = {
|
||||
static const struct mangle_fns posix_mangle_fns = {
|
||||
posix_mangle_reset,
|
||||
posix_is_mangled,
|
||||
posix_must_mangle,
|
||||
@ -755,7 +755,7 @@ static struct mangle_fns posix_mangle_fns = {
|
||||
posix_name_to_8_3
|
||||
};
|
||||
|
||||
struct mangle_fns *posix_mangle_init(void)
|
||||
const struct mangle_fns *posix_mangle_init(void)
|
||||
{
|
||||
return &posix_mangle_fns;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user