1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-24 02:04:21 +03:00

s3: smbd: Factor out setting up case parameters for a share to a function - conn_setup_case_options().

Will allow it to be reused in the msdfs temporary share code.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14612

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
This commit is contained in:
Jeremy Allison 2021-01-12 11:39:51 -08:00 committed by Anoop C S
parent 081afc495f
commit ab7700177c
3 changed files with 21 additions and 10 deletions

View File

@ -232,3 +232,22 @@ void conn_free(connection_struct *conn)
conn_free_internal(conn);
}
/*
* Correctly initialize a share with case options.
*/
void conn_setup_case_options(connection_struct *conn)
{
int snum = conn->params->service;
if (lp_case_sensitive(snum) == Auto) {
/* We will be setting this per packet. Set to be case
* insensitive for now. */
conn->case_sensitive = false;
} else {
conn->case_sensitive = (bool)lp_case_sensitive(snum);
}
conn->case_preserve = lp_preserve_case(snum);
conn->short_case_preserve = lp_short_preserve_case(snum);
}

View File

@ -156,6 +156,7 @@ connection_struct *conn_new(struct smbd_server_connection *sconn);
bool conn_idle_all(struct smbd_server_connection *sconn, time_t t);
void conn_clear_vuid_caches(struct smbd_server_connection *sconn, uint64_t vuid);
void conn_free(connection_struct *conn);
void conn_setup_case_options(connection_struct *conn);
void conn_force_tdis(
struct smbd_server_connection *sconn,
bool (*check_fn)(struct connection_struct *conn,

View File

@ -557,16 +557,7 @@ static NTSTATUS make_connection_snum(struct smbXsrv_connection *xconn,
( lp_enable_asu_support() && strequal(dev,"ADMIN$")) );
/* Case options for the share. */
if (lp_case_sensitive(snum) == Auto) {
/* We will be setting this per packet. Set to be case
* insensitive for now. */
conn->case_sensitive = False;
} else {
conn->case_sensitive = (bool)lp_case_sensitive(snum);
}
conn->case_preserve = lp_preserve_case(snum);
conn->short_case_preserve = lp_short_preserve_case(snum);
conn_setup_case_options(conn);
conn->encrypt_level = lp_server_smb_encrypt(snum);
if (conn->encrypt_level > SMB_ENCRYPTION_OFF) {