From: Volker Lendecke Date: Tue, 13 Dec 2022 16:31:53 +0000 (+0100) Subject: smbd: Make set_current_case_sensitive() static X-Git-Tag: talloc-2.4.0~239 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49fdf8f9ec967fb39f88f54752b2bf25e89672e5;p=thirdparty%2Fsamba.git smbd: Make set_current_case_sensitive() static This is a SMB1-only thing Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index a9060aeafc1..b1ad45667a0 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -1047,7 +1047,6 @@ void smbd_exit_server_cleanly(const char *const reason) _NORETURN_; bool set_conn_connectpath(connection_struct *conn, const char *connectpath); bool canonicalize_connect_path(connection_struct *conn); NTSTATUS set_conn_force_user_group(connection_struct *conn, int snum); -void set_current_case_sensitive(connection_struct *conn, uint16_t flags); bool chdir_current_service(connection_struct *conn); void load_registry_shares(void); int add_home_service(const char *service, const char *username, const char *homedir); diff --git a/source3/smbd/smb1_process.c b/source3/smbd/smb1_process.c index 9edfa2116e9..e8542e4c5dc 100644 --- a/source3/smbd/smb1_process.c +++ b/source3/smbd/smb1_process.c @@ -1017,6 +1017,53 @@ static void smb1srv_update_crypto_flags(struct smbXsrv_session *session, return; } +static void set_current_case_sensitive(connection_struct *conn, uint16_t flags) +{ + int snum; + enum remote_arch_types ra_type; + + SMB_ASSERT(conn != NULL); + + snum = SNUM(conn); + + if ((conn == last_conn) && (last_flags == flags)) { + return; + } + + last_conn = conn; + last_flags = flags; + + /* + * Obey the client case sensitivity requests - only for clients that + * support it. */ + switch (lp_case_sensitive(snum)) { + case Auto: + /* + * We need this uglyness due to DOS/Win9x clients that lie + * about case insensitivity. */ + ra_type = get_remote_arch(); + if (conn->sconn->using_smb2) { + conn->case_sensitive = false; + } else if ((ra_type != RA_SAMBA) && (ra_type != RA_CIFSFS)) { + /* + * Client can't support per-packet case sensitive + * pathnames. */ + conn->case_sensitive = false; + } else { + conn->case_sensitive = + !(flags & FLAG_CASELESS_PATHNAMES); + } + break; + case True: + conn->case_sensitive = true; + break; + default: + conn->case_sensitive = false; + break; + } + return; +} + /**************************************************************************** Prepare everything for calling the actual request function, and potentially call the request function via the "new" interface. diff --git a/source3/smbd/smb2_service.c b/source3/smbd/smb2_service.c index 6b821e6da70..6670b8a5a13 100644 --- a/source3/smbd/smb2_service.c +++ b/source3/smbd/smb2_service.c @@ -90,57 +90,6 @@ bool set_conn_connectpath(connection_struct *conn, const char *connectpath) return true; } -/**************************************************************************** - Load parameters specific to a connection/service. -****************************************************************************/ - -void set_current_case_sensitive(connection_struct *conn, uint16_t flags) -{ - int snum; - enum remote_arch_types ra_type; - - SMB_ASSERT(conn != NULL); - - snum = SNUM(conn); - - if ((conn == last_conn) && (last_flags == flags)) { - return; - } - - last_conn = conn; - last_flags = flags; - - /* - * Obey the client case sensitivity requests - only for clients that - * support it. */ - switch (lp_case_sensitive(snum)) { - case Auto: - /* - * We need this uglyness due to DOS/Win9x clients that lie - * about case insensitivity. */ - ra_type = get_remote_arch(); - if (conn->sconn->using_smb2) { - conn->case_sensitive = false; - } else if ((ra_type != RA_SAMBA) && (ra_type != RA_CIFSFS)) { - /* - * Client can't support per-packet case sensitive - * pathnames. */ - conn->case_sensitive = false; - } else { - conn->case_sensitive = - !(flags & FLAG_CASELESS_PATHNAMES); - } - break; - case True: - conn->case_sensitive = true; - break; - default: - conn->case_sensitive = false; - break; - } - return; -} - bool chdir_current_service(connection_struct *conn) { const struct smb_filename connectpath_fname = {