From: Volker Lendecke Date: Fri, 6 Dec 2019 12:25:21 +0000 (+0100) Subject: smbd: Make lp_use_sendfile() static to reply.c X-Git-Tag: ldb-2.1.0~400 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61b86d30d0218aab274601dd8d7d5c1ff6b5cf4f;p=thirdparty%2Fsamba.git 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 Reviewed-by: Jeremy Allison --- diff --git a/source3/include/proto.h b/source3/include/proto.h index 583814ea1bc..d543dc66955 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -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); diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index fd5d90569cc..bef24b6821b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -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. ********************************************************************/ diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index f2d0b878e20..3c0c7dbb631 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -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. ****************************************************************************/