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

smbd: Make lp_use_sendfile() static to reply.c

This is the only place where it's used. Also, via
smb_signing_is_active it pulls in the dependency on
'cli_smb_common' (which pulls in all of gensec) into the 'smbconf'
library. Without this, 'smbconf' is happy with just 'samba-hostconfig'
instead of 'cli_smb_common'

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2019-12-06 13:25:21 +01:00 committed by Jeremy Allison
parent 9e64022662
commit 61b86d30d0
3 changed files with 19 additions and 21 deletions

View File

@ -873,7 +873,6 @@ bool lp_disable_spoolss( void );
void lp_set_spoolss_state( uint32_t state );
uint32_t lp_get_spoolss_state( void );
struct smb_signing_state;
bool lp_use_sendfile(int snum, struct smb_signing_state *signing_state);
void set_use_sendfile(int snum, bool val);
void lp_set_mangling_method(const char *new_method);
bool lp_posix_pathnames(void);

View File

@ -4496,26 +4496,6 @@ uint32_t lp_get_spoolss_state( void )
return lp_disable_spoolss() ? SVCCTL_STOPPED : SVCCTL_RUNNING;
}
/*******************************************************************
Ensure we don't use sendfile if server smb signing is active.
********************************************************************/
bool lp_use_sendfile(int snum, struct smb_signing_state *signing_state)
{
bool sign_active = false;
/* Using sendfile blows the brains out of any DOS or Win9x TCP stack... JRA. */
if (get_Protocol() < PROTOCOL_NT1) {
return false;
}
if (signing_state) {
sign_active = smb_signing_is_active(signing_state);
}
return (lp__use_sendfile(snum) &&
(get_remote_arch() != RA_WIN95) &&
!sign_active);
}
/*******************************************************************
Turn off sendfile if we find the underlying OS doesn't support it.
********************************************************************/

View File

@ -3626,6 +3626,25 @@ static void reply_readbraw_error(struct smbXsrv_connection *xconn)
smbd_unlock_socket(xconn);
}
/*******************************************************************
Ensure we don't use sendfile if server smb signing is active.
********************************************************************/
static bool lp_use_sendfile(int snum, struct smb_signing_state *signing_state)
{
bool sign_active = false;
/* Using sendfile blows the brains out of any DOS or Win9x TCP stack... JRA. */
if (get_Protocol() < PROTOCOL_NT1) {
return false;
}
if (signing_state) {
sign_active = smb_signing_is_active(signing_state);
}
return (lp__use_sendfile(snum) &&
(get_remote_arch() != RA_WIN95) &&
!sign_active);
}
/****************************************************************************
Use sendfile in readbraw.
****************************************************************************/