Correct test for native largefiles. We need big unsigned long as well
This commit is contained in:
parent
d21ae4b085
commit
f8bc2da042
|
|
@ -12,6 +12,9 @@ Version NEXT
|
|||
inetd to work correctly using fspd socket activation.
|
||||
fspd exits with err 8 if can't write pidfile after forking
|
||||
add error exit 9 if fspd can't send back reply to client
|
||||
correct check for native largefiles. Because we are using unsigned
|
||||
long internaly as pointer to offset for portability, we have to
|
||||
be sure that usingned long is 8 or more bytes long
|
||||
|
||||
Version 2.8.1b29 - 24 Aug 2019
|
||||
added scons command line argument without-fspscan=yes for building
|
||||
|
|
|
|||
|
|
@ -84,7 +84,8 @@ conf = Configure(env,{'checkForCCOption':checkForCCOption,
|
|||
'checkForBuildingServer':checkForBuildingServer,
|
||||
'checkForBuildingFspscan':checkForBuildingFspscan,
|
||||
'checkDSSSLProcessor':checkDSSSLProcessor,
|
||||
'findDocbookStylesheets':findDocbookStylesheets
|
||||
'findDocbookStylesheets':findDocbookStylesheets,
|
||||
'checkForLargeFiles':enableLargeFiles
|
||||
})
|
||||
if not conf.CheckCC(): Exit(1)
|
||||
# check for CC options
|
||||
|
|
@ -143,7 +144,7 @@ if conf.CheckCHeader('utmpx.h'):
|
|||
conf.env.Append(CPPFLAGS = '-DHAVE_UTMPX_H')
|
||||
if not conf.CheckType("union semun", "#include <sys/types.h>\n#include <sys/ipc.h>\n#include <sys/sem.h>",'c'):
|
||||
conf.env.Append(CPPFLAGS = "-D_SEM_SEMUN_UNDEFINED=1")
|
||||
enableLargeFiles(conf)
|
||||
conf.checkForLargeFiles(conf)
|
||||
conf.checkForLockingType(conf)
|
||||
if conf.checkReliableSignals():
|
||||
conf.env.Append(CPPFLAGS = '-DRELIABLE_SIGNALS')
|
||||
|
|
|
|||
1
TODO
1
TODO
|
|
@ -12,7 +12,6 @@ TESTSUITE NEEDED:
|
|||
Write a simple FSP protocol test suite using one
|
||||
of its client libraries (Java, C, Python, Perl)
|
||||
automatic test for remote buffer overflows
|
||||
Test if >2GB files but <4GB works correctly with and without --disable-largefile
|
||||
|
||||
POSSIBLE SECURITY BUG:
|
||||
symlink to FILE can escape from FSP root directory. OLD known problem.
|
||||
|
|
|
|||
|
|
@ -1,16 +1,17 @@
|
|||
#
|
||||
# SCons Largefile enablement
|
||||
#
|
||||
# Version 1.2
|
||||
# 16-Aug-2019
|
||||
# Version 1.3
|
||||
# 06-Jun-2020
|
||||
#
|
||||
|
||||
def enableLargeFiles(conf):
|
||||
def enableLargeFiles(check,conf):
|
||||
"""Tries to enable 64-bit off_t on linux platform"""
|
||||
fseeko=conf.CheckFunc('fseeko')
|
||||
if fseeko:
|
||||
conf.env.Append(CPPFLAGS = '-DHAVE_FSEEKO')
|
||||
offt=conf.CheckTypeSize('off_t','#include <stdio.h>\n#include <sys/types.h>')
|
||||
ulong=conf.CheckTypeSize('unsigned long')
|
||||
if offt<8 and offt>0:
|
||||
flags=conf.env.Dictionary()['CPPFLAGS']
|
||||
conf.env.Append(CPPFLAGS='-D_FILE_OFFSET_BITS=64')
|
||||
|
|
@ -22,9 +23,10 @@ def enableLargeFiles(conf):
|
|||
#set default value to 4
|
||||
offt=4
|
||||
conf.env.Append(CPPFLAGS = '-DSIZEOF_OFF_T='+str(offt))
|
||||
if fseeko and int(offt)>=8:
|
||||
check.Message("Checking if we have native large files ...")
|
||||
if fseeko and int(offt)>=8 and int(ulong)>=8:
|
||||
conf.env.Append(CPPFLAGS = '-DNATIVE_LARGEFILES')
|
||||
rc=True
|
||||
else:
|
||||
rc=False
|
||||
return rc
|
||||
check.Result(rc)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user