mirror of https://github.com/CISOfy/lynis.git
Comment out unused function RealFilename
This commit is contained in:
parent
526c519300
commit
a59731405f
|
@ -1094,36 +1094,37 @@
|
|||
# Name : RealFilename()
|
||||
# Description : Return file behind a symlink
|
||||
# Returns : sFILE
|
||||
RealFilename()
|
||||
{
|
||||
sFILE=$1
|
||||
FileIsWorldExecutable=""
|
||||
SYMLINK=0
|
||||
|
||||
# Check for symlink
|
||||
if [ -L ${sFILE} ]; then
|
||||
if [ ! "${READLINKBINARY}" = "" ]; then
|
||||
tFILE=`${READLINKBINARY} -f ${sFILE}`
|
||||
# Check if we can find the file now
|
||||
if [ -f ${tFILE} ]; then
|
||||
rFILE="${tFILE}"
|
||||
logtext "Result: symlink found, pointing to ${sFILE}"
|
||||
SYMLINK=1
|
||||
else
|
||||
# Check the full path of the symlink, strip the filename, copy the path and linked filename together
|
||||
tDIR=`echo ${sFILE} | awk '{match($1, "^.*/"); print substr($1, 1, RLENGTH-1)}'`
|
||||
tFILE="${tDIR}/${tFILE}"
|
||||
if [ -f ${tFILE} ]; then
|
||||
rFILE="${tFILE}"
|
||||
logtext "Result: symlink found, seems to be ${rFILE}"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
else
|
||||
# No symlink
|
||||
rFILE="${sFILE}"
|
||||
fi
|
||||
}
|
||||
# Notes : This function is unused, use ShowSymlinkPath instead
|
||||
#RealFilename()
|
||||
# {
|
||||
# sFILE=$1
|
||||
# FileIsWorldExecutable=""
|
||||
# SYMLINK=0
|
||||
#
|
||||
# # Check for symlink
|
||||
# if [ -L ${sFILE} ]; then
|
||||
# if [ ! "${READLINKBINARY}" = "" ]; then
|
||||
# tFILE=`${READLINKBINARY} -f ${sFILE}`
|
||||
# # Check if we can find the file now
|
||||
# if [ -f ${tFILE} ]; then
|
||||
# rFILE="${tFILE}"
|
||||
# logtext "Result: symlink found, pointing to ${sFILE}"
|
||||
# SYMLINK=1
|
||||
# else
|
||||
# # Check the full path of the symlink, strip the filename, copy the path and linked filename together
|
||||
# tDIR=`echo ${sFILE} | awk '{match($1, "^.*/"); print substr($1, 1, RLENGTH-1)}'`
|
||||
# tFILE="${tDIR}/${tFILE}"
|
||||
# if [ -f ${tFILE} ]; then
|
||||
# rFILE="${tFILE}"
|
||||
# logtext "Result: symlink found, seems to be ${rFILE}"
|
||||
# fi
|
||||
# fi
|
||||
# fi
|
||||
# else
|
||||
# # No symlink
|
||||
# rFILE="${sFILE}"
|
||||
# fi
|
||||
# }
|
||||
|
||||
|
||||
################################################################################
|
||||
|
|
Loading…
Reference in New Issue